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

Home » Public Forums » archive » Simple question in IDL, looking for solution, thank you
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: Simple question in IDL, looking for solution, thank you [message #81842 is a reply to message #81769] Tue, 23 October 2012 15:21 Go to previous messageGo to previous message
Heinz Stege is currently offline  Heinz Stege
Messages: 189
Registered: January 2003
Senior Member
On Tue, 23 Oct 2012 15:57:20 -0400, Jeremy Bailin wrote:

> A couple of notes:
>
> JBIU has a weighted histogram function:
> http://astroconst.org/jbiu/jbiu-doc/math/histogram_weight.ht ml
>

This is really great. I have learned something new again. Thank you,
Jeremy.

For the documentation: Jeremy's way of "chunk indexing" goes the
following way:

h=histogram(arr,min=0,reverse_indices=ri)
sum=lonarr(size(h,/dimensions))
for i=0l,n_elements(h)-1 do $
if h[i] gt 0 then sum[i]=total(bcg[ri[ri[i]:ri[i+1]-1]],/integer)
print,sum[1:*]

Small code, very fast, and low memory consumption. This is perfect.

Cheers, Heinz


> Regarding reverse_indices using lots of memory on sparse histograms: use
> VALUE_LOCATE!
> http://www.idlcoyote.com/code_tips/valuelocate.html
>
> -Jeremy.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: cgHistoplot and multiplot
Next Topic: Semi-Transparent Images

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

Current Time: Fri Oct 10 18:08:30 PDT 2025

Total time taken to generate the page: 0.56156 seconds