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 #79676 is a reply to message #79672] Fri, 23 March 2012 07:59 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 < 25522340.354.1332458318275.JavaMail.geo-discussion-forums@vb at19 >,
Sean <seand13@gmail.com> wrote:

> All,
>
> I have what seems to be a straightforward re-gridding/interpolation problem,
> but AFAIK there is no built-in vectorized way to do this that avoids loops.
>
> Here's my inputs --
> vin and yin are arrays of size (ni, nj), and the values of yin are ordered
> along rows
> (e.g., yin[i+1,*] > yin[i,*] for 0 =< i =< (ni-2) )
> yout is an array of length nk
>
> The looped version of the interpolation is the following:
>
> yout = fltarr(nk,nj)
> for j = 0, nj-1 do yout[*,j] = interpol( yin[*,j], vin[*,j], yout)
>
> Is there an elegant and/or built-in way to do this without involving a loop?
>
> I've written a somewhat convoluted program to do this without a loop, but it
> involves some transforming and doesn't seem very elegant. I'm happy to upload
> if someone wants to see it.
>
> Sean

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
[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 09:43:52 PDT 2025

Total time taken to generate the page: 0.88011 seconds