relative_humidity_from_specific_humidity#
- metpy.calc.relative_humidity_from_specific_humidity(pressure, temperature, specific_humidity, *, phase='liquid')[source]#
Calculate the relative humidity from specific humidity, temperature, and pressure.
- Parameters:
pressure (
pint.Quantity
) – Total atmospheric pressuretemperature (
pint.Quantity
) – Air temperaturespecific_humidity (
pint.Quantity
) – Specific humidity of airphase ({'liquid', 'solid', 'auto'}) – Where applicable, adjust assumptions and constants to make calculation valid in
'liquid'
water (default) or'solid'
ice regimes.'auto'
will change regime based on determination of phase boundaries, eg temperature relative to freezing.
- Returns:
pint.Quantity
– Relative humidity
Examples
>>> from metpy.calc import relative_humidity_from_specific_humidity >>> from metpy.units import units >>> relative_humidity_from_specific_humidity(1013.25 * units.hPa, ... 30 * units.degC, 18/1000).to('percent') <Quantity(68.4991531, 'percent')>
See also
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}\]given :math: w = frac{q}{1-q}
\(w\) is mixing ratio
\(w_s\) is the saturation mixing ratio
\(q\) is the specific humidity
\(\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
(specific_humidity, temperature, pressure)