2

I am very frustrated because I cannot find a solution: I have to do a 3D interpolation in python using a cubic method. The MATLAB equivalent is

Vi = interp3(x,y,z,V,xi,yi,zi,'cubic')

where

x, y, z are 3D arrays in [N x N x N]

V is a 3D array in [N x N x N]

xi, yi, zi are 1D arrays [1 x M]

in my case N=69 and M=120000

Is it possible translate that code from MATLAB to python efficiently?

I tried to use scipy.interpolate.RegularGridInterpolator but it does not seem to solve my problem, because of the methods implemented and the dimensions of the arrays allowed.

Joël Brigate
  • 237
  • 2
  • 13
overcomer
  • 2,244
  • 3
  • 26
  • 39
  • Did you already look at http://docs.scipy.org/doc/scipy-0.14.0/reference/tutorial/interpolate.html#multivariate-data-interpolation-griddata ? – Dietrich May 07 '15 at 17:47
  • @Dietrich The problem of `scipy.interpolate.griddata` that I can do maximum a 2-D cubic interpolation. Even if I flat the vectors and I use just x [ N**3 X 1] and xi [M x 1] using a 1-D cubic interpolation, (that does not fit my solution) I get a MemoryError – overcomer May 07 '15 at 19:26

0 Answers0