esmvalcore.io.xarray#
Access data using xarray.open_dataset().
To use this module, copy one of the following configuration files to your configuration directory:
data-cds-era5.ymlEnable access to ERA5 data stored in the Copernicus Climate Data Store (CDS):
esmvaltool config copy data-cds-era5.ymlThe file content is:
# Read ERA5 data in zarr format on Climate Data Store. # Go to # https://github.com/ecmwf-training/dss-notebooks/blob/main/datasets%2Freanalysis-era5-single-levels%2Farco-access.ipynb # for further information. projects: native6: data: cds-era5-zarr: type: esmvalcore.io.xarray.XarrayDataSource # Available stores: # - Geo-chunked surface levels data (optimised for time-series at a single location): # https://arco.datastores.ecmwf.int/cadl-arco-geo-002/arco/reanalysis_era5_single_levels/sfc/geoChunked.zarr # - Time-chunked surface levels data (optimised for global map at a single time step): # https://arco.datastores.ecmwf.int/cadl-arco-time-002/arco/reanalysis_era5_single_levels/sfc/timeChunked.zarr # - Geo-chunked wave data (optimised for time-series at a single location): # https://arco.datastores.ecmwf.int/cadl-arco-geo-003/arco/reanalysis_era5_single_levels/wav/geoChunked.zarr # - Time-chunked wave data (optimised for global map at a single time step): # https://arco.datastores.ecmwf.int/cadl-arco-time-003/arco/reanalysis_era5_single_levels/wav/timeChunked.zarr store: "https://arco.datastores.ecmwf.int/cadl-arco-time-002/arco/reanalysis_era5_single_levels/sfc/timeChunked.zarr" options: chunks: "auto" consolidated: true engine: "zarr" storage_options: headers: Authorization: "Bearer <INSERT YOUR CDS API KEY HERE>" variables: t2m: tas facets: dataset: "ERA5" frequency: "1hr"
Then edit the copied file and replace the text
<INSERT YOUR CDS API KEY HERE>with your personal CDS API key.data-gcs-era5.ymlEnable access to ERA5 data stored in Google Cloud Storage:
esmvaltool config copy data-gcs-era5.ymlInstall gcsfs alongside ESMValCore to use this data source.
Classes:
|
Data source that can find data using |
|
A dataset that can load data using |
- class esmvalcore.io.xarray.XarrayDataSource(name: str, project: str, priority: int, variables: dict[str, str], facets: Facets, store: str, options: dict[str, Any] = <factory>)[source]#
Bases:
DataSourceData source that can find data using
xarray.Attributes:
A string containing debug information when no data is found.
Facets that will be added to the data elements found using this data source.
A name identifying the data source.
Options to use when opening the data store.
The priority of the data source.
The project that the data source provides data for.
The store used to load the data.
Mapping between the dataset variable name and ESMValCore
short_name.Methods:
find_data(**facets)Find data.
- Parameters:
- facets: Facets#
Facets that will be added to the data elements found using this data source.
- find_data(**facets: FacetValue) list[XarrayDataset][source]#
Find data.
- Parameters:
**facets (FacetValue) – Find data matching these facets.
- Returns:
A list of data elements that have been found.
- Return type:
- class esmvalcore.io.xarray.XarrayDataset(name: str, facets: Facets, store: str, options: dict[str, Any] = <factory>)[source]#
Bases:
DataElementA dataset that can load data using
xarray.Attributes:
Attributes are key-value pairs describing the data.
Facets are key-value pairs that were used to find this data.
A unique name identifying the dataset.
Options to use when opening the data.
The data store containing the data.
Methods:
- facets: Facets#
Facets are key-value pairs that were used to find this data.
- to_iris() iris.cube.CubeList[source]#
Load the data as Iris cubes.
- Returns:
The loaded data.
- Return type: