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

Home » Public Forums » archive » Re: There is NO TRUTH! Re: 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
Re: There is NO TRUTH! Re: Histogram Hot-shots Required [message #16354 is a reply to message #16346] Tue, 20 July 1999 00:00 Go to previous messageGo to previous message
Liam Gumley is currently offline  Liam Gumley
Messages: 473
Registered: November 1994
Senior Member
David Fanning wrote:
> Forget it, problem solved. The bottom line: draw
> your own *&%@# histogram plots with the PLOTS command.
>
> Best method is:
>
> ; Liam's method 1:
>
> binNum1 = FLOOR((value - Min(array)) / binsize)
>
> But you have to draw your *OWN* histogram plots, or
> your graphical representation will *never* look like
> what it is suppose to look like:
>
> Plot, bins, histdata, /NoData, XRange=range, XStyle=1
> FOR j=0,N_Elements(bins)-2 DO BEGIN
> PlotS, [bins[j], bins[j], bins[j+1], bins[j+1]], $
> [0, histdata[j], histdata[j], 0], Color=yellow
> ENDFOR
> PLOTS, [value, value], !Y.CRange

Sounds like we need a nice histogram plotting procedure: any takers?

I'd keep the protection against integer binsize values by converting to
a float, e.g.

bin_index = (pixel_value - histogram_min_value) / FLOAT(binsize)
bin_index = FLOOR(bin_index)

and then to protect against pixel values LT histogram minimum value, or
GE histogram maximum value

bin_index = (bin_index > 0L) < (number_of_bins - 1L)

I'm very fond of testing algorithms on paper before I implement them in
code. I tested the method shown above with a few examples on a notepad,
so I was 99% sure it would work. My advice to those starting out in IDL
is this: even though IDL offers a wonderful range of time-saving
shortcuts (e.g. HISTOGRAM), it often pays to do a reality-check on paper
before coding up an algorithm.

Cheers,
Liam.

--
Liam E. Gumley
Space Science and Engineering Center, UW-Madison
http://cimss.ssec.wisc.edu/~gumley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Seeking IDL Programmers with Interests in Coastal Oceanography/Geology
Next Topic: Re: CALL_EXTERNAL failure.

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

Current Time: Sun Oct 12 07:16:05 PDT 2025

Total time taken to generate the page: 1.04323 seconds