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

Home » Public Forums » archive » Re: Expanding array with counts from another array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Expanding array with counts from another array [message #51508] Thu, 23 November 2006 11:18
G. Lichtenberg is currently offline  G. Lichtenberg
Messages: 2
Registered: November 2006
Junior Member
David Fanning wrote:

>> I am pretty sure that a solution was probably posted ages ago already,
>> but could not find it yet. Pointers to a solution are appreciated.
>
> http://www.dfanning.com/idl_way/chunkindex.html
>
> Cheers,
>
> David

Sigh -
I knew it could be found somewhere. If I only had known that I wanted
to 'chunk index' the data - well that's the risk of not being a native
speaker. Anyway, thanks a lot for this tip and the many others I 'stole'
from the various archives.

Slightly embarrassed
gl

--
G. Lichtenberg
Re: Expanding array with counts from another array [message #51517 is a reply to message #51508] Thu, 23 November 2006 07:23 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Guenter Lichtenberg writes:

> I have a the following problem:
> I have two vectors, V with occurring values and C with the number of times
> the values occur (both in the correct order and V sorted). I know want to
> create an expanded array that contains for each element of V C copies
> (loopless if possible). Let's say
>
> V = [3,10,666]
> C = [1,2,3]
> =>
> R = [3,10,10,666,666,666]
>
> (For those who are interested: I use V and C to store a much larger array in
> a compact way, but have to expand it again to assign the correct counts to
> individual detector pixels - if that makes any sense to you. And I have of
> course not three but tens of thousands of values)
>
> I am pretty sure that a solution was probably posted ages ago already, but
> could not find it yet. Pointers to a solution are appreciated.

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

Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Natural Neighbor Interpolation
Next Topic: Re: write_png weirdness

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

Current Time: Sun Oct 12 19:03:49 PDT 2025

Total time taken to generate the page: 0.55860 seconds