[SciPy-User] [SciPy-user] 2d interpolation, non-regular lat/lon grid - help with delauney/natgrid??

John [H2O] washakie at gmail.com
Tue Aug 11 17:49:10 EDT 2009


A new result based on the code below... not sure if it's better ;)

It does seem to be an improvement, but the problem is I still ultimately
need the data to be on a 0.5x0.5 degree grid. Also, this would clearly still
need masking at some locations. 

    # Set up a basemap and interpolate data
    fig,m = mp.get_base1(region='NPOLE')

    #transform to nx x ny regularly spaced native projection grid
    dx = 2.*np.pi*m.rmajor/len(lons)
    nx = int((m.xmax-m.xmin)/dx)+1; ny = int((m.ymax-m.ymin)/dx)+1
    # Project data into basemap
    ## create interpolator
    print "creating interpolators"
    #Z = mlab.griddata(x,y,z,lons,lats)
    x,y = m(x,y)
    newx= np.arange(m.xmin,m.xmax,(m.xmax-m.xmin)/100)
    newy= np.arange(m.ymin,m.ymax,(m.ymax-m.ymin)/100)
    Z = mlab.griddata(x,y,z,newx,newy)


http://www.nabble.com/file/p24926398/regrid_projection_first.png 
-- 
View this message in context: http://www.nabble.com/2d-interpolation%2C-non-regular-lat-lon-grid-tp24909685p24926398.html
Sent from the Scipy-User mailing list archive at Nabble.com.




More information about the SciPy-User mailing list