Skip to content

Fix units and long names of derived ERA5 variables - #521

Merged
fneum merged 2 commits into
PyPSA:masterfrom
Blizzeq:fix/509-era5-attrs
Oct 3, 2026
Merged

fneum merged 2 commits into
PyPSA:masterfrom
Blizzeq:fix/509-era5-attrs

Conversation

@Blizzeq

@Blizzeq Blizzeq commented Sep 30, 2026

Copy link
Copy Markdown
Contributor

Closes #509.

Changes proposed in this Pull Request

Sets the units and long_name of the derived ERA5 variables that carried attributes from their inputs:

  • height: m, Height (was m**2 s**-2, Geopotential)
  • wnd_azimuth: rad, 100 metre wind azimuth (was the u100 component's m s**-1)
  • solar_altitude / solar_azimuth: long_name solar altitude / solar azimuth (was latitude), set in SolarPosition

Only metadata changes; values are the same. The helpers are shared, so era5-edh gets the same fix. I left the capitalisation of the other long_names (point 4 in the issue) as they are.

test/test_era5_attrs.py builds small synthetic datasets and checks the attributes, so it needs no download; all three tests fail on master. The other offline tests give the same results as on master (the failures there need network or cutouts).

Checklist

  • Code changes are sufficiently documented; i.e. new functions contain docstrings and further explanations may be given in doc.
  • Unit tests for new features were added (if applicable).
  • Newly introduced dependencies are added to environment.yaml, environment_docs.yaml and setup.py (if applicable).
  • A note for the release notes doc/release_notes.rst of the upcoming release is included.
  • I consent to the release of this PR's code under the MIT license.

height kept the geopotential attributes, wnd_azimuth the u100 wind
component's, and solar_altitude/solar_azimuth inherited latitude's
long_name. Set the right units and names; values are unchanged.

Closes PyPSA#509
@fneum
fneum merged commit 1343199 into PyPSA:master Oct 3, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ERA5 weather variables have incorrect units and names

2 participants