Skip to content

feat: extract constants and climatologies from a dataset for use in inference#628

Open
b8raoult wants to merge 3 commits intomainfrom
feat/export-constants-and-climatologies
Open

feat: extract constants and climatologies from a dataset for use in inference#628
b8raoult wants to merge 3 commits intomainfrom
feat/export-constants-and-climatologies

Conversation

@b8raoult
Copy link
Copy Markdown
Collaborator

@b8raoult b8raoult commented May 6, 2026

Inference will need the constant fields as well as the climatologies (12 fields, one per calendar month) used during training. The new command extract extract these and write them into a NetCDF file, that will be later used by anemoi-inference (to be implemented).

Example:

anemoi-datasets extract --constant z --constant lsm --climatology lai_hv --climatology  lai_lv aifs-rd-an-oper-i6aj-mars-o96-2010-2022-1h-v1-ecland-era5met out.nc

Will extract the constants z (orography) and ism (land-sea mask), and the climatologies lai_lv (leaf area index, low vegetation) and lai_hv (leaf area index, high vegetation) into out.nc

The NetCDF follows the CF convention for climatologies:

netcdf out {
dimensions:
        values = 40320 ;
        time = 12 ;
        nv = 2 ;
variables:
        double latitude(values) ;
                latitude:units = "degrees_north" ;
        double longitude(values) ;
                longitude:units = "degrees_east" ;
        float z(values) ;
        float lsm(values) ;
        double time(time) ;
                time:units = "days since 2000-01-01" ;
                time:climatology = "climatology_bounds" ;
                time:calendar = "gregorian" ;
        double climatology_bounds(time, nv) ;
        float lai_hv(time, values) ;
                lai_hv:cell_methods = "time: mean within years time: mean over years" ;
        float lai_lv(time, values) ;
                lai_lv:cell_methods = "time: mean within years time: mean over years" ;

Description

What problem does this change solve?

What issue or task does this change relate to?

Additional notes

As a contributor to the Anemoi framework, please ensure that your changes include unit tests, updates to any affected dependencies and documentation, and have been tested in a parallel setting (i.e., with multiple GPUs). As a reviewer, you are also responsible for verifying these aspects and requesting changes if they are not adequately addressed. For guidelines about those please refer to https://anemoi.readthedocs.io/en/latest/

By opening this pull request, I affirm that all authors agree to the Contributor License Agreement.


📚 Documentation preview 📚: https://anemoi-datasets--628.org.readthedocs.build/en/628/

@github-project-automation github-project-automation Bot moved this to To be triaged in Anemoi-dev May 6, 2026
@github-actions github-actions Bot added tests enhancement New feature or request labels May 6, 2026
Co-authored-by: Copilot <copilot@github.com>
@github-actions github-actions Bot added the documentation Improvements or additions to documentation label May 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request tests

Projects

Status: To be triaged

Development

Successfully merging this pull request may close these issues.

1 participant