HiRISE

HiRISE.HiPlan.HOGG
Class Stored_LUT

java.lang.Object
  extended by HiRISE.HiPlan.HOGG.Stored_LUT
All Implemented Interfaces:
Function2D

public class Stored_LUT
extends Object
implements Function2D

A two-dimensional function that implements the HiRISE stored lookup tables.

This function maps 14-bit data numbers (DNs) between 0 and 16383 to 8-bit DNs between 0 and 254. (The 8-bit number 255 is a reserved value.) The function has a single parameter: the number of the stored lookup table, between 0 and 27. The details of the individual lookup tables are stored in an external PVL file. If no parameters exist for a given lookup table number, a trivial lookup table is used instead: All 14-bit values map to 0.

The algorithm is strictly an integer algorithm. This implementation returns doubles, however, because the Function2D interface is double-based. In addition, because this function represents a lookup table that maps 14-bit data to 8-bit data, the values are bounded: If the input parameter (the 14-bit DN) is less than MINIMUM_14_BIT_VALUE, MINIMUM_8_BIT_VALUE is returned. If the input is greater than MAXIMUM_14_BIT_VALUE, MAXIMUM_8_BIT_VALUE is returned.

Algorithm Details

(Insert algorithm details here.)

Version:
2.24
Author:
Christian Schaller - UA/PIRL

Nested Class Summary
static class Stored_LUT.Algorithm_Options
          A set of options for configuring the stored LUT best number algorithm.
static class Stored_LUT.Best_Number_Algorithm
          An enumeration of the best-number algorithms used within the stored LUT.
 
Field Summary
static String ALGORITHM
          The name of the Parameter whose value is the algorithm to use in choosing the best stored LUT number given a set of input.
static int DEFAULT_LUT_NUMBER
          The default LUT number.
static String DESCRIPTION
          The name of the Parameter whose value is a description of the set of stored LUTs.
static String DN14
          The name of the Parameter whose value is a sequence array of 14-bit data numbers.
static String DN8
          The name of the Parameter whose value is a sequence array of 8-bit data numbers.
static String ID
          Class identification name with source code version and date.
static String LUT_PREFIX
          The prefix used to name a particular LUT.
static String LUT_SET
          The name of the Parameter whose value is the name of the LUT set to use initially.
static int MAXIMUM_14_BIT_VALUE
          The maximum value for input 14-bit data.
static int MAXIMUM_8_BIT_VALUE
          The largest value output by this function.
static int MAXIMUM_LUT_NUMBER
          The largest stored LUT number.
static int MINIMUM_14_BIT_VALUE
          The minimum value for input 14-bit data.
static int MINIMUM_8_BIT_VALUE
          The smallest value output by this function.
static int MINIMUM_LUT_NUMBER
          The smallest stored LUT number.
static String STORED_LUTS
          The name of the aggregate (group) Parameter under which all stored LUT data are enclosed.
static String STORED_LUTS_FILENAME
          The name of the PVL file containing the stored LUT data.
 
Constructor Summary
Stored_LUT()
           
Stored_LUT(int lutNumber)
           
 
Method Summary
static Stored_LUT.Best_Number_Algorithm getAlgorithm()
          Gets the best-number algorithm of the current LUT set.
static Stored_LUT.Best_Number_Algorithm getAlgorithm(String lutSet)
          Gets the best-number algorithm for a named LUT set.
static int getBestLutNumber(CCD_Histogram histogram, Stored_LUT.Algorithm_Options options)
          Gets the best stored LUT number for the given input histogram and set of options.
static int getBestLutNumber(Histogram histogram, Stored_LUT.Algorithm_Options options)
          Gets the best stored LUT number for the given input histogram and set of options.
static String getDescription()
          Gets the description of the current LUT set.
static String getDescription(String lutSet)
          Gets the description of a named LUT set.
 int getLutNumber()
           
static String getLutSet()
          Gets the name of the current stored LUT set.
static List<String> getLutSets()
          Gets the list of all stored LUT set names.
 double getValue(double x)
           
static boolean isApplicableLut(String ccd, int lut)
           
static boolean isApplicableLut(String ccd, int lut, Stored_LUT.Best_Number_Algorithm algorithm)
           
 void setLutNumber(int lutNumber)
           
static void setLutSet(String lutSet)
          Configures the Stored_LUT class to use the named stored LUT set for all operations.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public static final String ID
Class identification name with source code version and date.

