Technical Guide
This page is meant to include a technical overview of how color palettes can be customized. For a simple example walk through, see Creating a Custom Color Palette for RadarScope.
RadarScope color palettes specify which colors to apply to data values in a radar product. They’re defined in plain text files with a filename extension of “.pal” The contents of the file specify the product types for which the color palette can be used (e.g. reflectivity, velocity, etc.), the units of data values in the file (e.g. dBZ, miles per hour, etc.), and the colors to associate with those data values. RadarScope color palettes are based on the Color Table File Specification originally created by Gibson Ridge Software, with some modifications to support certain RadarScope features.
Comments - Comments can be included on any line of the file to provide supplemental information. Comments are ignored by RadarScope. They can contain any supplemental information that you wish to convey to someone who is viewing or editing the file. Comments are placed at the end of a line. They are preceded by a semicolon ( ; ) and can contain any text. All text from the semicolon to the end of the line is part of the comment and is ignored by RadarScope.
Examples:
; This is a comment.
; This is another comment.
; Comments must appear at the end of a line.
; They can contain any text.
Product: string - The product statement identifies the radar product types for which this color palette can be used. For example, a reflectivity color table can specify either “BR” (for base reflectivity) or “DR” (for digital reflectivity). Each file should contain a single Product statement. Table 1 below lists the acceptable product IDs for each product that can use a custom color palette.
Examples:
Product: BR ; Base reflectivity
Product: DV ; Digital velocity
Product: ZDR ; Differential reflectivity
Product: CC ; Correlation coefficient
Units: string - The Units statement identifies the units of the data values specified in the color palette. Each file should contain a single Units statement. RadarScope supports the use of certain units with certain products. Table 1 below lists the supported product and unit combinations.
Examples:
Units: DBZ ; Reflectivity (dBZ)
Units: MPH ; Miles per hour
Units: INCHES
Scale: value - The Scale statement specifies a scale factor for values in the color palette from the units used in the color palette to RadarScope’s native units. Each file should contain a single Scale statement. If the Scale statement is omitted, a scale of 1.0 is used.
Examples:
Scale: 1.0
Scale: 2.23694 ; Convert mph to m/s
RF: red green blue - Products that may experience range folding, such as velocity and spectrum width, should contain a single RF statement to specify the color to use for range-folded pixel values in the radar image. The RF color is specified with three integer values representing the red, green, and blue components of the color. Each component ranges from 0 to 255 representing the intensity of that component.
Examples:
RF: 127 0 207 ; Purple
RF: 255 255 255 ; White
Color Statements - Color statements are used to associate data values with colors. RadarScope recognizes four varieties of color statements: Color, Color4, SolidColor, and SolidColor4. Each color statement includes a data value in the form of an integer or floating-point number in the units specified in the Units statement. The color is specified by three or four integer values, representing the red, green, and blue components of the color and, optionally, an alpha component that represents transparency. Some product types (precipitation depiction and echo tops) also use an optional mask value that allows duplicate value ranges to be defined according to another property of the product. For example, the precipitation depiction allows duplicate dBZ value ranges to be defined for rain, snow, and mixed precipitation, while the echo tops product allows duplicate altitude ranges to be defined for echo heights that were detected by the radar beam vs. “topped” heights which exceed the altitude at which the beam can reach. The Color and Color4 statements define the starting color of a smooth gradient between the current entry and the next one, while the SolidColor statements define a single color that applies for all values between the current entry and the next one.
Color: value red green blue [mask] - The Color statement is used to associate a data value with a color. The value is specified as an integer or floating-point number in the units specified in the Units statement. The color is specified with three integer values representing the red, green, and blue components of the color. Each component ranges from 0 to 255 representing the intensity of that component. The optional mask is a product-specific label that allows a range of values to be repeated for different product-specific conditions. The precipitation depiction product uses mask values fo RAIN, MIX, and SNOW to define a different range of colors for each precipitation type. The echo tops products use the TOPPED mask value to define a different range of colors for echo heights that exceed the detection height of the radar beam.
Use the Color statement to define the starting color of a smooth gradient between its data value and the value in the next color statement. For example, if a Color statement associates 10 dBZ with red and the subsequent color statements associates 20 dBZ with blue, RadarScope will generate a smooth color gradient that gradually transitions from red to blue for values between 10 dBZ and 20 dBZ.
Examples:
Color: 5 153 153 0
Color: 10 204 204 0
Color: 52.0 229 0 0 RAIN
Color: 52.0 121 55 60 MIX
Color: 52.0 0 0 135 SNOW
Color: 69 187 187 187 TOPPED
Color4: value red green blue alpha [red2 green2 blue2 alpha2] [mask] - The Color4 statement is used to associate a data value with a color. The value is specified as an integer or floating-point number in the units specified in the Units statement. The color is specified with four integer values representing the red, green, blue, and alpha components of the color. Each component ranges from 0 to 255 representing the intensity of that component. The alpha component defines a level of transparency, with 0 indicating fully transparent and 255 indicating fully opaque. The optional mask is a product-specific label that allows a range of values to be repeated for different product-specific conditions. The precipitation depiction product uses mask values fo RAIN, MIX, and SNOW to define a different range of colors for each precipitation type. The echo tops products use the TOPPED mask value to define a different range of colors for echo heights that exceed the detection height of the radar beam.
Use the Color4 statement to define the starting color of a smooth gradient between its data value and the value in the next color statement. For example, if a Color4 statement associates 10 dBZ with red and the subsequent color statements associates 20 dBZ with blue, RadarScope will generate a smooth color gradient that gradually transitions from red to blue for values between 10 dBZ and 20 dBZ.
Examples:
Color4: 5 153 153 0 0
Color4: 10 204 204 0 128
Color4: 52.0 229 0 0 255 RAIN
Color4: 52.0 121 55 60 255 MIX
Color4: 52.0 0 0 135 255 SNOW
Color4: 69 187 187 187 TOPPED
SolidColor: value red green blue [mask] - The SolidColor statement is used to associate a data value with a color. The value is specified as an integer or floating-point number in the units specified in the Units statement. The color is specified with three integer values representing the red, green, and blue components of the color. Each component ranges from 0 to 255 representing the intensity of that component. The optional mask is a product-specific label that allows a range of values to be repeated for different product-specific conditions. The precipitation depiction product uses mask values fo RAIN, MIX, and SNOW to define a different range of colors for each precipitation type. The echo tops products use the TOPPED mask value to define a different range of colors for echo heights that exceed the detection height of the radar beam.
Use the SolidColor statement to define a single color to be applied to values between data value and the value in the next color statement. For example, if a SolidColor statement associates 10 dBZ with red and the subsequent color statements associates 20 dBZ with blue, RadarScope will use red for all values between 10 dBZ and 20 dBZ.
Examples:
SolidColor: 5 153 153 0
SolidColor: 10 204 204 0
SolidColor: 52.0 229 0 0 RAIN
SolidColor: 52.0 121 55 60 MIX
SolidColor: 52.0 0 0 135 SNOW
SolidColor: 69 187 187 187 TOPPED
SolidColor4: value red green blue alpha [red2 green2 blue2 alpha2] [mask] - The SolidColor4 statement is used to associate a data value with a color. The value is specified as an integer or floating-point number in the units specified in the Units statement. The color is specified with four integer values representing the red, green, blue, and alpha components of the color. Each component ranges from 0 to 255 representing the intensity of that component. The alpha component defines a level of transparency, with 0 indicating fully transparent and 255 indicating fully opaque. The optional mask is a product-specific label that allows a range of values to be repeated for different product-specific conditions. The precipitation depiction product uses mask values fo RAIN, MIX, and SNOW to define a different range of colors for each precipitation type. The echo tops products use the TOPPED mask value to define a different range of colors for echo heights that exceed the detection height of the radar beam.
Use the SolidColor4 statement to define a single color to be applied to values between data value and the value in the next color statement. For example, if a SolidColor4 statement associates 10 dBZ with red and the subsequent color statements associates 20 dBZ with blue, RadarScope will use red for all values between 10 dBZ and 20 dBZ.
Examples:
SolidColor4: 5 153 153 0 0
SolidColor4: 10 204 204 0 128
SolidColor4: 52.0 229 0 0 255 RAIN
SolidColor4: 52.0 121 55 60 255 MIX
SolidColor4: 52.0 0 0 135 255 SNOW
SolidColor4: 69 187 187 187 TOPPED
Other Statements - Statements such as ND, Offset, Decimals, and a few others are sometimes used in color palettes created for other apps. It’s ok to include them in RadarScope color palettes, but RadarScope doesn’t currently use them.
Supported Products and Units - Table 1 lists the product ID and unit combinations that RadarScope supports for each product type. For example, reflectivity color palettes must specify a Product of either “BR” or “DB” and must use units of “DBZ”. When alternate units are supported, it’s important to include a Scale statement so RadarScope knows how to convert your color palette’s units to its own internal units for that product. Table 1 lists the supported product IDs and units for each product type.
Table 1: Supported Product Types, Product IDs, and Units
Product Type |
Accepted Product IDs |
Accepted Units |
Reflectivity |
BR, DR |
DBZ |
Velocity |
BV, DV, SRV |
???, KTS, KNOTS, MPS, MPH, KPH |
Precipitation Depiction |
PM |
DBZ |
Spectrum Width |
SW |
???, KTS, KNOTS, MPS, MPH, KPH |
Differential Reflectivity |
ZDR |
DB |
Correlation Coefficient |
CC |
NONE, % |
Specific Differential Phase |
KDP |
DEG/KM, °/KM |
Hydrometeor Classification |
HC, HHC |
NONE |
Precipitation Accumulation |
DAA, DTA, PTA |
MM, CM, IN, INCH, INCHES |
Precipitation Difference |
DOD, DSD |
MM, CM, IN, INCH, INCHES |
Storm Total Rainfall |
NTP |
MM, CM, IN, INCH, INCHES |
Vertically Integrated Liquid |
DVL, VIL |
KG/M^2, KG/M2, KG/M² |
Echo Tops |
EET, ET |
KFT |
Differential Phase |
PHI |
Deg |
Indexed Color Palettes - Some radar products support the use of an indexed color palette, where the values specified in the color palette apply to raw pixel values instead of data values in the product’s units. These can be used for radar products which have sliding scales, such as digital velocity products and most of the digital accumulation products. A digital velocity product may normally range from -64 to +64 meters per second, but the range may be extended during a hurricane or tropical storm. A precipitation accumulation product may start with a range from 0 to a couple of inches, but be extended to several inches during periods of heavy rainfall.
When using an indexed color palette, the color statement values can range from 0 to 255, and the colors specified for those values will be applied to the lowest and highest data values, respectively, that are represented in the product. To define an indexed color palette for these products, specify units of “???” in the Units statement.