Skip to content

Add an xarray data source with ERA5 zarr example configurations - #3179

Draft
bouweandela wants to merge 5 commits into
mainfrom
add-xarray-datasource
Draft

Add an xarray data source with ERA5 zarr example configurations#3179
bouweandela wants to merge 5 commits into
mainfrom
add-xarray-datasource

Conversation

@bouweandela

@bouweandela bouweandela commented Jul 24, 2026

Copy link
Copy Markdown
Member

Description

Example usage:

Run

esmvaltool config copy data-gcs-era5.yml

or

esmvaltool config copy data-cds-era5.yml

to configure the data source. For the Climate Data Store, edit the file ~/.config/esmvaltool/data-cds-era5.yml to enter your CDS API key.

CMORized ERA5 data can then be loaded with:

In [1]: from esmvalcore.dataset import Dataset

In [2]: ds = Dataset(
   ...:     dataset="ERA5",
   ...:     project="native6",
   ...:     mip="E1hr",
   ...:     frequency="1hr",
   ...:     short_name="tas",
   ...: )

In [3]: ds.load()
Out[3]: <iris 'Cube' of air_temperature / (K) (time: 1323648; latitude: 721; longitude: 1440)>

or similar from a recipe. Inspiration on how to populate the variables key that maps between ERA5 and CMIP6 names can be found in recipe_daily_era5.yml.

Related to #2584

Link to documentation: https://esmvaltool--3179.org.readthedocs.build/projects/ESMValCore/en/3179/api/esmvalcore.io.xarray.html

Maybe we need to add the dependencies needed for various data sources as extras to avoid bloating our dependencies. Here gcsfs is needed to access data from Google Cloud Storage, but in #2917 we need xcube, and in #2690 we need intake-esm, etc.


Before you get started

Checklist

It is the responsibility of the author to make sure the pull request is ready to review. The icons indicate whether the item will be subject to the 🛠 Technical or 🧪 Scientific review.


To help with the number pull requests:

@codecov

codecov Bot commented Jul 24, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 60.81081% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.23%. Comparing base (583dcb7) to head (8112686).

Files with missing lines Patch % Lines
esmvalcore/io/xarray.py 60.81% 29 Missing ⚠️

❌ Your patch check has failed because the patch coverage (60.81%) is below the target coverage (100.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3179      +/-   ##
==========================================
- Coverage   96.39%   96.23%   -0.17%     
==========================================
  Files         280      281       +1     
  Lines       16248    16322      +74     
==========================================
+ Hits        15663    15708      +45     
- Misses        585      614      +29     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bouweandela bouweandela added the enhancement New feature or request label Jul 24, 2026
@bouweandela bouweandela changed the title Add an xarray data source Add an xarray data source with ERA5 example configurations Jul 24, 2026
@bouweandela bouweandela changed the title Add an xarray data source with ERA5 example configurations Add an xarray data source with ERA5 zarr example configurations Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant