[SciPy-User] Interpolation in 3D with interp2d

denis denis-bz-gg at t-online.de
Thu Aug 5 11:28:29 EDT 2010


Jana, Andreas,
  looking a little less hastily,
Jana's mail of 1 August imports griddata but doesn't call it ?

Do I understand that you want to
1) first griddata to get a A(f,z) on a uniform grid
2) then do bilinear interpolation from that ?
If so, why not just griddata() to your fine final grid in one shot ?

A gotcha, griddata() can return masked arrays which may mess up
downstream interpolation:
    print ma.count_masked( griddataresult )
(experts correct me / suggest what do do -- separate thread.)

(To do bilinear interpolation from one regular grid to another,
    from scipy.interpolate import RectBivariateSpline
    x, y = linspace(...), linspace(...)
    interpolator = RectBivariateSpline( x,y,z, kx=1, ky=1, s=0 )  #
s=0 interpolates
    xi, yi = linspace(...), linspace(...)
    zi = interpolator( xi, yi )

cheers
  -- denis



More information about the SciPy-User mailing list