Skip to content

fix!: do not shift longitude values - #330

Open
aaron-hopkinson wants to merge 1 commit into
mainfrom
fix/longitude_shift
Open

aaron-hopkinson wants to merge 1 commit into
mainfrom
fix/longitude_shift

Conversation

@aaron-hopkinson

@aaron-hopkinson aaron-hopkinson commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Description

The ECMWF ODB source returns longitudes on the [-180,180] range, which is different from e.g. the MARS ERA5 data, where it is [0, 360] – this meant that the superob code wrapped the longitudes to deal with this data. A better solution would be to keep not change the range within filters, and either adapt sources so they output data with consistent longitude ranges, or make them consistent only when combining datasets.

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.

@neill-b

neill-b commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

To get this to work as intended, I also needed to adjust the grid specification in irregular_to_grid. In _define_grid the line changing the longitudes should become:
lon = np.where(grid_info["longitudes"] < 0, grid_info["longitudes"] + 360, grid_info["longitudes"])
As the previous line reset the longitudes to the range [180, 180).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: To be triaged

Development

Successfully merging this pull request may close these issues.

2 participants