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 byvertical_dim.target_h (
array-like) – Target height levels (m) to whichdatawill be interpolated. Can be a scalar, a 1D array, or a multidimensional array whose non-vertical axes match those ofdata. The type of the height and the reference level are defined byh_typeandh_reference.z (
array-like | xarray.DataArray | FieldList) – Geopotential (m2/s2) on the same pressure levels asdata.zs (
array-like | xarray.DataArray | FieldList) – Surface geopotential (m2/s2). Only used whenh_referenceis"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 andaux_bottom_h.aux_bottom_h (
array-like | None, optional) – Heights (m) ofaux_bottom_data.aux_top_data (
array-like | None, optional) – Auxiliary data for interpolation to heights between the top pressure level andaux_top_h.aux_top_h (
array-like | None, optional) – Heights (m) ofaux_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
See also
Implementations¶
interpolate_pressure_to_height_levels()calls one of the following implementations depending on the type of the input arguments:earthkit.meteo.vertical.array.interpolate_pressure_to_height_levels()for array-likeearthkit.meteo.vertical.fieldlist.interpolate_pressure_to_height_levels()for FieldList
The function returns an object of the same type as the input arguments.