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

Home » Public Forums » archive » Re: GRIDDATA woes
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: GRIDDATA woes [message #59053 is a reply to message #59044] Mon, 03 March 2008 06:24 Go to previous messageGo to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article
<57808cc6-8454-45f1-a104-50e465ef294c@v3g2000hsc.googlegroups.com>,
"ben.bighair" <ben.bighair@gmail.com> wrote:

> I have seen a number of messages on the newsgroup about interpolation
> from an irregular grid to a regular one. None appear to address the
> issues around gridding on a sphere. I don't think I can use anything
> as simple as INTERPOLATE since the input array is sampled at irregular
> intervals.
>
> So how is this kind of interpolation supposed to be done?

If your grid is rectangular and separable (in the sense that all the
longitudes in each "column" of data are the same and all of the
latitudes in each "row" of data are same), even if the coordinates
are not regularly spaced, then it is actually quite
easy to interpolate to any set of points (regular or irregular) using
INTERPOLATE. This should be much faster than triangulating.

This problem looks just like the one David Fanning was working
on recently, and here is an outline of the solution

> Assuming that your data is 2-D (x = longitude and y = latitude), create
> the grids that you want to interpolate to
> nx = 360
> ny = 181
> x �= FINDGEN(nx)
> y �= -90.0 + FINDGEN(ny)
> Compute the "interpolation coordinates" from the original grid
> j �= VALUE_LOCATE(y_original, y)
> yj = j + (y - y_original[j])/(y_original[j+1] - y_original[j])
> Since the input and output grids are the same in the x-direction, you
> don't need to do anything with x. �Expand x and yi into 2-D arrays
> xx = REBIN(x, nx, ny, /SAMPLE)
> yy = REBIN(REFORM(yi, 1, ny), nx, ny, /SAMPLE)
> Then interpolate
> new = INTERPOLATE(original, xx, yy)

By happy chance, the interpolation chapter from my book is the sample
that is posted online here

http://idl.tamu.edu/Book.html


Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Speeding up a call to the where function
Next Topic: GRIDDATA woes

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

Current Time: Sat Oct 11 06:12:28 PDT 2025

Total time taken to generate the page: 1.20095 seconds