get_layer

metpy.calc.get_layer(pressure, *args, **kwargs)[source]

Return an atmospheric layer from upper air data with the requested bottom and depth.

This function will subset an upper air dataset to contain only the specified layer. The bottom of the layer can be specified with a pressure or height above the surface pressure. The bottom defaults to the surface pressure. The depth of the layer can be specified in terms of pressure or height above the bottom of the layer. If the top and bottom of the layer are not in the data, they are interpolated by default.

Parameters:
  • pressure (array-like) – Atmospheric pressure profile
  • *args (array-like) – Atmospheric variable(s) measured at the given pressures
  • heights (array-like, optional) – Atmospheric heights corresponding to the given pressures. Defaults to using heights calculated from p assuming a standard atmosphere.
  • bottom (pint.Quantity, optional) – The bottom of the layer as a pressure or height above the surface pressure. Defaults to the highest pressure or lowest height given.
  • depth (pint.Quantity, optional) – The thickness of the layer as a pressure or height above the bottom of the layer. Defaults to 100 hPa.
  • interpolate (bool, optional) – Interpolate the top and bottom points if they are not in the given data. Defaults to True.
Returns:

pint.Quantity, pint.Quantity – The pressure and data variables of the layer