interpolation_on_lat_lon#

rojak.core.calculations.interpolation_on_lat_lon(data, interp_points, latitude_dim='latitude', longitude_dim='longitude', points_dim='points', interp_method='linear')[source]#

Interpolate a latitude/longitude gridded DataArray onto a set of (longitude, latitude) points

Parameters:
  • data (DataArray) – Gridded array to interpolate, with latitude_dim/longitude_dim dimensions

  • interp_points (DataArray) – Array of shape (n_points, 2) of (longitude, latitude) pairs to interpolate onto

  • latitude_dim (str) – Name of the latitude dimension in data. Defaults to "latitude".

  • longitude_dim (str) – Name of the longitude dimension in data. Defaults to "longitude".

  • points_dim (str) – Name of the new dimension along the interpolated points. Defaults to "points".

  • interp_method (Literal['linear', 'nearest', 'pchip']) – Interpolation method passed to scipy.interpolate.RegularGridInterpolator. Defaults to "linear".

Returns:

data interpolated onto interp_points, with a new points_dim dimension

Raises:

ValueError – If interp_points is not of shape (n_points, 2)

Return type:

DataArray