Skip to content

Add altimeter and sea level pressure calculations from station pressure - #4118

Open
fronzi wants to merge 1 commit into
Unidata:mainfrom
fronzi:altimeter-from-station-pressure
Open

Add altimeter and sea level pressure calculations from station pressure#4118
fronzi wants to merge 1 commit into
Unidata:mainfrom
fronzi:altimeter-from-station-pressure

Conversation

@fronzi

@fronzi fronzi commented Aug 10, 2026

Copy link
Copy Markdown

Fixes #3369.

Adds two functions to metpy.calc.basic:

  • altimeter_from_station_pressure — the analytic inverse of altimeter_to_station_pressure, obtained by solving Equations 1 and 3 of the Smithsonian Handbook (1951) p. 269 for the altimeter setting rather than the station pressure.
  • sea_level_pressure_from_station_pressure — exposes the hypsometric reduction that altimeter_to_sea_level_pressure already performs internally, for users who have station pressure rather than an altimeter setting.

Verification:

  • Round-trip against altimeter_to_station_pressure agrees to ~1e-13 hPa, tested across numpy, masked, dask and xarray inputs via the array_type fixture.
  • sea_level_pressure_from_station_pressure composed with altimeter_to_station_pressure reproduces altimeter_to_sea_level_pressure to 8 decimals.

Six tests added, plus entries in the Standard Atmosphere section of the docs.

Happy to rename either function if these don't fit the X_from_Y convention you'd prefer.

…on_pressure

Adds the analytic inverse of altimeter_to_station_pressure and exposes the
hypsometric reduction from station pressure to sea-level pressure.

Fixes Unidata#3369
@CLAassistant

CLAassistant commented Aug 10, 2026

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@fronzi
fronzi marked this pull request as ready for review August 10, 2026 07:24
@fronzi
fronzi requested a review from a team as a code owner August 10, 2026 07:25
@fronzi
fronzi requested review from dcamron and removed request for a team August 10, 2026 07:25
@fronzi

fronzi commented Aug 10, 2026

Copy link
Copy Markdown
Author

Thanks for picking this up. Working through the CLA now. Happy to rename the two functions if these don't match the convention you'd prefer.

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.

Calculate altimiter values from station pressure?

2 participants