earthkit.meteo.vertical.interpolate_pressure_to_height_levels

earthkit.meteo.vertical.interpolate_pressure_to_height_levels(data: ArrayLike, target_h: ArrayLike, z: ArrayLike, zs: ArrayLike, h_type: str = ..., h_reference: str = ..., interpolation: str = ..., aux_bottom_data: ArrayLike | None = ..., aux_bottom_h: ArrayLike | None = ..., aux_top_data: ArrayLike | None = ..., aux_top_h: ArrayLike | None = ..., vertical_dim: int = ...) ArrayLike
earthkit.meteo.vertical.interpolate_pressure_to_height_levels(data: earthkit.data.FieldList, target_h: ArrayLike, z: earthkit.data.FieldList, zs: earthkit.data.FieldList, h_type: str = ..., h_reference: str = ..., interpolation: str = ..., aux_bottom_data: ArrayLike | None = ..., aux_bottom_h: ArrayLike | None = ..., aux_top_data: ArrayLike | None = ..., aux_top_h: ArrayLike | None = ..., vertical_dim: int = ...) earthkit.data.FieldList

Interpolate data from pressure levels to height levels.

Parameters:
  • data (array-like | xarray.DataArray | FieldList) – Data to be interpolated. Levels must be monotonic (ascending or descending with respect to pressure). The axis corresponding to the vertical coordinate is defined by vertical_dim.

  • target_h (array-like) – Target height levels (m) to which data will be interpolated. Can be a scalar, a 1D array, or a multidimensional array whose non-vertical axes match those of data. The type of the height and the reference level are defined by h_type and h_reference.

  • z (array-like | xarray.DataArray | FieldList) – Geopotential (m2/s2) on the same pressure levels as data.

  • zs (array-like | xarray.DataArray | FieldList) – Surface geopotential (m2/s2). Only used when h_reference is "ground".

  • h_type (str, optional) – Type of height. Default is "geometric". Possible values are "geometric" and "geopotential".

  • h_reference (str, optional) – Reference level. Default is "ground". Possible values are "ground" and "sea".

  • interpolation (str, optional) – Interpolation mode. Default is "linear". Possible values are "linear", "log" and "nearest".

  • aux_bottom_data (array-like | None, optional) – Auxiliary data for interpolation to heights between the bottom pressure level and aux_bottom_h.

  • aux_bottom_h (array-like | None, optional) – Heights (m) of aux_bottom_data.

  • aux_top_data (array-like | None, optional) – Auxiliary data for interpolation to heights between the top pressure level and aux_top_h.

  • aux_top_h (array-like | None, optional) – Heights (m) of aux_top_data.

  • vertical_dim (int, optional) – Axis corresponding to the vertical coordinate in the input and output arrays. Default is 0.

Returns:

Data interpolated to the target height levels. Values outside the available height range are set to nan. The axis corresponding to the vertical coordinate is defined by vertical_dim.

Return type:

array-like | xarray.DataArray | FieldList

Implementations

interpolate_pressure_to_height_levels() calls one of the following implementations depending on the type of the input arguments:

The function returns an object of the same type as the input arguments.