saturation_mixing_ratio#
- metpy.calc.saturation_mixing_ratio(total_press, temperature)[source]#
Calculate the saturation mixing ratio of water vapor.
This calculation is given total atmospheric pressure and air temperature.
- Parameters:
total_press (
pint.Quantity
) – Total atmospheric pressuretemperature (
pint.Quantity
) – Air temperature
- Returns:
pint.Quantity
– Saturation mixing ratio, dimensionless
Examples
>>> from metpy.calc import saturation_mixing_ratio >>> from metpy.units import units >>> saturation_mixing_ratio(983 * units.hPa, 25 * units.degC).to('g/kg') <Quantity(20.7079932, 'gram / kilogram')>
Notes
This function is a straightforward implementation of the equation given in many places, such as [Hobbs1977] pg.73:
\[r_s = \epsilon \frac{e_s}{p - e_s}\]By definition, this value is only defined for conditions where the saturation vapor pressure (\(e_s\)) for the given temperature is less than the given total pressure (\(p\)). Otherwise, liquid phase water cannot exist in equilibrium and there is only water vapor present. For any value pairs that fall under this condition, the function will warn and return NaN.
Changed in version 1.0: Renamed
tot_press
parameter tototal_press