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

Home » Public Forums » archive » Re: help with chunk indexing
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: help with chunk indexing [message #54780 is a reply to message #54641] Tue, 03 July 2007 01:11 Go to previous message
Wox is currently offline  Wox
Messages: 184
Registered: August 2006
Senior Member
On Mon, 02 Jul 2007 05:42:08 -0700, greg.addr@googlemail.com wrote:

>
> Here's a simpler way...
>
> IDL> inds = [0,1,1,2,3,3 ,3 ,3]
> IDL> n = [1,2,1,4]
> IDL> c=[0,total(n,/cum,/int)]
> IDL> print,indgen(n_elements(inds))-c[inds]
> 0 0
> 1 0 0
> 1 2 3

From the moment I used the where function, I just knew there was a
better way :-).

> For the life of me, I can't remember how to transform n = [1,2,1,4]
> ==> inds = [0,1,1,2,3,3 ,3 ,3] - I spent ages reading the IDL function
> list, but I can't find it...

http://www.dfanning.com/idl_way/chunkindex.html

But Matt knew how to do that.
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: Get Latitude and Longitude from Tiff files
Next Topic: moxed format file i/o

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

Current Time: Wed Oct 08 17:53:09 PDT 2025

Total time taken to generate the page: 0.00692 seconds