[SciPy-User] 2D interpolation on random points of a function defined on a regular grid

Zachary Pincus zachary.pincus@yale....
Tue Apr 23 20:41:28 CDT 2013

> I'm trying (with no success) to compute the interpolated values of a 2D function that is known on a regular grid X,Y.  Although the function is defined on a regular grid I want to compute the interpolation on arbitrary positions.

scipy.ndimage.map_coordinates() is precisely what you're looking for. It offers spline interpolation of various orders (0 = nearest neighbor, 1 = linear, etc.), various boundary conditions, and so forth. The inputs are a bit tricky to explain, but the examples in the docstring give the general gist.


More information about the SciPy-User mailing list