[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Histogram Hot-shots Required



Liam Gumley (Liam.Gumley@ssec.wisc.edu) writes:

> Assuming I know the minimum and maximum values (the range) used in
> creating the histogram, the histogram binsize, and the number of bins,
> the zero-based bin index is given by
> 
> bin_index = long(float(pixel_value - histogram_min_value) /
> float(binsize))
> 
> 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)
> 
> At least, that's how it looks to me on paper....

Well, I think this is the correct answer, surely. But
I still have rather large differences on my plot between 
this calculated value and the "perceived" value on
the graph. This must be a function of the distribution of
the data in certain bins and the way the graph is being
drawn. 

To solve this I may have to go to a bar plot, which
I have *really* been trying to avoid. :-(

In any case, I appreciate the help very much.

Cheers,

David

P.S. I am going to pursue Ronn Kling's suggestions about
Reverse_Indices some more, even if I don't think it is the
answer in this case. I just love the irony of having a joke
throw-away line become the real answer. :-)

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