Python interpolate point value on 2D grid

I think what you are looking for is: https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.interpolate.interp2d.html


  • you can also use griddata :

    points = np.array( (X.flatten(), Y.flatten()) ).T
    values = Z.flatten()
    
    from scipy.interpolate import griddata
    Z0 = griddata( points, values, (X0,Y0) )
    
  • X0 and Y0 can be arrays or even a grid.

  • you can also choose the interpolation with method=
  • perhaps you can find a way to get ride of the flatten(), but it should work.

(https://docs.scipy.org/doc/scipy/reference/tutorial/interpolate.html)