[SciPy-User] another interpolation question

Robert Kern robert.kern at gmail.com
Thu Feb 17 13:41:16 EST 2011


On Thu, Feb 17, 2011 at 12:36, Zachary Pincus <zachary.pincus at yale.edu> wrote:
>> I am looking for a (fast as possible) way to interpolate my data
>> from a coarse to fine grid where the limits may not match. Bilinear
>> interpolation is fine.
>>
>> I saw ndimage.map_coordinates but it seems to want i,j coordinates
>> whereas I have 1D lat,lon coordinate arrays.
>>
>> Input: coarse and fine 2D arrays with 1D coordinate arrays
>>
>> Output: data from coarse grid interpolated onto the fine grid
>
> I'm not sure if I understand the request -- what are the 1D coordinate
> arrays for? If you have data on a coarse 2D grid and have a fine 2D
> grid defined, doesn't that alone specify the interpolation?

The 1D coordinate arrays are defining the grid points for each axis.
E.g. given a 2D array C and the 1D arrays x_coord, y_coord, the data
value at C[i,j] will have the "real-world" location x_coord[j],
y_coord[i].

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco



More information about the SciPy-User mailing list