Re: Coyote Color Program Updates [message #60354] |
Sun, 18 May 2008 16:05 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
ph le sager writes:
> By plotting R,G and B vectors, I found that the diverging tables are
> centered on 117. First half is index 0-116 and second half is 117-233.
> They basically saturate after index 233.
I'm aware of this, and I have some ideas for fixing it,
but I've been off learning to become a wilderness
ranger for the past several days. I should have something
better soon.
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.")
|
|
|
Re: Coyote Color Program Updates [message #60361 is a reply to message #60354] |
Sat, 17 May 2008 12:12  |
ph le sager
Messages: 5 Registered: June 2005
|
Junior Member |
|
|
On May 15, 11:24 am, David Fanning <n...@dfanning.com> wrote:
> Folks,
>
> I guess I was feeling ambitious, but I like those Brewer
> Colors so much, I decided to update all my color programs
> to support them. The following programs have been updated:
>
> http://www.dfanning.com/programs/fsc_color.pro
> http://www.dfanning.com/programs/xcolors.pro
> http://www.dfanning.com/programs/pickcolor.pro
> http://www.dfanning.com/programs/pickcolorname.pro
> http://www.dfanning.com/programs/ctload.pro
>
> To use Brewer Colors with with XCOLORS or CTLOAD,
> you must either download the brewer.tbl file from
> Mike Galloy's web page, or download the fsc_brewer.tbl
> file from mine. Mine contains only the 256-element color
> tables from Mike's nice file:
>
> http://www.dfanning.com/programs/fsc_brewer.tbl
>
> If you don't have a clue what I am talking about, here
> are some references:
>
> http://www.personal.psu.edu/cab38/ColorBrewer/ColorBrewer_in tro.html
> http://michaelgalloy.com/2007/10/30/colorbrewer.html
>
> The brewer color table file must be installed in the
> $IDL_DIR/resource/colors directory, or in the same
> directory containing the color program source code files.
> (More or less.) Other Coyote programs may also be required.
> You can download all the Coyote programs here:
>
> http://www.dfanning.com/programs/coyoteprograms.zip
>
> Or, if you never bothered to see how your IDL programming life
> could be significantly improved, you can read all about the
> programs in the Coyote Library here:
>
> http://www.dfanning.com/documents/programs.html
>
> 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.")
As I noted in a post on Mike blog (http://michaelgalloy.com/2008/02/21/
updated-brewer-color-tables.html), there is an issue with the
diverging color tables. You expect to have the "center" color (like
white or yellow) from which the color scheme diverge at index 126-127,
but :
"By plotting R,G and B vectors, I found that the diverging tables are
centered on 117. First half is index 0-116 and second half is 117-233.
They basically saturate after index 233.
So I just load the 256 colors and use only the first 233 colors."
I do not know if you fix it. But I have been using them (like you I
like them a lot), and in my program (that uses xcolors!) I used a
kludge along these lines:
xcolors, NColors=NColors, /Block, $
File=CtFile, ColorInfo=ColorInfoData, _EXTRA=e
Name = ColorInfoData.Name
Table = ColorInfoData.Index
;--------------------------------------------------------
; Temporary hack for Brewer diverging tables: they are centered on
; color #117 instead of #125. (phs, 23/4/08)
if strPos(Name, '(Diverging)') ge 0 then begin
; Reload All colors and only keep the good ones
loadct, table, file=ctfile, /SILENT
tvlct, r, g, b, /get
r = r[0:233]
g = g[0:233]
b = b[0:233]
ncolors = ncolors < 234
; compress to ncolors if needed Ncolors passed by user
if ( Is_NC_defined ) then begin
R = Congrid( R, NColors, /Minus_One, /Interp, _EXTRA=e )
G = Congrid( G, NColors, /Minus_One, /Interp, _EXTRA=e )
B = Congrid( B, NColors, /Minus_One, /Interp, _EXTRA=e )
endif
endif
;----------------- End Hack -----------------------------
This is particularly important with some values of ncolors.
Cheers, Philippe
|
|
|
Re: Coyote Color Program Updates [message #60362 is a reply to message #60361] |
Sat, 17 May 2008 06:02  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
> You might look at some very old procedures in the solar libraryhttp://sohowww.nascom.nasa.gov/solarsoft/gen/idl/disp lay/
> form_vel.pro (to load a velocity table), load_vel.pro (to process an
> image for display with a color table), and combine_vel.pro (to display
> both intensity and velocity).
Thanks, Wayne, those look great!
> Well... making your own is not that difficult.
Yeah, that's what I invariably do, but every time I need it (and it's
quite common) I do it afresh and come up with something that I'm not
entirely happy with...
-Jeremy.
|
|
|
Re: Coyote Color Program Updates [message #60364 is a reply to message #60362] |
Fri, 16 May 2008 09:45  |
wlandsman
Messages: 743 Registered: June 2000
|
Senior Member |
|
|
On May 16, 11:42 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> On the subject of useful colour tables, does anyone have a good
> "velocity map" colour table? Something that goes from red through
> green to blue, kind of like PRISM, but that becomes significantly non-
> green closer to 128 that goes to strong-red and strong-blue at the
> ends rather than at intermediate indices?
>
You might look at some very old procedures in the solar library
http://sohowww.nascom.nasa.gov/solarsoft/gen/idl/display/
form_vel.pro (to load a velocity table), load_vel.pro (to process an
image for display with a color table), and combine_vel.pro (to display
both intensity and velocity).
From the FORM_VEL documentation:
; When used with LOAD_VEL, positive velocities will be shown in blue,
negative
; velocities in red (or visa-versa), velocities at or near zero will
be
; shown in grey, and missing pixels will be black.
--Wayne
P.S. These procedures have a lot of dependencies so I might just use
them for ideas, if you don't have the solar library already installed.
|
|
|
Re: Coyote Color Program Updates [message #60365 is a reply to message #60364] |
Fri, 16 May 2008 09:39  |
fburton
Messages: 19 Registered: June 2003
|
Junior Member |
|
|
In article <47326671-81ab-4ce1-b5d2-70dd853d8527@f36g2000hsa.googlegroups.com>,
Vince Hradil <hradilv@yahoo.com> wrote:
> On May 16, 10:42 am, Jeremy Bailin <astroco...@gmail.com> wrote:
>> On the subject of useful colour tables, does anyone have a good
>> "velocity map" colour table? Something that goes from red through
>> green to blue, kind of like PRISM, but that becomes significantly non-
>> green closer to 128 that goes to strong-red and strong-blue at the
>> ends rather than at intermediate indices?
>>
>> -Jeremy.
>
> Well... making your own is not that difficult.
> http://www.dfanning.com/color_tips/create_colortable.html
My programs allow users to specify colour scales by giving a series
of letters (and 0 for black, 1 for white). Each letter represents a
particular colour, with R being primary red (255,0,0), G being green,
B blue etc. Interpolation is in RGB space. So a 'standard' red-thru-
green-thru-blue' would be represented by the string "RGB". Greyscale
would be "01". More subtle scales can be constructed by adding extra
letters. You could get a more 'pinched' scale by specifying "RRGBB",
though this would produce regions at the end in which the colour
didn't change. Alternatively, you could use special characters that
extend the 'influence' of the adjacent colour letter, e.g. "R>G<B".
The advantage of this method is that it is intuitive and users can
play about with letters to get immediate feedback. I have used it to
reproduce most standard 'special purpose' colour scales in published
papers and in IDL and Matlab.
Unfortunately, it's in Delphi (but could be converted to IDL easily
enough, I imagine).
Francis
|
|
|
Re: Coyote Color Program Updates [message #60366 is a reply to message #60365] |
Fri, 16 May 2008 08:51  |
Vince Hradil
Messages: 574 Registered: December 1999
|
Senior Member |
|
|
On May 16, 10:42 am, Jeremy Bailin <astroco...@gmail.com> wrote:
> On the subject of useful colour tables, does anyone have a good
> "velocity map" colour table? Something that goes from red through
> green to blue, kind of like PRISM, but that becomes significantly non-
> green closer to 128 that goes to strong-red and strong-blue at the
> ends rather than at intermediate indices?
>
> -Jeremy.
Well... making your own is not that difficult.
http://www.dfanning.com/color_tips/create_colortable.html
|
|
|
Re: Coyote Color Program Updates [message #60367 is a reply to message #60366] |
Fri, 16 May 2008 08:42  |
Jeremy Bailin
Messages: 618 Registered: April 2008
|
Senior Member |
|
|
On the subject of useful colour tables, does anyone have a good
"velocity map" colour table? Something that goes from red through
green to blue, kind of like PRISM, but that becomes significantly non-
green closer to 128 that goes to strong-red and strong-blue at the
ends rather than at intermediate indices?
-Jeremy.
|
|
|