virtual_potential_temperature#

metpy.calc.virtual_potential_temperature(pressure, temperature, mixing_ratio, molecular_weight_ratio=<Quantity(0.62195691, 'dimensionless')>)[source]#

Calculate virtual potential temperature.

This calculation must be given an air parcel’s pressure, temperature, and mixing ratio. The implementation uses the formula outlined in [Markowski2010] pg.13.

Parameters:
  • pressure (pint.Quantity) – Total atmospheric pressure

  • temperature (pint.Quantity) – Air temperature

  • mixing_ratio (pint.Quantity) – Dimensionless mass mixing ratio

  • molecular_weight_ratio (pint.Quantity or float, optional) – The ratio of the molecular weight of the constituent gas to that assumed for air. Defaults to the ratio for water vapor to dry air. (\(\epsilon\approx0.622\))

Returns:

pint.Quantity – Corresponding virtual potential temperature of the parcel

Examples

>>> from metpy.calc import virtual_potential_temperature
>>> from metpy.units import units
>>> virtual_potential_temperature(500 * units.hPa, -15 * units.degC, 1 * units('g/kg'))
<Quantity(314.87946, 'kelvin')>

Notes

\[\Theta_v = \Theta \frac{\text{w} + \epsilon}{\epsilon\,(1 + \text{w})}\]

Changed in version 1.0: Renamed mixing parameter to mixing_ratio