Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

metpy.calc.height_to_pressure_std not using the current ICAO standard atmosphere calculation (latest version is from 1993) #3561

Open
ABF-EC opened this issue Jul 9, 2024 · 3 comments
Labels
Type: Bug Something is not working like it should

Comments

@ABF-EC
Copy link

ABF-EC commented Jul 9, 2024

What went wrong?

Hi,

The formula and constants that are used in the standard atmosphere calculations are outdated. The equations and constant are based on the 1976 version of the ICAO standard atmosphere. However, there is latest version available that is slightly different. The equations and constants for the standard atmosphere should be based on the 1993 version of the ICAO standard atmosphere [https://img.antpedia.com/standard/files/pdfs_ora/20200926/ICAO%207488-1993.pdf].

The equation used in metpy.calc.height_to_pressure_std :
p0 * (1 - (gamma / t0) * height) ** (mpconsts.g / (mpconsts.Rd * gamma))

Also, the equation used for metpy.calc.height_to_pressure_std is valid for the troposphere only. For meteorology programming, we would need, at least, a function that considers both the troposphere and the tropopause.

Here are the euation for the troposphere and the tropopause:
image

where

P0 = 1013.25 hPa P1 = 226.32 hPa
T0 = 288.15 K T1 = 216.65 K
g0 = 9.80665 m/s2 g0 = 9.80665 m/s2
α = 6.5 °C /km
R = 287.0528 J/(kg K) R = 287.0528 J/(kg K)
h1 = 11 km
h = Geopotential Altitude in km h = Geopotential Altitude in km

Best regards,
Anna-Belle

Operating System

Windows

Version

1.5.1

Python Version

3.10.12

Code to Reproduce

from metpy import constants
from metpy.calc import height_to_pressure_std
from metpy.units import units
import numpy as np

height = np.arange(0,67000,1000) * units.feet

metpy.calc.height_to_pressure_std(height)

Errors, Traceback, and Logs

No error, the function is working fine. It is the function formula and constants used in the formula that are outdated.
@ABF-EC ABF-EC added the Type: Bug Something is not working like it should label Jul 9, 2024
@dopplershift
Copy link
Member

Thanks for reaching out. Just a clarification: We have functions here for the U.S. Standard Atmosphere, which itself has not seen any updates since the 1976 standard. I should also note that the link you shared above only gave me the first ~3 pages of the document, and didn't have any useful information--and I can't seem to find an open publication of the 1993 ICAO or ISO standard atmosphere.

With that said, #2084 is already open with some updates to enhance our calculation (and sadly we never responded to 😬 ). Any chance that enhances MetPy to the point you'd like?

@ABF-EC
Copy link
Author

ABF-EC commented Jul 15, 2024

Hi,

Here is a link where you can fing the ICAO 1993 standard atmosphere

The ticket #2084 would be great to be able to use metpy.calc.height_to_pressure_std above the troposphere (11km).

The difference between the US Standard atmosphere 1976 and the ICAO standard atmosphere 1993 relies in the constant values (P1, T1, P1,R). It would be great if either a new function could be created metpy.calc.height_to_pressure_std_1993 that would use the contants define in the ICAO 1993 standard atmosphere.

Have a nice day!
Anna-Belle

@dopplershift
Copy link
Member

I'll note in my ideal world we could keep the same height_to_pressure_std, etc. and make the atmospheric profile assumptions in there pluggable, probably using general functions that return the profiles c.f. #3585 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Something is not working like it should
Projects
None yet
Development

No branches or pull requests

2 participants