Class McIdasColorTableDefaults

java.lang.Object
edu.wisc.ssec.mcidasv.ui.McIdasColorTableDefaults

public class McIdasColorTableDefaults extends Object
A class to provide color tables suitable for data displays. Uses some code by Ugo Taddei. All methods are static.
  • Field Details

  • Constructor Details

  • Method Details

    • createColorTable

      public static ColorTable createColorTable(String name, String category, float[][] table)
      Create a ColorTable and add it to the given list
      Parameters:
      name - The CT name
      category - Its category
      table - The actual data
      Returns:
      The color table
    • createColorTable

      public static ColorTable createColorTable(ArrayList l, String name, String category, float[][] table)
      _more_
      Parameters:
      l - _more_
      name - _more_
      category - _more_
      table - _more_
      Returns:
      _more_
    • createColorTable

      public static ColorTable createColorTable(ArrayList l, String name, String category, float[][] table, boolean tableFlipped)
      Create a ColorTable and add it to the given list
      Parameters:
      l - List to add the ColorTable to
      name - The CT name
      category - Its category
      table - The actual data
      tableFlipped - If true then the table data is not in row major order
      Returns:
      The color table
    • makeTableFromASCII

      public static final float[][] makeTableFromASCII(String name) throws IllegalArgumentException
      Read in and process a hydra color table
      Parameters:
      name - File name
      Returns:
      The processed CT data
      Throws:
      IllegalArgumentException
    • makeAwips2ColorTables

      public static List makeAwips2ColorTables(String name, String category, String file)
      Convert a AWIPS II ".cmap" file to an IDV ColorTable and add the new color table to the McIdasColorTableManager.
      Parameters:
      name - Name to use in the color table manager.
      category - Category of the color table.
      file - Path to AWIPS II ".cmap" file.
      Returns:
      Either a List containing the newly created ColorTable or null if the conversion failed.
    • processInts

      private static float[][] processInts(List reds, List greens, List blues)
      Convert strings of integers to scaled colors.
      Parameters:
      reds - Array containing red strings.
      greens - Array containing green strings.
      blues - Array containing blue strings.
      Returns:
      Color table of scaled floats.
    • processFloats

      private static float[][] processFloats(List reds, List greens, List blues)
      Convert strings of floats to scaled colors.
      Parameters:
      reds - List containing red strings.
      greens - List containing green strings.
      blues - List containing blue strings.
      Returns:
      Color table of scaled floats.
    • toArray

      private static float[][] toArray(List colors)
      Utility to convert list of colors to float array
      Parameters:
      colors - colors
      Returns:
      color array
    • makeColorTable

      private static ColorTable makeColorTable(String name, String cat, ArrayList colors)
      _more_
      Parameters:
      name - _more_
      cat - _more_
      colors - _more_
      Returns:
      _more_