comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Interpolation from a regular to an irregular grid?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Interpolation from a regular to an irregular grid? [message #35062] Wed, 07 May 2003 09:13 Go to previous message
JD Smith is currently offline  JD Smith
Messages: 850
Registered: December 1999
Senior Member
On Wed, 07 May 2003 02:58:12 -0700, Evan Mason wrote:

> Hi, I am kind of new to IDL, and have just started a new job in physical
> oceanography in Portugal. At present I am familiarising myself with
> IDL, which I will be using extensively.
>
> One of my first tasks is to find a way to input satellite collected wind
> data into an ocean model that is being run here. The wind data are
> regularly spaced, whereas the model requires the data in a series of
> irregularly spaced intervals.
>
> Looking through the messages on this group I see many questions and
> answers about working from irregular to regular grids using Triangulate
> and Trigrid, but I wonder if anyone knows how to do the reverse?
>

The reverse is the easy case -- just interpolate:

wind=exp(dist(10)/sqrt(10))

ocean_x=randomu(sd,30)*10
ocean_y=randomu(sd,30)*10
ocean_wind=interpolate(wind,ocean_x,ocean_y,CUBIC=-0.5)

This skips an important step you'll have to perform: converting your
two coordinate systems to match each other. Note that INTERPOLATE
treats pixels as integer-centered, e.g. the lower-left pixel is
centered at [0.0,0.0]. I've always found this sort of grid rather
unphysical, preferring instead to range from 0->n on the (left,bottom)
to (top,right) edge of the grid, i.e. lower-left pixel centered at
[0.5,0.5]. You'll need to keep this in mind when you convert your
ocean grid coordinates into the logical coordinate system of the wind
data array.

For very large grids, you might care about the finite curvature of the
earth, in which case you'll want to interoplate on a sphere -- see the
beautifully-named SPH_SCAT routine in that case.

Good luck,

JD
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Unsupported X Windows visual
Next Topic: annotated text without using graphics device in IDL?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 16:49:25 PDT 2025

Total time taken to generate the page: 0.00422 seconds