mean_pressure_weighted#

metpy.calc.mean_pressure_weighted(pressure, *args, height=None, bottom=None, depth=None)#

Calculate pressure-weighted mean of an arbitrary variable through a layer.

Layer bottom and depth specified in height or pressure.

\[MPW = \frac{\int_{p_s}^{p_b} A p dp}{\int_{p_s}^{p_b} p dp}\]

where:

  • \(MPW\) is the pressure-weighted mean of a variable.

  • \(p_b\) is the bottom pressure level.

  • \(p_s\) is the top pressure level.

  • \(A\) is the variable whose pressure-weighted mean is being calculated.

Parameters:
  • pressure (pint.Quantity) – Atmospheric pressure profile.

  • args (pint.Quantity) – Parameters for which the weighted-continuous mean is to be calculated.

  • height (pint.Quantity, optional) – Heights from sounding. Standard atmosphere heights assumed (if needed) if no heights are given.

  • bottom (pint.Quantity, optional) – The bottom of the layer in either the provided height coordinate or in pressure. Don’t provide in meters AGL unless the provided height coordinate is meters AGL. Default is the first observation, assumed to be the surface.

  • depth (pint.Quantity, optional) – Depth of the layer in meters or hPa. Defaults to 100 hPa.

Returns:

list of pint.Quantity – list of layer mean value for each profile in args.

Examples

>>> from metpy.calc import mean_pressure_weighted
>>> from metpy.units import units
>>> p = [1000, 850, 700, 500] * units.hPa
>>> T = [30, 15, 5, -5] * units.degC
>>> mean_pressure_weighted(p, T)
[<Quantity(298.54368, 'kelvin')>]

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.

Changed in version 1.0: Renamed heights parameter to height

Examples using metpy.calc.mean_pressure_weighted#

Mean Pressure Weighted

Mean Pressure Weighted