path_xarr_dst#
- path_xarr_dst(function: Callable) Callable [source]#
Path,
xarray.Dataset
,xarray.DataArray
,or dataset decorator. Allows a function to ingest:a path
a
xarray
a
rasterio
dataset
- Parameters:
function (Callable) – Function to decorate
- Returns:
decorated function
- Return type:
Callable
Examples
>>> # Create mock function >>> @path_or_dst >>> def fct(ds): >>> read(ds) >>> >>> # Test the two ways >>> read1 = fct("path/to/raster.tif") >>> with rasterio.open("path/to/raster.tif") as ds: >>> read2 = fct(ds) >>> >>> # Test >>> read1 == read2 True