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 #16352 is a reply to message #16346] Tue, 20 July 1999 00:00 Go to previous messageGo to previous message
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:

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

Uh, I'm busy this morning. :-(

> 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)

Liam's absolutely right here. And, of course, I had this in
my *real* code, even if I didn't have it in the demo I showed
here. :-)

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

Testing algorithms is probably a great idea, but
truthfully, I solved this problem by using IDL! The
best and most powerful feature of IDL is the ability
to *see* what you are doing. I could literally see
the pixels I was selecting (by turning them green) and
count the suckers. A couple of lines of code here and
there brought the visual problem into sharp focus.

I thought it odd, too, that the problem turned out
to be a graphical problem. That is the *last* place
I was looking for it. (I thought sure it was buried
deep in reverse indices. :-) But what I like about IDL
is that once I knew what the problem was, I was able
to fix it in one line of code. You gotta like that!

Cheers,

David

--
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
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 04:32:11 PDT 2025

Total time taken to generate the page: 2.08071 seconds