Re: hist_2d question [message #64291 is a reply to message #64289] |
Tue, 16 December 2008 11:19   |
jeffnettles4870
Messages: 111 Registered: October 2006
|
Senior Member |
|
|
On Dec 16, 12:49 pm, Chris <beaum...@ifa.hawaii.edu> wrote:
> On Dec 16, 3:45 am, "Jeff N." <jeffnettles4...@gmail.com> wrote:
>
>> Hi folks,
>
>> I'm working with 2d histograms for the first time, and have a question
>> the documentation doesn't seem to answer (or i missed it).
>
>> Is there a way to construct your bins such that you'll know how many
>> output DN your image has? I want to put a color table on my image,
>> and have been constructing color tables to match the number of output
>> DN, which is fine but i'm wondering if there's a way to ensure 256 DN
>> in the output. I'm sure the answer to this question is "make your
>> bins right", but i'm wondering if there's a straightforward way to
>> calculate how to do that.
>
>> Thanks for any help,
>> Jeff
>
> I don't know of any easy way to do this, but I assume you want the
> __peak__ number of counts in a bin to be 256 (the total number is just
> the number of datapoints you feed into the histogram call, unless you
> clip out the edges). Why not just use bytscl() to scale the result
> afterwards?
Hi Chris,
Thanks for getting back to me...one of my little issues was that i was
using some code sent to me by someone else. I finally looked at their
code and realized what i should've known from the start: they were
applying a color table using a (1d) histogram of the 2d histogram, so
all i need to do is make that histogram give me 256 bins, make a color
table with a color for each bin in the histogram, and i should be all
set (in theory of course!).
Thanks,
Jeff
|
|
|