virtual_temperature_from_dewpoint#

metpy.calc.virtual_temperature_from_dewpoint(pressure, temperature, dewpoint, molecular_weight_ratio=0.6219569100577033)#

Calculate virtual temperature.

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

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

  • temperature (pint.Quantity) – Air temperature

  • dewpoint (pint.Quantity) – Dewpoint temperature

  • 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 temperature of the parcel

Examples

>>> from metpy.calc import virtual_temperature_from_dewpoint
>>> from metpy.units import units
>>> virtual_temperature_from_dewpoint(1000 * units.hPa, 30 * units.degC, 25 * units.degC)
<Quantity(33.6739865, 'degree_Celsius')>

Notes

\[T_v = T \frac{\text{w} + \epsilon}{\epsilon\,(1 + \text{w})}\]

Changed in version 1.0: Renamed mixing parameter to mixing_ratio