I am trying to finish a series of interpolation functions. The problem is more related with organizing the data than how to do the interpolations.
Using the RegularGridInterpolator, I created this function:
def interp_3d(x,y,z,fxyz,x_desired,y_desired,z_desired):
interp_func = RegularGridInterpolator((x,y,z), fxyz)
return interp_func([x_desired,y_desired,z_desired])
It gets three one dimensional arrays (x,y,z) and the function answer (f(x,y,z)) to return the interpolating function. The problem I am having is related to the format the data is given to me and how the function receives it. The data comes to me as a table:
x y z f(x,y,z)
26600 5000 0.05 0.01
26600 5000 0.10 0.02
26600 5000 0.15 0.03
26600 5000 0.20 0.04
26600 5000 0.25 0.05
26600 10000 0.05 0.01
26600 10000 0.10 0.02
26600 10000 0.15 0.03
26600 10000 0.20 0.04
40000 5000 0.00 0.00
40000 5000 0.05 0.01
40000 5000 0.10 0.02
40000 5000 0.15 0.03
And I have to organize the f(x,y,z) function in an array of fxyz = [[[],[],[],[]]].
How can I do it?
Do you guys recommend another method to create this interpolation function assuming that the data comes in this form?
Any recommendations?
x=40000
. Thus, you should be using an interpolator that does not assume that your data is defined over a grid. $\endgroup$ – nicoguaro♦ Mar 27 '19 at 12:06