height_to_geopotential

metpy.calc.height_to_geopotential(height)[source]

Compute geopotential for a given height.

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

\[\Phi = G m_e \left( \frac{1}{R_e} - \frac{1}{R_e + z}\right)\]

(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

height (pint.Quantity) – Height above sea level

Returns

pint.Quantity – The corresponding geopotential 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')>