New Color Table Loading Tool [message #56476] |
Tue, 30 October 2007 10:19 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
After nearly 20 years of being vexed and annoyed by LOADCT
I finally, today, created a new color table loading tool
that works the way I want it to. It is named, appropriately
enough, CTLOAD. (I can't tell you which straw broke the
camel's back, or why today. Life is a mystery.) You can find
it here:
http://www.dfanning.com/programs/ctload.pro
This is a drop-in replacement for LOADCT, so you can use
all the normal keywords, etc. But, in addition, a REVERSE
keyword is supplied so that the color table can be reversed
before it is loaded. Also, a CLIP keyword allows the user
to clip the normal color table vectors at either end of the
original color vector, prior to loading.
I find the latter functionality particularly useful when
I want a reduced number of colors (perhaps for contouring),
but I want to eliminate the black and white colors so
commonly found at either end of most IDL color tables.
For example, suppose I wanted to create a color table
that displayed negative values with red-temperature
values and positive values with blue-temperature
values, and I would like the red-temperature
values to be reversed in the color table (so
dark colors adjoin in the color table and indicate
values near zero). I can do this:
CTLoad, 0
CTLoad, 3, /REVERSE, CLIP=[32,240], BOTTOM=1, NCOLORS=10
CTLoad, 1, CLIP=[64, 245], BOTTOM=11, NCOLORS=10
Colorbar, NCOLORS=20, BOTTOM=1, DIV=10, RANGE=[-10,10]
CINDEX
But, the nicest thing about CTLOAD is that *all* color table
loading is handled silently. Yes!!
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.")
|
|
|