I am searching the equivalent Matlab command
Vq = interp3(X,Y,Z,V,Xq,Yq,Zq)
in Python. In Matlab I can use the method 'spline' interpolation, which I can not find in python for 3D data. There exists scipy.interpolate.griddata, but it doesn't have the option spline for 3D data.
The data I want to interpolate is a 3D matrix (51x51x51), which is regularly distributed on a 3D grid.
scipy.interpolate.Rbf may be the option, but I don't get it working:
xi = yi = zi = np.linspace(1, 132651, 132651)
interp = scipy.interpolate.Rbf(xi, yi, zi, data, function='cubic')
leads to a memory error.
Edit: A minimal example of what I want (without interpolation): Matlab code
v=rand([51,51,51]);
isosurface (v, 0.3);
For simplicity, I use random data in this example. I want to make isosurface plots (in particular, Fermi surface plots). Since some structures are very small, a high grid resolution of 51x51x51 is needed.
A further comment: The data set in the matrix is independent from each other, z (or the 3rd component) is NOT a function of x and y.
Spline interpolation on for 3+ dimensions can be done using
scipy.interpolate.Rbfas your described. For plotting purposes you can use a smaller resolution (1000 points is a good rule of thumb), and when you want to evaluate your spline, you can interpolate on much greater than 132000 points without problem (see example below).Can you add a Minimal, Complete, and Verifiable example for what you are trying to do in matlab? This will explain why do you need to create a grid space with a resolution of 132000 points. Also, please note, there is a curse of dimensionality. Matlab uses a cubic spline or a piecewise polynomial which can be dangerous due to overfitting. I recommend you used a more sane method for training on 51 datapoints and applying to 132000+ datapoints. This is a great example on polynomial curve fitting and model selection.
Example:
Generate data:
Fit spline and interpolate
Fit spline on large data