[SciPy-user] Next neighbor interpolation inside regular griddedarrays
Stefan van der Walt
Mon Mar 19 15:24:43 CDT 2007
On Mon, 19 Mar 2007 11:52:51 +0100, Thomas Nauss <email@example.com> wrote:
> Hi everyone,
> I have projected raw swath satellite data to map coordinates and stored
> the data values in a 2D target array that has the geometry of the output
> dataset already. I have initialized the target array using Numeric.zeros
> and since not all fields of the target array had corresponding fields in
> the input dataset, some fields of the target array have still the value 0.
> Is there a function which performs a next neighbor interpolation for
> each array field with a specified value?
Normally, the easiest way to work around this problem is to perform the
process in reverse. I.e. for every coordinate in the output frame, do the
inverse mapping to find the coordinate in the input frame, and, using
interpolation, calculate the value.
If you are interested, I have code available that does all sorts of warping,
or you can take a look at scipy's ndimage.map_coordinates.
More information about the SciPy-user