NAME
ColorBands
DESCRIPTION
This module takes a colormap and creates a new one that is separated
into distinct bands. The GenerateColormap module will always create a
colormap in which the color components flow relatively smoothly over
the coordinate range; no abrupt changes are easily possible. As such
GenerateColormap doesn't provide a convenient way to reduce the
number of colors used in a colormap. ColorBands solves this problem.
When the colormap is separated into the specified number of bands, the
ranges and colors for each band are automatically calculated. However,
all of these are completely customizable.
In addition to being able to reduce the number of colors used in a
colormap, ColorBands also produces the geometry for a colorbar to
represent those bands. The ColorKey and Legend modules can also
create geometry for colorbars, but ColorBands has more flexibility and
will label the reduced number of colors with the appropriate values.
Control is provided over the position, scaling, color, font, ticks, and
labels for the color bar.
ColorBands has the ability to save the ranges and colors for each band
through the use of a configuration file. See the "Read", "Write", and
"Configuration File" sections for further information. This configuration
information can also be imported and exported through the use of the
"Configuration In" and "Configuration Out" ports as well (mainly to
interface with the ContourNaN module). It is important to note that
ColorBands needs either some configuration data or an input colormap
from which to create the new colormap and colorbar. It cannot create
them from scratch.
INPUTS
Colormap In -- Lattice (Opt.)
(1-D, 4-vector, float, uniform).
This is the colormap which will be reduced.
Configuration In -- Parameter (Opt.)
This is an optional configuration string (typically created by the
ContourNaN module) that can be used to create the colorbar. It uses
the same format as the configuration file ColorBands reads and writes,
but is directly available on a port rather than a disk file. This provides
an easy way to create a colorbar that is representative of the colors
and data ranges used by ContourNaN when drawing filled contour
bands. This is necessary because filled contours use the middle value
between two contour levels for coloring rather than the values at the
contour levels. Otherwise, if ColorBands simply used the same
colormap as ContourNaN to create the colorbar then it would not
match up at the ends in terms of data values and colors.
WIDGETS
Mode -- Radio Box
This determines whether the new colormap lattice and geometry will be
output or not. It can be switched to "Build" mode in order to get all the
widgets set properly, then changed to "Run" mode to affect the
outputs.
# Bands -- Slider
This is the number of distinct color bands in the output colormap,
colorbar, and configuration data. It controls the number of entries in
the "Band Ranges" and "Band Colors" scrolling lists.
# Colormap Entries -- Slider
This is the actual number of color cells in the output colormap. It
ultimately determines how many cells are used to represent the
different color bands specified with the "Band Ranges" and "Band
Colors" entries. Variably spaced ranges will have different numbers of
cells to represent them. Hence, the more cells that are used, the more
accurate the representation of the uneven spacing will be. The default
is 256 cells and the maximum is currently set to 4096. This upper
bound can be adjusted by a changing a "#define" statement in the
source code and recompiling. Most Explorer modules that take in
colormaps shouldn't care about their size. One notable exception is
the original GenerateColormap which always demands that input
colormaps have exactly 256 entries.
X Bar Offset -- Slider
This is the X coordinate of the center of the colorbar.
Y Bar Offset -- Slider
This is the Y coordinate of the center of the colorbar.
X Bar Scale -- Slider
This is the scaling factor by which to multiply the X coordinates of the
colorbar. The scaling is done after the positioning.
Y Bar Scale -- Slider
This is the scaling factor by which to multiply the Y coordinates of the
colorbar. The scaling is done after the positioning.
Tick Color -- Text
This is the color of the tick marks and coordinate labels for the
colorbar's bands. Three numbers represent the red, green, and blue
components of the color. The range is from 0.0 to 1.0 for all
components.
Bar Orientation -- Option Menu
This determines whether the colorbar will be displayed horizontally or
vertically.
Bar Position -- Option Menu
This determines how the colorbar will be positioned.
Center - The colorbar will always be centered. This is the default.
Top - The color bar will always be at the top of the window
horizontally centered.
Bottom - The colorbar will always be at the bottom of the window
horizontally centered.
Left - The colorbar will always be at the left side of the window
vertically centered.
Right - The colorbar will always be at the right side of the window
vertically centered.
User-defined - The colorbar position will always be determined by
the current settings of the "X Position" and "Y Position" widgets.
Band Ranges -- Scroll List
This is a list of the coordinate ranges for each of the color bands. An
example of the format is as follows:
1: 0.000000 1.000000
The first integer is the number of the color band. The next two floats
are the upper and lower coordinate bounds for this color band.
New Range -- Text
This allows a new range to be specified for a particular color band.
The entered string must be in the same format as used in the
"Band Ranges" list.
Band Colors -- Scroll List
This is a list of the colors for each of the color bands. An example of
the format is as follows:
1: 1.000000 1.000000 1.000000 1.000000
The first integer is the number of the color band. The next four floats
are the red, green, blue, and opacity components of the color for this
band.
New Color -- Text
This allows a new color to be specified for a particular color band. The
entered string must be in the same format as used in the "Band Colors"
list.
Numbers -- Slider
This is an approximation of the number of tick marks (and labels) that
should be used to represent the coordinate ranges of the color bands.
The specified value is divided into the number of color bands and the
result is used as an increment to determine the actual number of ticks
and labels that are generated starting from the first band.
Number Offset -- Dial
This is the distance of the labels from the tick marks.
Tick Scale -- Dial
This is the scaling factor by which to multiply the length of the tick
marks. The label offset is independent of the scaling.
Number Font -- Option Menu
This is the font to be used for the coordinate numbers.
Number Font Size -- Text
This is the point size of the number font. If there is no noticable change
in the text geometry between point sizes, then that particular size is not
supported and the next available smaller size will be displayed.
Label Font -- Option Menu
This is the font to be used for the annotation label.
Label Font Size -- Text
This is the point size of the annotation font. If there is no noticable
change in the text geometry between point sizes, then that particular
size is not supported and the next available smaller size will be
displayed.
X Label Offset -- Slider
This is the X coordinate of the lower-left corner of the annotation label.
Y Label Offset -- Slider
This is the Y coordinate of the lower-left corner of the annotation
label.
Label Color -- Text
This is the color of the annotation label. Three numbers represent the
red, green, and blue components of the color. The range is from 0.0 to
1.0 for all components.
Label Position -- Option Menu
This determines how the annotation label will be positioned relative to
the colorbar.
Top - The label will be above the colorbar.
Bottom - The label will be below the colorbar.
Left - The label will be to the left of the colorbar.
Right - The label will be to the right of the colorbar.
Label -- Text
This is the character string to be used as the annotation label.
Configuration File -- Text
The is an optional file which can store the configuration of the
"Band Ranges" and "Band Colors" scrolling lists. It provides a
mechanism to reload these settings with an Explorer map rather than
having to retype them.
Read -- Button
This button reads the specified configuration file and updates the
contents of the "Band Ranges" and "Band Colors" scrolling lists.
Write -- Button
This button writes the contents of the "Band Ranges" and
"Band Colors" scrolling lists to the specified configuration file.
Coord Pos -- Text
This is the coordinate at which tick creation will start if the "Fixed"
option is selected from "Coord Type".
Coord Delta -- Text
This is the increment used to space the tick marks if the "Fixed" option
is selected from "Coord Type".
Coord Type -- Option Menu
This determines how tick marks and labels will be created. The
"Regular" option puts a certain amount of them (based on the value of
"Numbers") between colors. The "Fixed" option starts them at the
"Coord Pos" location and goes outward in both directions by
"Coord Delta" until the boundaries of the colorbar are reached.
Number Format -- Text
This is the format specification for the coordinate numbers using a
printing style similar to C. There should be two entries in the widget.
The first is an integer representing the number of decimal places and
the second is either "d", "f", or "e" (without quotes) representing
integer, floating point, and exponential numbers, respectively.
OUTPUTS
Colormap -- Lattice
(1-D, 4-vector, float, uniform).
This is the reduced colormap.
Key -- Geometry
This is the geometry for the colorbar and its labels.
Configuration Out -- Parameter
This is a string containing information about the data ranges and
colors and is in the same format as the configuration file ColorBands
reads and writes. This information is also available on a port so that
it can be easily connected to the ContourNaN module to allow it to
create unevenly spaced contour levels with appropriate coloring.
KNOWN PROBLEMS
There are no known bugs.
SEE ALSO
ColorBin, ColorKey, ContourNaN, GenerateColormap, Legend, Render,
RenderRemote, WaveFormColormap
-
Hans Vahlenkamp (Hans.Vahlenkamp@noaa.gov)
Geophysical Fluid Dynamics Laboratory / NOAA
Princeton University Forrestal Campus
http://www.gfdl.noaa.gov