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 top and bottom specified in height or pressure.

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

  • args (pint.Quantity) – Parameters for which the pressure-weighted 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

Returns

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

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