specific_humidity_from_dewpoint#

metpy.calc.specific_humidity_from_dewpoint(pressure, dewpoint, *, phase='liquid')[source]#

Calculate the specific humidity from the dewpoint temperature and pressure.

Parameters:
  • pressure (pint.Quantity) – Pressure

  • dewpoint (pint.Quantity) – Dewpoint temperature

  • phase ({'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 – Specific humidity

Examples

>>> from metpy.calc import specific_humidity_from_dewpoint
>>> from metpy.units import units
>>> specific_humidity_from_dewpoint(988 * units.hPa, 15 * units.degC).to('g/kg')
<Quantity(10.791541, 'gram / kilogram')>

Changed in version 1.0: Changed signature from (dewpoint, pressure)