relative_humidity_from_mixing_ratio#

metpy.calc.relative_humidity_from_mixing_ratio(pressure, temperature, mixing_ratio)[source]#

Calculate the relative humidity from mixing ratio, temperature, and pressure.

Parameters:
Returns:

pint.Quantity – Relative humidity

Examples

>>> from metpy.calc import relative_humidity_from_mixing_ratio
>>> from metpy.units import units
>>> relative_humidity_from_mixing_ratio(1013.25 * units.hPa,
...                                     30 * units.degC, 18/1000).to('percent')
<Quantity(67.1277085, 'percent')>

Notes

Employs [WMO8] eq. 4.A.16 as derived from WMO relative humidity definition based on vapor partial pressures (eq. 4.A.15).

\[RH = \frac{w}{\epsilon + w} \frac{\epsilon + w_s}{w_s}\]
  • \(w\) is mixing ratio

  • \(w_s\) is the saturation mixing ratio

  • \(\epsilon\) is the molecular weight ratio of vapor to dry air

  • \(RH\) is relative humidity as a unitless ratio

Changed in version 1.0: Changed signature from (mixing_ratio, temperature, pressure)