interp_spline_3d¶
- emg3d.maps.interp_spline_3d(points, values, xi, **kwargs)[source]¶
Interpolate values in 3D with a cubic spline.
This functionality is best accessed through
emg3d.maps.interpolate
by settingmethod='cubic'
.3D cubic spline interpolation is achieved by mapping the
points
to regular indices and interpolate with cubic splines (scipy.interpolate.interp1d
) thexi
to this artificial coordinate system. Thevalues
can then be interpolated frompoints
toxi
on this transformed coordinate system using cubic spline interpolation throughscipy.ndimage.map_coordinates
.- Parameters
- points(ndarray, ndarray, ndarray)
The points defining the regular grid in (x, y, z) direction.
- valuesndarray
The data on the regular grid in three dimensions (nx, ny, nz).
- xindarray
Coordinates (x, y, z) of new points, shape
(..., 3)
.- kwargsdict, optional
Passed through to
scipy.ndimage.map_coordinates
. Potentially valuable keywords to pass areorder
: which has to be in the range of 0-5, default: 3;mode
: default is'constant'
, options include'nearest'
;cval
: the value to fill past edges ifmode='constant'
, default is 0.0.
- Returns
- values_xndarray
Values corresponding to
xi
.