Convenience function for interpolating unstructured data in multiple dimensions.
Parameters:
points2-D ndarray of floats with shape (n, D), or length D tuple of 1-D ndarrays with shape (n,).
Data point coordinates.
valuesndarray of float or complex, shape (n,)
Data values.
xi2-D ndarray of floats with shape (m, D), or length D tuple of ndarrays broadcastable to the same shape.
Points at which to interpolate data.
method{‘linear’, ‘nearest’, ‘cubic’}, optional
Method of interpolation. One of
nearest
return the value at the data point closest to
the point of interpolation. See NearestNDInterpolator for
more details.
linear
tessellate the input point set to N-D
simplices, and interpolate linearly on each simplex. See
LinearNDInterpolator for more details.
cubic (1-D)
return the value determined from a cubic
spline.
cubic (2-D)
return the value determined from a
piecewise cubic, continuously differentiable (C1), and
approximately curvature-minimizing polynomial surface. See
CloughTocher2DInterpolator for more details.
fill_valuefloat, optional
Value used to fill in for requested points outside of the
convex hull of the input points. If not provided, then the
default is nan. This option has no effect for the
‘nearest’ method.
rescalebool, optional
Rescale points to unit cube before performing interpolation.
This is useful if some of the input dimensions have
incommensurable units and differ by many orders of magnitude.
One can see that the exact result is reproduced by all of the
methods to some degree, but for this smooth function the piecewise
cubic interpolant gives the best results: