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 setting method='cubic'.

3D cubic spline interpolation is achieved by mapping the points to regular indices and interpolate with cubic splines (scipy.interpolate.interp1d) the xi to this artificial coordinate system. The values can then be interpolated from points to xi on this transformed coordinate system using cubic spline interpolation through scipy.ndimage.map_coordinates.

points(ndarray, ndarray, ndarray)

The points defining the regular grid in (x, y, z) direction.


The data on the regular grid in three dimensions (nx, ny, nz).


Coordinates (x, y, z) of new points, shape (..., 3).

kwargsdict, optional

Passed through to scipy.ndimage.map_coordinates. Potentially valuable keywords to pass are

  • order: 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 if mode='constant', default is 0.0.


Values corresponding to xi.