[Numpy-discussion] subdivide array
Tue Nov 30 10:58:07 CST 2010
On Nov 30, 2010, at 5:40 PM, John wrote:
> I have an array of data for a global grid at 1 degree resolution. It's
> filled with 1s and 0s, and it is just a land sea mask (not only, but
> as an example). I want to be able to regrid the data to higher or
> lower resolutions (i.e. 0.5 or 2 degrees). But if I try to use any
> standard interp functions, such as mpl_toolkits.basemap.interp it
> fails -- I assume due to the data being binary.
> I guess there may be a fairly easy routine to do this?? Does someone
> have an example?
Just a random idea: have you tried to convert your input data to float? Hopefully you could get some values between 0 and 1 for your interpolated values, that you'll have to transform back to integers following a scheme of your choosing...
More information about the NumPy-Discussion