I have n equal length arrays whose transpose corresponds to the coordinates in an n dimensional parameter space:
x = np.array([800,800,800,800,900,900,900,900,900,1000,1000,1000,1000,1000])
y = np.array([4.5,5.0,4.5,5.0,4.5,5.0,5.5,5.0,5.5,4.5,5.0,5.5,5.0,5.5])
z = np.array([2,2,4,4,2,2,4,4,4,2,2,4,4,4])
Each coordinate in parameter space also has a value:
v = np.array([1,2,3,4,5,6,7,8,9,10,11,12,13,14])
I want to interpolate between the grid points to get the v
value at given arbitrary xyz
coordinate, e.g. [934,5.1,3.3]
.
I've been trying to use scipy.RegularGridInterpolator
, which takes (x,y,z)
as the first argument, but I can't figure out how to construct the second argument of the values at each point.
Any suggestions would be greatly appreciated! Thanks!