Re: spatial interpolation [message #36549 is a reply to message #36538] |
Mon, 29 September 2003 04:57   |
Isa Usman
Messages: 13 Registered: October 2001
|
Junior Member |
|
|
"Mark Hadfield" <m.hadfield@niwa.co.nz> wrote in message
news:bl55ik$iq9$1@newsreader.mailgate.org...
> Isa Usman wrote:
>> Hello All,
>>
>> I have a program which interpolates an irregularly gridded set of data
>> points onto another irregular grid. I have tried as much as possible to
make
>> the calculations as fast as possible (using the dreaded reverse indices
in
>> Histogram) but i am at my wits end. It currently takes about two days to
go
>> through the whole data. Anybody got any suggestions on speed-up
>> improvements? The code is shown below.
>
> What do you mean by "irregularly gridded"? (Sorry, but I can't determine
> this from your code.) Are your data points randomly scattered about, or
> are they on some sort of deformed, stretched, or rotated Cartesian grid?
> Or something else?
>
> If you do have two grids (taking the word to mean a set of nodes with
> some sort of geometric structure) then the key part of your regridding
> is to determine where the nodes of the first grid are relative to the
> nodes of the second. I have some routines to do this for 2D curvilinear
> grids, one using triangular linear interpolation and the other using
> Powell minimisation. I can explain further or send you the code, but
> first I need to know more about what you are trying to do.
Sorry, I should have really said that the data I am interpolating from
(radar data) is on a polar grid. But because the data does not have a
central node due to only data within a radial distance of 20km and 40km
being available, I termed it as irregularly gridded. The data spans out in
~0.25 degree increments up to an angle of 50 degrees. The points I am
interpolating to have a central node situated on the centre of the plane
defined by the radar data points.
What I did in the program was to histogram the original points and the
points that I wanted to interpolate to over a certain rectangular area.
Essentially this constructed a mesh grid over the points and then it would
loop over each grid to do the interpolation. I did this so that i wouldn't
need to loop over every point to interpolate. To make sure there weren't any
"edge effects" in the interpolation, either 8 or 24 grids surrounding the
main grid were joined together before interpolating using MIN_CURVE_SURF.
I hope this helps...
Isa
|
|
|