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

Home » Public Forums » archive » 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
elegant array index expansion using INTERPOLATE [message #58049] Fri, 11 January 2008 12:33
Ryan. is currently offline  Ryan.
Messages: 77
Registered: March 2006
Member
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.
[Message index]
 
Read Message
Previous Topic: how to find name of top level program
Next Topic: combinatorial annealing

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

Current Time: Fri Oct 10 14:56:45 PDT 2025

Total time taken to generate the page: 0.48104 seconds