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

Home » Public Forums » archive » histogram question
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: Histogram question [message #40375 is a reply to message #26139] Sun, 08 August 2004 11:52 Go to previous messageGo to previous message
mperrin+news is currently offline  mperrin+news
Messages: 81
Registered: May 2001
Member
Michael Wallace <mwallace.no.spam@no.spam.swri.edu.invalid> wrote:
> I wrote this little snippet which doesn't use HIST_2D at all. It's just
> a simple FOR loop and adding values. Back in the good ol' days, I would
> have been satisfied with this, but after having read this newsgroup for
> a while I just have a feeling that there's a way to get rid of that FOR
> loop and do something totally cool with the HISTOGRAM function. So I
> guess my question is more academic than anything else.

It's too bad HIST_2D doesn't have a REVERSE_INDICES keyword like HISTOGRAM
does. If it did, you could do something like

H = hist_2d(v1,v2,reverse_indices=r)
for i=0L,n_elements(h)-1 do
H[i] += total(v3[R[R[I] : R[i+1]-1]] -1 )


You could maybe still make this work if you don't mind unrolling your
2D arrays into 1D arrays somehow. The above code is just off the top
of my head and hasn't been tested or debugged or anything like that,
so no promises are made!

- Marshall
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Contour Border Sort Error
Next Topic: Passing Structures with Pointers with Call_External

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

Current Time: Sat Oct 11 14:27:31 PDT 2025

Total time taken to generate the page: 0.16207 seconds