Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Simple question in IDL, looking for solution, thank you
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Heinz Stege  
View profile  
 More options Oct 23 2012, 6:20 pm
Newsgroups: comp.lang.idl-pvwave
From: Heinz Stege <public.215....@arcor.de>
Date: Wed, 24 Oct 2012 00:21:26 +0200
Local: Tues, Oct 23 2012 6:21 pm
Subject: Re: Simple question in IDL, looking for solution, thank you

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.html

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.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.