我正在寻找使用阅读远程 zarr 商店xarray.open_mfdataset()
我得到一个zarr.errors.GroupNotFoundError: group not found at path ''
. 追溯在底部。
import xarray as xr
import s3fs
fs = s3fs.S3FileSystem(anon=True)
uri = "s3://era5-pds/zarr/2020/12/data/eastward_wind_at_10_metres.zarr"
file = s3fs.S3Map(uri, s3=fs)
ds = xr.open_mfdataset(file, engine="zarr")
我可以使用打开它xr.open_zarr
ds = xr.open_zarr(file)
如果我要在本地下载 zarr 商店,它可以正常工作
import xarray as xr
import s3fs
fs = s3fs.S3FileSystem(anon=True)
fs.get("s3://era5-pds/zarr/2020/12/data/eastward_wind_at_10_metres.zarr/*", "eastward_wind_at_10_metres.zarr", recursive=True)
ds = xr.open_mfdataset("eastward_wind_at_10_metres.zarr", engine="zarr")
open_mfdataset
远程 zarr 商店的引用
>>> ds = xr.open_mfdataset(file, engine="zarr")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ray.bell/miniconda/envs/test_env/lib/python3.8/site-packages/xarray/backends/api.py", line 948, in open_mfdataset
datasets = [open_(p, **open_kwargs) for p in paths]
File "/Users/ray.bell/miniconda/envs/test_env/lib/python3.8/site-packages/xarray/backends/api.py", line 948, in <listcomp>
datasets = [open_(p, **open_kwargs) for p in paths]
File "/Users/ray.bell/miniconda/envs/test_env/lib/python3.8/site-packages/xarray/backends/api.py", line 572, in open_dataset
store = opener(filename_or_obj, **extra_kwargs, **backend_kwargs)
File "/Users/ray.bell/miniconda/envs/test_env/lib/python3.8/site-packages/xarray/backends/zarr.py", line 296, in open_group
zarr_group = zarr.open_group(store, **open_kwargs)
File "/Users/ray.bell/miniconda/envs/test_env/lib/python3.8/site-packages/zarr/hierarchy.py", line 1166, in open_group
raise GroupNotFoundError(path)
zarr.errors.GroupNotFoundError: group not found at path ''