geopotential_to_height#

metpy.calc.geopotential_to_height(geopotential)#

Compute height above sea level from a given geopotential.

Calculates the height above mean sea level from geopotential using the following formula, which is derived from the definition of geopotential as given in [Hobbs2006] Pg. 69 Eq 3.21, along with an approximation for variation of gravity with altitude:

\[z = \frac{\Phi R_e}{gR_e - \Phi}\]

(where \(\Phi\) is geopotential, \(z\) is height, \(R_e\) is average Earth radius, and \(g\) is standard gravity).

Parameters

geopotential (pint.Quantity) – Geopotential

Returns

pint.Quantity – Corresponding value(s) of height above sea level

Examples

>>> import metpy.calc
>>> from metpy.units import units
>>> height = np.linspace(0, 10000, num=11) * units.m
>>> geopot = metpy.calc.height_to_geopotential(height)
>>> geopot
<Quantity([     0.           9805.11097983 19607.1448853  29406.10316465
39201.98726524 48994.79863351 58784.53871501 68571.20895435
78354.81079527 88135.34568058 97912.81505219], 'meter ** 2 / second ** 2')>
>>> height = metpy.calc.geopotential_to_height(geopot)
>>> height
<Quantity([     0.   1000.   2000.   3000.   4000.   5000.   6000.   7000.   8000.
9000.  10000.], 'meter')>

Notes

This calculation approximates \(g(z)\) as

\[g(z) = g_0 \left( \frac{R_e}{R_e + z} \right)^2\]

where \(g_0\) is standard gravity. It thereby accounts for the average effects of centrifugal force on apparent gravity, but neglects latitudinal variations due to centrifugal force and Earth’s eccentricity.

(Prior to MetPy v0.11, this formula instead calculated \(g(z)\) from Newton’s Law of Gravitation assuming a spherical Earth and no centrifugal force effects.)

Changed in version 1.0: Renamed geopot parameter to geopotential