- #1
CAF123
Gold Member
- 2,948
- 88
I have four arrays of data xvalues[], yvalues[], zvalues[] and wvalues[] and I want to create, from this data, an interpolated function w = f(x,y,z). Is it easy to do this in python using first a meshgrid and then calling scipy's interpolation?
e.g toy set up is something like, where wvalues contains 5x3x6 values.
`xvalues = np.array([0,1,2,3,4]);
yvalues = np.array([0,1,2]);
zvalues = np.array([0,1,2,3,4,5]);
wvalues = np.array([10,9,8,...])'
`xx,yy,zz,ww = np.meshgrid(xvalues, yvalues, zvalues, wvalues)` produces a grid containing many points and at each point there is a value for the tuple (x,y,z,w). I've done simple 1D interpolations in python before but I've not found any resources which can help with a multidimensional interpolation using a mesh grid. Can anyone help? Thanks!
e.g toy set up is something like, where wvalues contains 5x3x6 values.
`xvalues = np.array([0,1,2,3,4]);
yvalues = np.array([0,1,2]);
zvalues = np.array([0,1,2,3,4,5]);
wvalues = np.array([10,9,8,...])'
`xx,yy,zz,ww = np.meshgrid(xvalues, yvalues, zvalues, wvalues)` produces a grid containing many points and at each point there is a value for the tuple (x,y,z,w). I've done simple 1D interpolations in python before but I've not found any resources which can help with a multidimensional interpolation using a mesh grid. Can anyone help? Thanks!