我想阅读https://hrrrzarr.s3.amazonaws.com/index.html#sfc/20210208/20210208_00z_anl.zarr/的远程 zarr 商店。zarr 商店的信息位于https://mesowest.utah.edu/html/hrrr/zarr_documentation/zarrFileVariables.html
我能够读取一个变量,但它似乎没有捕获与变量关联的坐标或属性(我很可能缺少 kwargs to open_mfdataset
or open_zarr
)。因为有不同级别的嵌套,我不确定通过的正确路径是什么
import xarray as xr
import s3fs
fs = s3fs.S3FileSystem(anon=True)
uri = "s3://hrrrzarr/sfc/20210208/20210208_00z_anl.zarr/10m_above_ground/UGRD/10m_above_ground"
file = s3fs.S3Map(uri, s3=fs)
ds = xr.open_mfdataset([file], engine="zarr")
>>> ds
<xarray.Dataset>
Dimensions: (projection_x_coordinate: 1799, projection_y_coordinate: 1059)
Dimensions without coordinates: projection_x_coordinate, projection_y_coordinate
Data variables:
UGRD (projection_y_coordinate, projection_x_coordinate) float16 dask.array<chunksize=(150, 150), meta=np.ndarray>
uri = "s3://hrrrzarr/sfc/20210208/20210208_00z_anl.zarr/10m_above_ground/UGRD"
file = s3fs.S3Map(uri, s3=fs)
ds = xr.open_mfdataset([file], engine="zarr")
>>> ds
<xarray.Dataset>
Dimensions: (projection_x_coordinate: 1799, projection_y_coordinate: 1059)
Coordinates:
* projection_x_coordinate (projection_x_coordinate) float64 -2.698e+06 ......
* projection_y_coordinate (projection_y_coordinate) float64 -1.587e+06 ......
Data variables:
forecast_period timedelta64[ns] ...
forecast_reference_time datetime64[ns] ...
height float64 ...
pressure float64 ...
time datetime64[ns] ...