public class ColorTableDefaults
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME_DEFAULT
The name of the "default" color table
|
Constructor and Description |
---|
ColorTableDefaults() |
Modifier and Type | Method and Description |
---|---|
static float[][] |
allOneColor(java.awt.Color color)
Make a color table representing this color.
|
static float[][] |
allOneColor(java.awt.Color color,
boolean addAlpha)
Make a color table representing this color.
|
static float[][] |
bright12()
Make 12 color bright spectrum; blue (lo) to red (hi)
|
static float[][] |
bright14()
Make 14 color bright spectrum; blue (lo) to red (hi)
|
static float[][] |
bright16()
Make 16 color bright spectrum; blue (lo) to red (hi)
|
static float[][] |
bright38()
Make a 38-color bright spectrum; blue (low values) to red (high values).
|
static ColorTable |
createColorTable(java.util.ArrayList l,
java.lang.String name,
java.lang.String category,
float[][] table)
Create a ColorTable and add it to the given list
|
static ColorTable |
createColorTable(java.util.ArrayList l,
java.lang.String name,
java.lang.String category,
float[][] table,
boolean tableFlipped)
Create a ColorTable and add it to the given list
|
static ColorTable |
createColorTable(java.util.ArrayList l,
java.lang.String name,
java.lang.String category,
float[][] table,
boolean tableFlipped,
Range range)
Create a ColorTable and add it to the given list
|
static ColorTable |
createColorTable(java.lang.String name,
java.lang.String category,
float[][] table)
Create a ColorTable and add it to the given list
|
static java.util.ArrayList |
createColorTables()
Create the default color tables
|
static float[][] |
DZ1()
Make a color table for radar reflectivity as close as possible
to the one used by the NWS in their web page displays of same.
|
static float[][] |
DZ2()
A 2nd color table for radar reflectivity, better than DZ1 for VisAD.
|
static float[][] |
grayTable(int numColors,
boolean inverse)
Make a color table ranging from black to white; linear changes
in RGB amounts.
|
static float[][] |
grayTable1(int len)
Make a color table ranging from black to white; linear changes
in RGB amounts.
|
static float[][] |
invRainbow(int len)
Make the standard VisAD inverse rainbow (red to blue) table
with definable length; created by by Ugo Taddei.
|
static void |
main(java.lang.String[] args)
Main method
|
static java.util.List |
makeAwips2ColorTables(java.lang.String name,
java.lang.String category,
java.lang.String file)
Convert a AWIPS II ".cmap" file to an IDV
ColorTable
and add the new color table to the ColorTableManager . |
static java.util.List |
makeGempakColorTables(java.lang.String name,
java.lang.String category,
java.lang.String file)
Make GEMPAK color tables
|
static java.util.List |
makeNclRgbColorTables(java.lang.String name,
java.lang.String cat,
java.lang.String file,
java.lang.String contents)
Make ColorTables from NCAR Command Language (NCL) RGB files
|
static java.util.List |
makeRgbColorTables(java.lang.String name,
java.lang.String cat,
java.lang.String file)
Make color tables from RGB files
|
static java.util.List |
makeRgbColorTables(java.lang.String name,
java.lang.String cat,
java.lang.String file,
java.util.List lines,
java.lang.String delimiter)
Make color tables from RGB tuples in a file
|
static float[][] |
makeTableFromAct(java.lang.String name)
Read in and process the act color table
|
static float[][] |
makeTableFromET(java.lang.String name)
Read in and process the mcidas color table
|
static float[][] |
makeTableFromET(java.lang.String name,
boolean fromAuxdata)
Read in and process the mcidas color table
|
static float[][] |
makeTableFromPal(java.lang.String name)
Read in and process the pal color table
|
static float[][] |
makeTableFromPal1(java.lang.String name)
Read in and process the pal1 color table
|
static float[][] |
makeTableFromPal2(java.lang.String name)
Read in and process the pal2 color table
|
static float[][] |
percentBlue(int len)
Make a color table ranging from white to dark blue,
typically for parms with 0 to 100%.
|
static float[][] |
percentYelGrnBlue(int len)
Make a color table ranging from yellow to blue, through green;
typically for parms with values spanning 0 to 100 %.
|
static float[][] |
percentYellowBlue(int len)
Make a color table ranging from yellow to dark blue,
typically for parms with 0 to 100%.
|
static float[][] |
precipCT1()
Make The first standard Unidata MetApps liquid precip amount
color table.
|
static float[][] |
rainbow(int len)
Make the standard VisAD rainbow (blue lo to red high) color table
with definable length.
|
static float[][] |
temperatureCT1()
Make the first temperature color table.
|
static float[][] |
temperatureCT2()
Make a bright temperature spectrum; blue (lo) to red (hi)
5 deg C steps or bands; some duplicate colors below 0
Length is fixed at 21 for now.
|
static float[][] |
temperatureCT3()
Make a third temperature spectrum; NEEDS WORK
setRange() to -55 to 50 Celsius
|
static float[][] |
temperatureCT4()
Make the fourth temperature color table.
|
static float[][] |
topographyCT()
Provide a color table suitable for topography
|
static float[][] |
windspeed()
make the nominal wind speed color table, based on color table temperatureCT4.
|
static float[][] |
windSpeed(int len)
Make a color table ranging from white to dark blue (negatives);
white to green going 0 to large positive.
|
public static final java.lang.String NAME_DEFAULT
public static ColorTable createColorTable(java.lang.String name, java.lang.String category, float[][] table)
name
- The CT namecategory
- Its categorytable
- The actual datapublic static ColorTable createColorTable(java.util.ArrayList l, java.lang.String name, java.lang.String category, float[][] table)
l
- List to add the ColorTable toname
- The CT namecategory
- Its categorytable
- The actual datapublic static ColorTable createColorTable(java.util.ArrayList l, java.lang.String name, java.lang.String category, float[][] table, boolean tableFlipped)
l
- List to add the ColorTable toname
- The CT namecategory
- Its categorytable
- The actual datatableFlipped
- If true then the table data is not in row major orderpublic static ColorTable createColorTable(java.util.ArrayList l, java.lang.String name, java.lang.String category, float[][] table, boolean tableFlipped, Range range)
l
- List to add the ColorTable toname
- The CT namecategory
- Its categorytable
- The actual datatableFlipped
- If true then the table data is not in row major orderrange
- the color table rangepublic static java.util.ArrayList createColorTables()
public static final float[][] rainbow(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] temperatureCT1() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] temperatureCT4() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] temperatureCT2()
public static final float[][] temperatureCT3()
public static final float[][] precipCT1() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] invRainbow(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] percentBlue(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] grayTable(int numColors, boolean inverse) throws java.lang.IllegalArgumentException
numColors
- number of descrete colors for the tableinverse
- true for white to black instead of black to whitejava.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] grayTable1(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] percentYellowBlue(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] percentYelGrnBlue(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] windSpeed(int len) throws java.lang.IllegalArgumentException
len
- length; how many entries desired in the color table.java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] bright38()
public static final float[][] bright16()
public static final float[][] bright14()
public static final float[][] bright12()
public static final float[][] topographyCT()
public static final float[][] allOneColor(java.awt.Color color)
color
- color to usepublic static final float[][] allOneColor(java.awt.Color color, boolean addAlpha)
color
- color to useaddAlpha
- true to add an alpha channelpublic static final float[][] DZ1()
public static final float[][] DZ2()
public static final float[][] windspeed() throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- from construction of VisAd objectspublic static final float[][] makeTableFromET(java.lang.String name) throws java.lang.IllegalArgumentException
name
- File namejava.lang.IllegalArgumentException
public static final float[][] makeTableFromET(java.lang.String name, boolean fromAuxdata) throws java.lang.IllegalArgumentException
name
- File namefromAuxdata
- Is this file from the auxdata dirjava.lang.IllegalArgumentException
- When bad things happenpublic static final float[][] makeTableFromPal1(java.lang.String name) throws java.io.IOException
name
- File namejava.io.IOException
- On badnesspublic static final float[][] makeTableFromPal2(java.lang.String name) throws java.io.IOException
name
- File namejava.io.IOException
- On badnesspublic static java.util.List makeGempakColorTables(java.lang.String name, java.lang.String category, java.lang.String file)
name
- name of the tablecategory
- the categoryfile
- the file to readpublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- argumentsjava.lang.Exception
- something bad happenedpublic static java.util.List makeNclRgbColorTables(java.lang.String name, java.lang.String cat, java.lang.String file, java.lang.String contents) throws java.io.IOException
name
- name of tablecat
- categoryfile
- the filecontents
- the file contentsjava.io.IOException
- problem opening filepublic static java.util.List makeRgbColorTables(java.lang.String name, java.lang.String cat, java.lang.String file, java.util.List lines, java.lang.String delimiter)
name
- the name of the color tablecat
- the categoryfile
- the file to readlines
- the linesdelimiter
- the rgb tuple delimiterspublic static java.util.List makeRgbColorTables(java.lang.String name, java.lang.String cat, java.lang.String file) throws java.io.IOException
name
- name of the color tablecat
- categoryfile
- the file to readjava.io.IOException
- problem reading the filepublic static final float[][] makeTableFromAct(java.lang.String name) throws java.io.IOException
name
- File namejava.io.IOException
- On badnesspublic static final float[][] makeTableFromPal(java.lang.String name) throws java.io.IOException
name
- File namejava.io.IOException
- On badnesspublic static java.util.List makeAwips2ColorTables(java.lang.String name, java.lang.String category, java.lang.String file)
ColorTable
and add the new color table to the ColorTableManager
.name
- Name to use in the color table manager.category
- Category of the color table.file
- Path to AWIPS II ".cmap" file.List
containing the newly created
ColorTable
or null
if the conversion failed.