[SciPy-User] Interpolation from a regular grid to a not regular one

Zachary Pincus zachary.pincus at yale.edu
Fri Jun 24 22:23:48 EDT 2011


> lats, longs = latitudes and longitudes of a regular grid (shape is (161,201))
> vals = corresponding values (shape = (161,201))
> 
> I've got two more 2d numpy arrays which are latitudes and longitudes of a non regular grid (shapes are (1900,2400))

scipy.ndimage.map_coordinates()

A little confusing, very useful. Sorry I've got no time to provide an example, but it should be what you want.



On Jun 24, 2011, at 8:02 AM, Domenico Nappo wrote:

> Hi there,
> hope you can help me.
> 
> I'm new to SciPy and I'm not aware of all its nice features.
> I need some indications about how to complete the following task...just giving me some suggestions about which package/methods to use could be enough.
> 
> I have three 2d numpy arrays representing the followings:
> 
> lats, longs = latitudes and longitudes of a regular grid (shape is (161,201))
> vals = corresponding values (shape = (161,201))
> 
> I've got two more 2d numpy arrays which are latitudes and longitudes of a non regular grid (shapes are (1900,2400))
> 
> Now, I've got to produce the grid of values for the non regular grid, using interpolation (probably nearest neighbour).
> I've come out with something using griddata from the matplotlib.mlab module but I'm not sure it's the right way and I don't know how to test the interpolated results...
> 
> Many thanks in advance.
> 
> -- 
> dome
> _______________________________________________
> SciPy-User mailing list
> SciPy-User at scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user




More information about the SciPy-User mailing list