See Also:
Constant Field Values

MINIMUM_14_BIT_VALUE

public static final int MINIMUM_14_BIT_VALUE
The minimum value for input 14-bit data. Any input less than this value results in output of MINIMUM_8_BIT_VALUE.

See Also:
Constant Field Values

MAXIMUM_14_BIT_VALUE

public static final int MAXIMUM_14_BIT_VALUE
The maximum value for input 14-bit data. Any input greater than this value results in output of MAXIMUM_8_BIT_VALUE.

See Also:
Constant Field Values

MINIMUM_8_BIT_VALUE

public static final int MINIMUM_8_BIT_VALUE
The smallest value output by this function.

See Also:
Constant Field Values

MAXIMUM_8_BIT_VALUE

public static final int MAXIMUM_8_BIT_VALUE
The largest value output by this function.

See Also:
Constant Field Values

MINIMUM_LUT_NUMBER

public static final int MINIMUM_LUT_NUMBER
The smallest stored LUT number.

See Also:
Constant Field Values

MAXIMUM_LUT_NUMBER

public static final int MAXIMUM_LUT_NUMBER
The largest stored LUT number.

See Also:
Constant Field Values

DEFAULT_LUT_NUMBER

public static final int DEFAULT_LUT_NUMBER
The default LUT number.

See Also:
Constant Field Values

STORED_LUTS_FILENAME

public static final String STORED_LUTS_FILENAME
The name of the PVL file containing the stored LUT data. The class loader expects to find this file in the directory named by Constants.RESOURCES_DIRECTORY.

See Also:
Constant Field Values

LUT_SET

public static final String LUT_SET
The name of the Parameter whose value is the name of the LUT set to use initially. If no such parameter exists in the stored LUTs PVL file, the first set will be used.

See Also:
Constant Field Values

STORED_LUTS

public static final String STORED_LUTS
The name of the aggregate (group) Parameter under which all stored LUT data are enclosed.

See Also:
Constant Field Values

LUT_PREFIX

public static final String LUT_PREFIX
The prefix used to name a particular LUT. The LUT parameter itself is the prefix plus the LUT number.

See Also:
Constant Field Values

DN14

public static final String DN14
The name of the Parameter whose value is a sequence array of 14-bit data numbers. There must be one 14-bit data number for each 8-bit data number.

See Also:
DN8, Constant Field Values

DN8

public static final String DN8
The name of the Parameter whose value is a sequence array of 8-bit data numbers. There must be one 8-bit data number for each 14-bit data number.

See Also:
DN14, Constant Field Values

ALGORITHM

public static final String ALGORITHM
The name of the Parameter whose value is the algorithm to use in choosing the best stored LUT number given a set of input. The value of this parameter defines how the getBestLutNumber(HiRISE.HiPlan.HOGG.CCD_Histogram, HiRISE.HiPlan.HOGG.Stored_LUT.Algorithm_Options) method picks the best stored LUT number.

Valid values: Stored_LUT.Best_Number_Algorithm.values().

See Also:
Constant Field Values

DESCRIPTION

public static final String DESCRIPTION
The name of the Parameter whose value is a description of the set of stored LUTs.

See Also:
Constant Field Values
Constructor Detail

Stored_LUT

public Stored_LUT(int lutNumber)
           throws PVL_Exception,
                  FileNotFoundException
Throws:
PVL_Exception
FileNotFoundException

Stored_LUT

public Stored_LUT()
           throws PVL_Exception,
                  FileNotFoundException
Throws:
PVL_Exception
FileNotFoundException
Method Detail

getLutNumber

public int getLutNumber()

setLutNumber

public void setLutNumber(int lutNumber)

getValue

public double getValue(double x)
Specified by:
getValue in interface Function2D

getLutSet

public static String getLutSet()
                        throws PVL_Exception,
                               FileNotFoundException
Gets the name of the current stored LUT set. If the data have not been initialized, this method will do so.

Returns:
the name of the current stored LUT set.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.

setLutSet

public static void setLutSet(String lutSet)
                      throws PVL_Exception,
                             FileNotFoundException,
                             Invalid_Argument_Exception
Configures the Stored_LUT class to use the named stored LUT set for all operations. If the data have not been initialized, this method will do so.

Parameters:
lutSet - the name of the stored LUT set to use.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.
Invalid_Argument_Exception - if lutSet is not a valid LUT set name.

getLutSets

