lair.meteorology.hypsometric#

lair.meteorology.hypsometric(Tv=None, p1=None, p2=None, Z1=None, Z2=None, deltaz=None)[source]#

Solve the hypsometric equation for one variable.

The equation is Z2 - Z1 = Rd * Tv * ln(p1 / p2) / g. Give all but one of its variables (deltaz stands for Z2 - Z1) and the missing one is returned: the thickness when neither height nor deltaz is given. Inputs and the result are in SI (pint Quantities are converted to SI first; see the module docstring).

Parameters:
  • Tv (Numeric, optional) – Mean virtual temperature of the layer (K).

  • p1 (Numeric, optional) – Pressure at the bottom of the layer (Pa).

  • p2 (Numeric, optional) – Pressure at the top of the layer (Pa).

  • Z1 (Numeric, optional) – Geopotential height of the bottom of the layer (m).

  • Z2 (Numeric, optional) – Geopotential height of the top of the layer (m).

  • deltaz (Numeric, optional) – Thickness of the layer (m).

Returns:

Numeric – The missing variable, in SI.

Raises:

ValueError – If the inputs do not determine one variable.

Return type:

Any

See also

virt_T

The virtual temperature Tv.

Examples

The thickness of the 1000 to 850 hPa layer at a mean virtual temperature of 280 K, and the pressure 1300 m above the 1000 hPa level:

>>> from lair.meteorology import hypsometric
>>> round(float(hypsometric(Tv=280.0, p1=100000.0, p2=85000.0)), 1)
1331.5
>>> round(float(hypsometric(Tv=280.0, p1=100000.0, deltaz=1300.0)))
85328