Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-11 Thread Juan A. Saenz
Jeff, thanks for your reply. One situation where one might require masked nearest neighbor interpolation is when, on a given fixed grid, interpolating velocities on cell corners (B-grid) to faces (C-grid). Cells will be defined as either land or ocean cells, masked or un-masked respectively. Th

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-11 Thread Juan A. Saenz
If I think of something, I'll let you know. In the meantime, I'd like to point out the following: Nearest neighbor returns a masked interpolation point if the nearest neighbor is masked (this is just what you've already told me). If there are two equidistant neighbors, it returns the one on the

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-07 Thread Jeff Whitaker
On 3/7/11 2:25 PM, Juan A. Saenz wrote: > Jeff, thanks for your reply. > > One situation where one might require masked nearest neighbor > interpolation is when, on a given fixed grid, interpolating velocities > on cell corners (B-grid) to faces (C-grid). Cells will be defined as > either land o

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-07 Thread Jeff Whitaker
On 3/7/11 7:38 AM, Aman Thakral wrote: On a similar note, are there any alternatives available to nearest neighbor? For example, kriging? I remember seeing a geostats library in python (hpgl i think), but I found the API rather impractical and difficult to use. Thanks, Aman Aman: The bas

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-07 Thread Aman Thakral
On a similar note, are there any alternatives available to nearest neighbor? For example, kriging? I remember seeing a geostats library in python (hpgl i think), but I found the API rather impractical and difficult to use. Thanks, Aman On Mon, Mar 7, 2011 at 8:23 AM, Jeff Whitaker wrote: > On

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-07 Thread Jeff Whitaker
On 3/7/11 5:50 AM, Jeff Whitaker wrote: > On 3/6/11 8:58 PM, Juan A. Saenz wrote: >> Hi, >> >> I use Basemap and netCDF4-python on a regular basis, and find them >> very useful tools. Thank you for developing them! >> >> I noticed that when using basemap.interp for nearest neighbor >> (order=0) the

Re: [Matplotlib-users] Basemap interp nearest neighbor

2011-03-07 Thread Jeff Whitaker
On 3/6/11 8:58 PM, Juan A. Saenz wrote: > Hi, > > I use Basemap and netCDF4-python on a regular basis, and find them > very useful tools. Thank you for developing them! > > I noticed that when using basemap.interp for nearest neighbor > (order=0) the interpolation is not masked, and nearest neigh

Re: [Matplotlib-users] Basemap interp

2010-02-25 Thread Friedrich Romstedt
2010/2/26 Andrew Charles : > Aye, now that I read the docstring with a rested pair of eyes it's > clear that xout and yout are meshgrids (rank 2 arrays). Thanks, > problem solved. For convenience, I recently heard about numpy.meshgrid, which does the job for you. See its __doc__, but it's fairly

Re: [Matplotlib-users] Basemap interp

2010-02-25 Thread Andrew Charles
On Thu, Feb 25, 2010 at 7:26 PM, Friedrich Romstedt wrote: > 2010/2/25 Andrew Charles : >> I'm trying to interpolate from one grid to another using Basemap's >> interp function. It seems to want the lat and lon axis of the new grid >> to have the same shape: >> >> 3524  if xout.shape != yout.shape

Re: [Matplotlib-users] Basemap interp

2010-02-25 Thread Friedrich Romstedt
Andrew, I sent this to you personally, unintentionally, and want it to be on the list too. So you have it doubled now, sorry. 2010/2/25 Andrew Charles : > I'm trying to interpolate from one grid to another using Basemap's > interp function. It seems to want the lat and lon axis of the new grid >

[Matplotlib-users] Basemap interp

2010-02-24 Thread Andrew Charles
I'm trying to interpolate from one grid to another using Basemap's interp function. It seems to want the lat and lon axis of the new grid to have the same shape: 3524 if xout.shape != yout.shape: 3535 raise ValueError, 'xout and yout must have same shape!' The grid I'm interpolating to is 14