Skip to content

Instantly share code, notes, and snippets.

@cubapp
Last active February 28, 2024 20:22
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save cubapp/23dd4e91814a995b8ff06f406679abcf to your computer and use it in GitHub Desktop.
Save cubapp/23dd4e91814a995b8ff06f406679abcf to your computer and use it in GitHub Desktop.
Python: How to get the adjusted-to-sea level barometric pressure from actual pressure, temperature and height above the sea level
# Actual atmospheric pressure in hPa
aap = 990
# Actual temperature in Celsius
atc = 10
# Height above sea level
hasl = 500
# Adjusted-to-the-sea barometric pressure
a2ts = aap + ((aap * 9.80665 * hasl)/(287 * (273 + atc + (hasl/400))))
# in standard places (hasl from 100-800 m, temperature from -10 to 35)
# is the coeficient something close to hasl/10, meaning simply
# a2ts is about aap + hasl/10
@daniloceano
Copy link

Where did this formula come from?

@03fatboy
Copy link

Great question.

@themeadery
Copy link

Also would like to know where the formula came from, because it looks a lot different than all the other one's coming up in my research and yet it seems to work beautifully.

Cannot say the same about the last statement that in general aap + hasl/10 is close enough. For me it's not.

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