get_layer_heights#
- metpy.calc.get_layer_heights(height, depth, *args, bottom=None, interpolate=True, with_agl=False)#
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 using the height only.
- Parameters:
height (array-like) – Atmospheric height
depth (
pint.Quantity
) – Thickness of the layerargs (array-like) – Atmospheric variable(s) measured at the given pressures
bottom (
pint.Quantity
, optional) – Bottom of the layerinterpolate (bool, optional) – Interpolate the top and bottom points if they are not in the given data. Defaults to True.
with_agl (bool, optional) – Returns the height as above ground level by subtracting the minimum height in the provided height. Defaults to False.
- Returns:
pint.Quantity, pint.Quantity – Height and data variables of the layer
Notes
Only functions on 1D profiles (not higher-dimension vertical cross sections or grids). Also, this will return Pint Quantities even when given xarray DataArray profiles.
Changed in version 1.0: Renamed
heights
parameter toheight