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

Home » Public Forums » archive » Re: Regrid / Interpolation Question
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: Regrid / Interpolation Question [message #79671 is a reply to message #79670] Fri, 23 March 2012 11:20 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 < 16619448.872.1332525871438.JavaMail.geo-discussion-forums@pb jk8 >,
Sean <seand13@gmail.com> wrote:

>> Use INTERPOLATE instead of INTERPOL, and compute a 2-D array of
>> coordinates to match yin that contains the row index of each point.
>>
>> Ken Bowman
>
> I can see the general idea for doing this with interpolate --The code should
> look something like
>
> yinterpolates = REBIN( transpose(lindgen(nj)), n_elements(yout), nj)
> yout = interpolate( yin, xinterpolates, yinterpolates)
>
> but I don't quite get how to calculate the x-interpolates. The problem is
> that the values in vin, while ordered in each row, are not evenly spaced --
> Am I missing something simple here?

INTERPOLATE uses the concept of 'fractional coordinates', which you can think
of as floating-point indices into the array.

If your tabulated points are not evenly spaced, you need to first reverse
interpolate the desired output coordinates onto the unevenly spaced grid to get
the fractional coordinates. That is, think of your unevenly spaced x's as a
function of array index.

Then use those fractional coordinates to interpolate the dependent variable
to the output points.

Since you are doing the interpolation row-by-row, the y-coordinate should be
trivial. That is, it should just be the row index itself.

Ken Bowman
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: New Coyote Graphics Program: cgPolygon
Next Topic: Time axis labelling (1 major label every 7 days with 6 minor ticks)

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

Current Time: Fri Oct 10 04:49:16 PDT 2025

Total time taken to generate the page: 0.80042 seconds