Skip to content

Commit 67ab366

Browse files
committed
Full fsspec support is btoken, fall back to half-working
1 parent 47723d3 commit 67ab366

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

xarray_sentinel/sentinel1.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,13 @@ def open_rasterio_dataarray(
521521
raise FileNotFoundError(str(ex))
522522
raise
523523
else:
524-
arr = xr.open_dataarray(fs.open(measurement), engine="rasterio", chunks=chunks)
524+
# FIXME: rioxarray / rasterio do not support opening a file object any more, so
525+
# full fsspec support via `fs.open(measurement)` is now broken and we fall back
526+
# to hope that rasterio remote protocols works with fsspec urlpaths
527+
maybe_rasterio_urlpath = fs.unstrip_protocol(measurement)
528+
arr = xr.open_dataarray(
529+
maybe_rasterio_urlpath, engine="rasterio", chunks=chunks
530+
)
525531
return arr
526532

527533

0 commit comments

Comments
 (0)