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

Home » Public Forums » archive » Re: Logarithmic Color Scaling
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: Logarithmic Color Scaling [message #51786 is a reply to message #51697] Wed, 06 December 2006 05:18 Go to previous messageGo to previous message
Braedley is currently offline  Braedley
Messages: 57
Registered: September 2006
Member
David Fanning wrote:
> Braedley writes:
>
>> I would tend to agree with JD on this. I don't think it would be a
>> good idea to scale the color table (and hence the colorbar). I've
>> never had to worry about the problem you're facing because whenever I
>> did anything remotely like this, I worked in dB, and so my colorbar was
>> labeled in dB. I think it would be trivial for you to go from this
>> thinking to labeling your colorbar logarithmically.
>
> Well, I've been looking for the trivial solution for
> the past 48 hours straight. I'd be delighted to be
> pointed in the right direction. May I see your code?
>
> I do agree with you that it is trivial to
> label a color bar logarithmically. What I am finding
> difficult is making the colors associated with the
> color bar labels accurately reflect the values
> in the data, which seems to me to be pretty much the
> point of a color bar.
>
> With the exception of spectro_plot from the SolarSoft
> library, which I have still not had time to download,
> I have seen a lot of advice, but no working code. This
> leads me to believe maybe it's not as trivial as everyone
> (including me) thought it might be. :-)
>
> Cheers,
>
> David
>
> --
> David Fanning, Ph.D.
> Fanning Software Consulting, Inc.
> Coyote's Guide to IDL Programming: http://www.dfanning.com/
> Sepore ma de ni thui. ("Perhaps thou speakest truth.")

Actually, I got the code I'm using just for the colorbar from a
co-worker, and may very well have been written by you back when you
were at Precision Visuals. The trick is when the data is byte scaled,
the extremes of the data need to be recorded. Since the data I use
could extend from 0dB down to well under -120dB, the decision was made
to impose a maximum dynamic range of 80dB for the plot. The data is
then byte scaled like so:

max=max(data)
new_data=bytscl(data, max=max, min=max-80)
;get the data on the screen using combination of plot, /nodata and
tvimage

Remember that the data is in dB. Then the call to a colorbar routine
just needs a log keyword, and a call like so:

some_colorbar_routine, /top, min=10.0^((max-80)/10.0),
max=10^(max/10.0), /log

Braedley
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL_IDLBridge GetVar vs. Shared Memory
Next Topic: IDL 6.3 Directory Change?

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

Current Time: Fri Oct 10 16:36:17 PDT 2025

Total time taken to generate the page: 0.16341 seconds