MNT: introduce pressure unit conversion when using forecast/reanalysis/ensemble data#955
Open
Lucas-Prates wants to merge 3 commits intodevelopfrom
Open
MNT: introduce pressure unit conversion when using forecast/reanalysis/ensemble data#955Lucas-Prates wants to merge 3 commits intodevelopfrom
Lucas-Prates wants to merge 3 commits intodevelopfrom
Conversation
Gui-FernandesBR
approved these changes
Apr 26, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #955 +/- ##
===========================================
+ Coverage 80.27% 81.11% +0.84%
===========================================
Files 104 113 +9
Lines 12769 14555 +1786
===========================================
+ Hits 10250 11807 +1557
- Misses 2519 2748 +229 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Gui-FernandesBR
approved these changes
Apr 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull request type
Checklist
black rocketpy/ tests/) has passed locallypytest tests -m slow --runslow) have passed locallyCHANGELOG.mdhas been updated (if relevant)Current behavior
When
set_atmospheric_modelis used with the argumentfileas "forecast", "reanalysis", or "ensemble", the data can be fetched with different pressure units. For instance, when using "forecast" with "GFS", it seem to be 100x higher than they should, as the figures indicate, so they probably use Pa. However, it seems that ERA5 data is in hPa, so the conversion is needed.New behavior
We previously had a hard conversion from hPa to Pa (100x factor). It was replaced with an argument that allows the user to specify the conversion factor.
It can be considered a breaking change because users who used "reanalysis" with ERA5 will now need to specify that their data is in "hPa", otherwise their pressure levels will be 100x smaller than they should
Breaking change
Additional information
The following figure shows the incorrect pressure values using forecast.

As the figure below indicates, the values are 100x higher than the normal range of values