tidy3d.plugins.autograd.functions.interpn

Contents

tidy3d.plugins.autograd.functions.interpn#

class interpn[source]#

Bases:

Interpolate over a rectilinear grid in arbitrary dimensions.

This function mirrors the interface of scipy.interpolate.interpn but is differentiable with autograd.

Parameters:
  • points (tuple[np.ndarray[np.float64], ...]) – The points defining the rectilinear grid in n dimensions.

  • values (np.ndarray[np.float64]) – The data values on the rectilinear grid.

  • xi (tuple[np.ndarray[np.float64], ...]) – The coordinates to sample the gridded data at.

  • method (InterpolationType = "linear") – The method of interpolation to perform. Supported are β€œlinear” and β€œnearest”.

Returns:

The interpolated values.

Return type:

np.ndarray[np.float64]

Raises:

ValueError – If the interpolation method is not supported.

Inherited Common Usage