earthkit.meteo.vertical.xarray.interpolate_to_pressure_levels

earthkit.meteo.vertical.xarray.interpolate_to_pressure_levels(data, p, target_p, target_p_units='Pa', interpolation='linear', vertical_dim='z')

Interpolate a field to pressure coordinates.

Example for vertical interpolation to isosurfaces of a pressure field, which is strictly monotonically decreasing with height.

Parameters:
  • data (xarray.DataArray) – field to interpolate

  • p (xarray.DataArray) – pressure field in Pa

  • target_p (list of float) – pressure target coordinate values

  • target_p_units (str) – pressure target coordinate units

  • interpolation (str) – interpolation algorithm, one of {“linear”, “log”, “nearest”}

  • vertical_dim (str) – name of the vertical dimension

Returns:

field_on_target – field on target (i.e., pressure) coordinates

Return type:

xarray.DataArray