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. The masked or un-masked character of cells does not change. Interpolating velocities from corners adjacent to masked cells, to cell centers on un-masked cells will require the behavior in question. Imagine two adjacent cells, one masked and the other not. The velocities on the cell corners that lie on the coast (adjacent to a masked and an un-masked cell) are masked. A desireable behavior of the interpolator would be to produce an un-masked cell centered velocity on the un-masked cell that uses values from adjacent un-masked velocity values.
Thanks, Juan On 8/03/11 12:23 AM, Jeff Whitaker wrote: > 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 interpolation is not masked, and nearest neighbor masked >>> values will be used in the interpolation. I was wondering if you could >>> suggest a way to do nearest neighbor interpolation where masked are >>> supported, i.e. nearest neighbor values that are not masked. >>> >>> Thanks for your help, >>> Juan >>> >> Juan: I agree that this would be desirable behavior. Unfortunately, >> it's not obvious to me how to do it. I'll think about it and get back >> to you. (cc'ing matplotlib-users list). >> >> -Jeff >> > > Juan: On second thought, I'm not sure this is desirable behavior. I > would guess that most of the time, if a nearest neighbor is masked, > the user would expect the interpolation routine to return a masked > value. I would be interested to hear what others think. > > -Jeff > -- Juan A. Saenz Postdoctoral Fellow Geophysical Fluid Dynamics Research School of Earth Sciences Australian National University Building 61 Mills Road Canberra, ACT 0200 AUSTRALIA Office: +61 2 6125 9968 Admin: +61 2 6125 5502 Fax: +61 2 6257 2737 ------------------------------------------------------------------------------ Colocation vs. Managed Hosting A question and answer guide to determining the best fit for your organization - today and in the future. http://p.sf.net/sfu/internap-sfd2d _______________________________________________ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users