open_mfdataset not working as expected with rasterio engine? #6231
Unanswered
pstefa1707
asked this question in
Q&A
Replies: 2 comments 1 reply
-
Have the same problem. Did you find a solution? |
Beta Was this translation helpful? Give feedback.
1 reply
-
Since you're using GDAL paths, for this particular case you can create a GDAL VRT and open that: !gdalbuildvrt -separate stack.vrt {vsipath1} {vsipath2}
ds = xr.open_dataset('stack.vrt', engine='rasterio') But yes, you're right it is a bit confusing that open_dataset works with a vsipath but open_mfdataset does not. Seems like the logic for figuring out if the string is a local or remote path is slightly different from the full traceback: File ~/miniforge3/envs/xarray/lib/python3.11/site-packages/xarray/backends/api.py:230, in _get_mtime(filename_or_obj)
227 path = None
229 if path and not is_remote_uri(path):
--> 230 mtime = os.path.getmtime(os.path.expanduser(filename_or_obj))
232 return mtime
File <frozen genericpath>:55, in getmtime(filename)
FileNotFoundError: [Errno 2] No such file or directory: ... |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
As the title says, using
open_dataset
with theengine="rasterio"
kwarg works as expected.However, using
open_mfdataset
throws aFileNotFoundError
. Note my raster datasets are ons3
and are gunzipped.Is there something I am doing wrong? thanks for the help!
Edit:
Interesting, if I add the "chunks" parameter to
open_dataset
I will encounter the sameFileNotFoundError
Beta Was this translation helpful? Give feedback.
All reactions