thickness_hydrostatic_from_relative_humidity#
- metpy.calc.thickness_hydrostatic_from_relative_humidity(pressure, temperature, relative_humidity, bottom=None, depth=None)#
Calculate the thickness of a layer given pressure, temperature and relative humidity.
Similar to
thickness_hydrostatic
, this thickness calculation uses the pressure, temperature, and relative humidity profiles via the hypsometric equation with virtual temperature adjustment\[Z_2 - Z_1 = -\frac{R_d}{g} \int_{p_1}^{p_2} T_v d\ln p,\]which is based off of Equation 3.24 in [Hobbs2006]. Virtual temperature is calculated from the profiles of temperature and relative humidity.
This assumes a hydrostatic atmosphere.
Layer bottom and depth specified in pressure.
- Parameters
pressure (
pint.Quantity
) – Atmospheric pressure profiletemperature (
pint.Quantity
) – Atmospheric temperature profilerelative_humidity (
pint.Quantity
) – Atmospheric relative humidity profile. The relative humidity is expressed as a unitless ratio in the range [0, 1]. Can also pass a percentage if proper units are attached.bottom (
pint.Quantity
, optional) – The bottom of the layer in pressure. Defaults to the first observation.depth (
pint.Quantity
, optional) – The depth of the layer in hPa. Defaults to the full profile if bottom is not given, and 100 hPa if bottom is given.
- Returns
pint.Quantity
– The thickness of the layer in meters
Examples
>>> from metpy.calc import thickness_hydrostatic_from_relative_humidity >>> from metpy.units import units >>> # pressure >>> p = [1008., 1000., 950., 900., 850., 800., 750., 700., 650., 600., ... 550., 500., 450., 400., 350., 300., 250., 200., ... 175., 150., 125., 100., 80., 70., 60., 50., ... 40., 30., 25., 20.] * units.hPa >>> ip1000_500 = (p <= 1000 * units.hPa) & (p >= 500 * units.hPa) >>> # temperature >>> T = [29.3, 28.1, 23.5, 20.9, 18.4, 15.9, 13.1, 10.1, 6.7, 3.1, ... -0.5, -4.5, -9.0, -14.8, -21.5, -29.7, -40.0, -52.4, ... -59.2, -66.5, -74.1, -78.5, -76.0, -71.6, -66.7, -61.3, ... -56.3, -51.7, -50.7, -47.5] * units.degC >>> # relative humidity >>> rh = [.85, .65, .36, .39, .82, .72, .75, .86, .65, .22, .52, ... .66, .64, .20, .05, .75, .76, .45, .25, .48, .76, .88, ... .56, .88, .39, .67, .15, .04, .94, .35] * units.dimensionless >>> # compute hydrostatic thickness from RH >>> thickness_hydrostatic_from_relative_humidity(p[ip1000_500], ... T[ip1000_500], ... rh[ip1000_500]) <Quantity(5781.35394, 'meter')>
See also
thickness_hydrostatic
,pressure_to_height_std
,virtual_temperature
,mixing_ratio_from_relative_humidity
Notes
Only functions on 1D profiles (not higher-dimension vertical cross sections or grids). Since this function returns scalar values when given a profile, this will return Pint Quantities even when given xarray DataArray profiles.