public static List<String> getLutSets()
                               throws PVL_Exception,
                                      FileNotFoundException
Gets the list of all stored LUT set names. If the data have not been initialized, this method will do so.

Returns:
the names of all stored LUT sets; it is a clone of the actual list.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.

getDescription

public static String getDescription(String lutSet)
                             throws PVL_Exception,
                                    FileNotFoundException,
                                    Invalid_Argument_Exception
Gets the description of a named LUT set. If the data have not been initialized, this method will do so.

Returns:
the description of the named LUT set.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.
Invalid_Argument_Exception - if lutSet is not a valid LUT set name.

getDescription

public static String getDescription()
                             throws PVL_Exception,
                                    FileNotFoundException
Gets the description of the current LUT set. If the data have not been initialized, this method will do so.

Returns:
the description of the current LUT set.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.

getAlgorithm

public static Stored_LUT.Best_Number_Algorithm getAlgorithm(String lutSet)
                                                     throws PVL_Exception,
                                                            FileNotFoundException,
                                                            Invalid_Argument_Exception
Gets the best-number algorithm for a named LUT set. If the data have not been initialized, this method will do so.

Returns:
the name of the best-number algorithm for the named LUT set.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.
Invalid_Argument_Exception - if lutSet is not a valid LUT set name.
See Also:
Stored_LUT.Best_Number_Algorithm, getBestLutNumber(HiRISE.HiPlan.HOGG.CCD_Histogram, HiRISE.HiPlan.HOGG.Stored_LUT.Algorithm_Options)

getAlgorithm

public static Stored_LUT.Best_Number_Algorithm getAlgorithm()
                                                     throws PVL_Exception,
                                                            FileNotFoundException
Gets the best-number algorithm of the current LUT set. If the data have not been initialized, this method will do so.

Returns:
the best-number algorithm of the current LUT set.
Throws:
PVL_Exception - if there is a problem with the stored LUT data.
FileNotFoundException - if the stored LUT data file cannot be found or read.
See Also:
Stored_LUT.Best_Number_Algorithm, getBestLutNumber(HiRISE.HiPlan.HOGG.CCD_Histogram, HiRISE.HiPlan.HOGG.Stored_LUT.Algorithm_Options)

getBestLutNumber

public static int getBestLutNumber(CCD_Histogram histogram,
                                   Stored_LUT.Algorithm_Options options)
Gets the best stored LUT number for the given input histogram and set of options. The best-number algorithms use the options as follows.

MIN_MAX_01: The fudge factor is a multiplier on the histogram's maximum. The CCD name is used to override the minimum value of the histogram.

MIN_MEAN_01: The fudge factor is a mutliplier on the histogram's mean. isOptimized() determines whether to optimized the LUT over the full range of 14-bit DNs. If true, only LUTs 0, 7, 14, or 21 will be returned. If false, LUTs 0, 7, 14, and 21 will not be returned. The CCD name is used to override the minimum value of the histogram.

Parameters:
histogram - the set of histogram data for which the best LUT number is to be chosen.
options - a set of algorithm-dependent options.
Returns:
the best stored LUT number according to the current algorithm.

getBestLutNumber

public static int getBestLutNumber(Histogram histogram,
                                   Stored_LUT.Algorithm_Options options)
Gets the best stored LUT number for the given input histogram and set of options. The best-number algorithms use the options as follows.

MIN_MAX_01: The fudge factor is a multiplier on the histogram's maximum. The CCD name is used to override the minimum value of the histogram.

MIN_MEAN_01: The fudge factor is a mutliplier on the histogram's mean. isOptimized() determines whether to optimized the LUT over the full range of 14-bit DNs. If true, only LUTs 0, 7, 14, or 21 will be returned. If false, LUTs 0, 7, 14, and 21 will not be returned. The CCD name is used to override the minimum value of the histogram.

Parameters:
histogram - the set of HIPHOP histogram data for which the best LUT number is to be chosen.
options - a set of algorithm-dependent options.
Returns:
the best stored LUT number according to the current algorithm.

isApplicableLut

public static boolean isApplicableLut(String ccd,
                                      int lut)

isApplicableLut

public static boolean isApplicableLut(String ccd,
                                      int lut,
                                      Stored_LUT.Best_Number_Algorithm algorithm)

HiRISE

Copyright (C) Arizona Board of Regents on behalf of the Planetary Image Research Laboratory, Lunar and Planetary Laboratory at the University of Arizona