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

John [H2O] washakie@gmail....
Thu Aug 13 08:47:56 CDT 2009


YOU should've read the (FM)?? Or I? ;)

Actually, I have referred to both docs, but I'm just missing something. &-(

Unfortunately, it seems now the problem is that m (basemap instance) expects
grid_lon, grid_lat to be of the same length. I tried to convert them into
meshgrid objects, but then I get the error I received in the prior message
about monotonically increasing axes...

Otherwise, the error is:

RuntimeError: Buffer lengths not the same


Scott Sinclair-4 wrote:
> 
>>2009/8/13 John [H2O] <washakie@gmail.com>:
>>
>> Still problems...
> 
> Ok. I probably should have read this
> http://www.scipy.org/Cookbook/Matplotlib/Gridding_irregularly_spaced_data
> and the docstring for mlab.griddata
> 
> Does it work if you do:
> 
> grid_lon = np.arange(lon.min(), lon.max()+dres, dres)
> grid_lat = np.arange(lat.min(), lat.max()+dres, dres)
> 
> grid_x, grid_y = m(grid_lon, grid_lat)
> 
> Z0 = mlab.griddata(x, y, z, grid_x, grid_y)
> 
> Z0.shape should now == (grid_lat.size, grid_lon.size) and you can plot
> accordingly (using imshow, contour, scatter or whatever).
> 
> Cheers,
> Scott
> _______________________________________________
> SciPy-User mailing list
> SciPy-User@scipy.org
> http://mail.scipy.org/mailman/listinfo/scipy-user
> 
> 

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



More information about the SciPy-User mailing list