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

John [H2O] washakie at gmail.com
Sat Sep 26 07:34:24 EDT 2009


Raising the issue again, because I am still having problems.

To explain my situation once more, I have a set of non-regular data spanning
the N Pole. I want to interpolate it to a regular lat/lon grid. 

Here is my current approach:
# data_lon,data_lat  are lat/lon pairs, irregularly spaced
# m is a npstere basemap instance
x,y = m(data_lon,data_lat)
reg_lon = np.arange(lon.min(),lon.max()+dres,dres)
nx = reg_lon.size
reg_lat = np.arange(lat.min(),lat.max()+dres,dres)
ny = reg_lat.size
grid_lon,grid_lat = m.makegrid(nx,ny)

# find the projected co-ordinates for the grid
grid_x, grid_y = m(grid_lon, grid_lat)
print "Using Triangulation"
# triangulate data
tri = delaunay.Triangulation(x,y)
# interpolate data
interp = tri.nn_interpolator(z)
Z0 = interp(grid_x, grid_y) 

This works fine, however, I note that grid_lon, grid_lat are no longer equal
to reg_lon, reg_lat. So it seems that my Z0 is not spaced regularly as
reg_lon,reg_lat but rather according to grid_lon,grid_lat.

This is fine for mapping in a projected space (i.e. using the basemap
instance), but how can I 'reverse transform' the data back so that it has
reg_lon,reg_lat as it's coordinates?

Thanks again!

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




More information about the SciPy-User mailing list