Search code examples
pythonnumpyanalysisinterpolationscientific-computing

MATLAB's griddata3 for NumPy?


I realize that there is a griddata for NumPy via Matplotlib, but is there a griddata3 (same has griddata, but for higher dimensions)?

In other words, I have (x,y,z,d(x,y,z)) where (x,y,z) form an irregular grid and d(x,y,z) is a scalar function of three variables. I need to generate d(xi, yi, zi) for a new set of (xi, yi, zi) points using some kind of interpolation that can handle the non-uniformity of the original (x,y,z) data.

Ultimately, the (xi, yi, zi, d(xi, yi, zi)) data will have to be rendered as a surface somehow, but that's a problem for later. I also do not have an analytical form for the d(.) function; I just have data for it.


Solution

  • SciPy 0.9 (at the moment, a first beta is out) has a new griddata function that can handle N-dimensional data.