geopotential_to_height

metpy.calc.geopotential_to_height(geopot)[source]

Compute height from a given geopotential.

Calculates the height from geopotential using the following formula, which is derived from the definition of geopotential as given in [Hobbs2006] Pg. 69 Eq 3.21:

\[z = \frac{1}{\frac{1}{R_e} - \frac{\Phi}{G m_e}} - R_e\]

(where \(\Phi\) is geopotential, \(z\) is height, \(R_e\) is average Earth radius, \(G\) is the (universal) gravitational constant, and \(m_e\) is the approximate mass of Earth.)

Parameters

geopotential (pint.Quantity) – Geopotential

Returns

pint.Quantity – The corresponding height value(s)

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.           9817.46806283  19631.85526579  29443.16305887
39251.39289118  49056.54621087  58858.62446524  68657.62910064
78453.56156252  88246.42329544  98036.21574305], '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')>