Interpolation

Interpolation functions.

Added in version 2.0.0.

nexus.Interpolate(grid, data, grid_interpolate)

Interpolates the given data vector from the original grid to a new grid using linear interpolation. Grid and data must be of the same length, while grid_interpolate can have a different length.

Parameters:
  • grid (ndarray) – The original grid points.

  • data (ndarray) – The data values corresponding to the original grid.

  • grid_interpolate (ndarray) – The new grid points where the data should be interpolated.

Returns:

The interpolated data values on the new grid. Use np.array() to convert the result to a NumPy array.

Return type:

array

nexus.Interpolate2DColumns(grid, data, grid_interpolate)

Interpolates a 2D vector along the columns on a new grid using linear interpolation. Grid and the column size of data must be of the same length, while grid_interpolate can have a different length.

Parameters:
  • grid (ndarray) – The original grid points corresponding to the columns of the data.

  • data (ndarray) – The 2D data values where each column corresponds to the original grid points.

  • grid_interpolate (ndarray) – The new grid points where the data should be interpolated along the columns.

Returns:

The interpolated 2D data values on the new grid along the columns. Use np.array() to convert the result to a NumPy array.

Return type:

array

nexus.Interpolate2DRows(grid, data, grid_interpolate)

Interpolates a 2D vector along the rows on a new grid using linear interpolation. Grid and the row size of data must be of the same length, while grid_interpolate can have a different length.

Parameters:
  • grid (ndarray) – The original grid points corresponding to the rows of the data.

  • data (ndarray) – The 2D data values where each row corresponds to the original grid points.

  • grid_interpolate (ndarray) – The new grid points where the data should be interpolated along the rows.

Returns:

The interpolated 2D data values on the new grid along the rows. Use np.array() to convert the result to a NumPy array.

Return type:

array