mixed_layer

metpy.calc.mixed_layer(p, *args, **kwargs)[source]

Mix variable(s) over a layer, yielding a mass-weighted average.

This function will integrate a data variable with respect to pressure and determine the average value using the mean value theorem.

Parameters
  • p (array-like) – Atmospheric pressure profile

  • datavar (array-like) – Atmospheric variable measured at the given pressures

  • heights (array-like, optional) – Atmospheric heights corresponding to the given pressures (default None)

  • bottom (pint.Quantity, optional) – The bottom of the layer as a pressure or height above the surface pressure (default None)

  • depth (pint.Quantity, optional) – The thickness of the layer as a pressure or height above the bottom of the layer (default 100 hPa)

  • interpolate (bool, optional) – Interpolate the top and bottom points if they are not in the given data

Returns

pint.Quantity – The mixed value of the data variable.