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

Home » Public Forums » archive » Re: Array juggling help needed
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: Array juggling help needed [message #45684 is a reply to message #45682] Fri, 23 September 2005 06:58 Go to previous messageGo to previous message
Haje Korth is currently offline  Haje Korth
Messages: 651
Registered: May 1997
Senior Member
David,
thanks for your help. Like you, I read the histogram tutorial regularly.
Unlike you, my brain seems to be too small to comprehend it and make use of
it. :-)

Cheers,
Haje


"David Fanning" <davidf@dfanning.com> wrote in message
news:MPG.1d9db3c5a36ee9b0989a99@news.frii.com...
> Haje Korth writes:
>
>> I need to expand and an array non-uniformly based on its content. I am
>> trying to to the following:
>>
>> input array: [1,5,4,1]
>> output array should be: [1,0.2,0.2,0.2,0.2,0.2,0.25,0.25,0.25,0.25,1]
>>
>> Each elements of the input array is basically tuned into
>> fltarr(inputarray[i])/inputarray[i] and the subarray concatenated. Is
>> there
>> a way to do this in one step, without using "for" loops and array
>> concatenation? If not, I can work around this, but knowing for sure that
>> this doesn't work would at least allow me to stop thinking about this
>> problem. :-)
>>
>> To me this looks kind of like a "REPLICATE" for vectors function?
>
> We've got to get more people reading that Histogram Tutorial.
> Does anyone have a picture of a sexy young woman in a
> "Histogram" T-shirt they want to share?
>
> This is the "index chunking" problem discussed in the tutorial
> and last week in this newsgroup:
>
> IDL> n = [1, 5, 4, 1]
> IDL> d = 1./n
> IDL> print, d
> 1.00000 0.200000 0.250000 1.00000
> IDL> h=histogram(total(n,/CUMULATIVE)-1,/BINSIZE,$
> MIN=0,REVERSE_INDICES=ri)
> IDL> I=ri[0:n_elements(h)-1]-ri[0]
> IDL> print, d[I]
> 1.00 0.20 0.20 0.20 0.20 0.20 0.25 0.25 0.25 0.25
>
> Cheers,
>
> David
>
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Spin button widget??
Next Topic: Help needed: read procedure for SCAN-data (soil climate analysis network)

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

Current Time: Fri Oct 10 13:43:07 PDT 2025

Total time taken to generate the page: 0.48163 seconds