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

Home » Public Forums » archive » Re: elegant array index expansion using INTERPOLATE
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: elegant array index expansion using INTERPOLATE [message #58043 is a reply to message #58042] Fri, 11 January 2008 13:56 Go to previous messageGo to previous message
Bob[3] is currently offline  Bob[3]
Messages: 60
Registered: December 2006
Member
On Jan 11, 3:33 pm, "Ryan." <rchug...@brutus.uwaterloo.ca> wrote:
> Hi All,
>
> If I have a range of array indices I want to be able to interpolate
> between this to get all indices in between.  What is an elegant way of
> doing this?
>
> Here is an example of what I want:
>
> array = [0,2,4,6,8,10,12,14,16,18]
> idxrange = [3, 6]
>
> expidxrange = Interpolate('idxrange') to get [3,4,5,6]
>
> so that I can get
> array[expidxrange] OR [6,8,10,12]
>
> I would like it to be as general as possible.  This is what I have, but
> it doesn't work for a range of 1:
>
> expidxrange = INTERPOLATE(idx, $
> (1./(idxrange[1]-idxrange[0])*FINDGEN(idxrange[1]-idxrange[0 ]) ) )
>
> Any thoughts?
>
> Ryan.

Isn't array[expidxrange] just array[3:6] or
array[idxrange[0]:idxrange[1]] ?
...or are you after the explicit list of expidxrange?

Bob.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: combinatorial annealing
Next Topic: image on map

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

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

Total time taken to generate the page: 0.80225 seconds