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