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

Home » Public Forums » archive » Histogram Hot-shots Required
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
There is NO TRUTH! Re: Histogram Hot-shots Required [message #16362 is a reply to message #16297] Mon, 19 July 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Folks,

More evidence that the apocalypse is upon us....

Here are five different methods for calculating the
histogram bin number from a value:

; Liam's method 1:

binNum1 = FLOOR((value - Min(array)) / binsize)

; Liam's method 2:

binNum2 = ROUND((value - Min(array)) / binsize)

; Liam's method 3:

binNum3 = CEIL((value - Min(array)) / binsize)

; Eddie's method:

binNum4 =(where(R ge ((where(((where(array eq value))[0]) eq $
R[R[0]:*]))[0]+R[0])))[0]

; My brute-force, no-excuses method:

FOR j=0,N_Elements(bins)-2 DO BEGIN
IF value GT bins[j] and value LT bins[j+1] THEN BEGIN
binNum5 = j
goto, getout
ENDIF
ENDFOR
getout:

Here is typical output of this print statement:

Print, binNum1, binNum2, binNum3, binNum4, binNum5

34 35 35 35 34
11 12 12 12 11
11 11 12 12 11
13 13 14 14 13
2 3 3 3 2
10 11 11 11 10
12 12 13 13 12
28 28 29 29 28
26 27 27 27 26
33 34 34 34 33
34 35 35 35 34
32 33 33 33 32

Notice that method 1 and method 5 always produce the same
number. Whew! It may be brute-force, but I can explain it
and I am SURE it is right!

But, woe of woes, here is the graphical output for the last
value:

http://www.dfanning.com/images/histogram.jpg

Not even close. :-(

The best graphical values are STILL method 3.

HELP!!!!!

Cheers,

David

P.S. Let's just say my confidence in rational thought is slipping...

Of course, I'm listening to my Bob Marley CD, so that may have
something to do with it :-)

--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Contour `wrapping' problem
Next Topic: Re: Compile Problem with IDL5.2

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

Current Time: Sat Oct 11 11:22:00 PDT 2025

Total time taken to generate the page: 3.12196 seconds