isentropic_interpolation_as_dataset#
- metpy.calc.isentropic_interpolation_as_dataset(levels, temperature, *args, max_iters=50, eps=1e-06, bottom_up_search=True, pressure=None)[source]#
Interpolate xarray data in isobaric coords to isentropic coords, returning a Dataset.
- Parameters:
levels (
pint.Quantity
) – One-dimensional array of desired potential temperature surfacestemperature (
xarray.DataArray
) – Array of temperatureargs (
xarray.DataArray
, optional) – Any other given variables will be interpolated to each isentropic level. Must have names in order to have a well-formed output Dataset.max_iters (int, optional) – The maximum number of iterations to use in calculation, defaults to 50.
eps (float, optional) – The desired absolute error in the calculated value, defaults to 1e-6.
bottom_up_search (bool, optional) – Controls whether to search for levels bottom-up (starting at lower indices), or top-down (starting at higher indices). Defaults to True, which is bottom-up search.
pressure (
xarray.DataArray
, optional) – Array of pressure to use when the vertical coordinate for the passed in data is not pressure (e.g. data using sigma coordinates)
- Returns:
xarray.Dataset – Dataset with pressure, temperature, and each additional argument, all on the specified isentropic coordinates.
Notes
Input variable arrays must have the same number of vertical levels as the pressure levels array. Pressure is calculated on isentropic surfaces by assuming that temperature varies linearly with the natural log of pressure. Linear interpolation is then used in the vertical to find the pressure at each isentropic level. Interpolation method from [Ziv1994]. Any additional arguments are assumed to vary linearly with temperature and will be linearly interpolated to the new isentropic levels.
This formulation relies upon xarray functionality. If using Pint Quantities, use
isentropic_interpolation
instead.