To interpolate within a dataset, I want to create a multidimensional Lookup table in python. In this case, the tree input arrays x,y and z are given together with the output quantity a.
I was able to visualize the impact of x and y with a 2D heatmap:
xi = np.linspace(np.amin(x),np.amax(x),100)
yi = np.linspace(np.amin(y),np.amax(y),100)
zi = griddata((x, y), a, (xi[None,:], yi[:,None]), method='linear')
CS = plt.contour(xi,yi,zi,15,linewidths=0.5,colors='k')
CS = plt.contourf(xi,yi,zi,15,cmap=plt.cm.bwr_r)
plt.colorbar()
However, my goal is not visualization. In the end I want to pass some x,y and z values to the Lookup and get an interpolated value of a.
I've already found something related here, but the proposed function did not work. Is there any library I've missed so far or a suitable way to perform a multidimensional interpolation?