sasktran2.util.interpolation

sasktran2.util.interpolation#

Functions

linear_interpolating_matrix(from_grid, ...)

Constructs an interpolating matrix that can be used to interpolate from one grid to another.

sasktran2.util.interpolation.linear_interpolating_matrix(from_grid: array, to_grid: array, out_of_bounds_mode: str) ndarray[source]#

Constructs an interpolating matrix that can be used to interpolate from one grid to another.

Parameters:
  • from_grid (np.array) – Grid with the original values. Must be sorted in ascending order

  • to_grid (np.array) – Grid we are going to interpolate to. Must be sorted in ascending order

  • out_of_bounds_mode (str) – One of [“zero”, “extend”], “zero” will set the result to 0 outside the bounds of the original grid, “extend” will extend the lowest and highest values

Returns:

A matrix such that M @ (values on from_grid) = (values on to_grid)

Return type:

np.ndarray