Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
titlePlug and play xarray access
collapsetrue
import xarray as xr

# Geo-chunked data for access optimised along the time dimension (e.g. for time-series at a single point)
# Pressure
pressure_geo_url = "https://arco.datastores.ecmwf.int/cadl-arco-geo-048/arco/reanalysis_era5_pressure_levels/pl/geoChunked.zarr"

# Time-chunked data for access optimised along the timespace dimension (e.g. for short-time period for large areas)
# Pressure
pressure_time_url = "https://arco.datastores.ecmwf.int/cadl-arco-time-048/arco/reanalysis_era5_pressure_levels/pl/timeChunked.zarr"

# Open one of the Zarr objects with xarray, the default example opens the geo-chunked surface variables
ds = xr.open_zarr(
    surface_geo_url,
    consolidated=True,
    storage_options={
        "headers": {"Authorization": f"Bearer <CDS-API-KEY>"}
    }
)

# Inspect the variables
print(ds)

...