public class Stored_LUT
extends java.lang.Object
implements org.jfree.data.function.Function2D
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.
(Insert algorithm details here.)
Modifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.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 java.lang.String |
DESCRIPTION
The name of the
Parameter whose value is a description of the set of
stored LUTs. |
static java.lang.String |
DN14
The name of the
Parameter whose value is a sequence array of 14-bit
data numbers. |
static java.lang.String |
DN8
The name of the
Parameter whose value is a sequence array of 8-bit
data numbers. |
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String |
LUT_PREFIX
The prefix used to name a particular LUT.
|
static java.lang.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 java.lang.String |
STORED_LUTS
The name of the aggregate (group)
Parameter under which all stored
LUT data are enclosed. |
static java.lang.String |
STORED_LUTS_FILENAME
The name of the PVL file containing the stored LUT data.
|
Constructor and Description |
---|
Stored_LUT() |
Stored_LUT(int lutNumber) |
Modifier and Type | Method and Description |
---|---|
static Stored_LUT.Best_Number_Algorithm |
getAlgorithm()
Gets the best-number algorithm of the current LUT set.
|
static Stored_LUT.Best_Number_Algorithm |
getAlgorithm(java.lang.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 java.lang.String |
getDescription()
Gets the description of the current LUT set.
|
static java.lang.String |
getDescription(java.lang.String lutSet)
Gets the description of a named LUT set.
|
int |
getLutNumber() |
static java.lang.String |
getLutSet()
Gets the name of the current stored LUT set.
|
static java.util.List<java.lang.String> |
getLutSets()
Gets the list of all stored LUT set names.
|
double |
getValue(double x) |
static boolean |
isApplicableLut(java.lang.String ccd,
int lut) |
static boolean |
isApplicableLut(java.lang.String ccd,
int lut,
Stored_LUT.Best_Number_Algorithm algorithm) |
void |
setLutNumber(int lutNumber) |
static void |
setLutSet(java.lang.String lutSet)
Configures the Stored_LUT class to use the named stored LUT set for
all operations.
|
public static final java.lang.String ID
public static final int MINIMUM_14_BIT_VALUE
MINIMUM_8_BIT_VALUE
.public static final int MAXIMUM_14_BIT_VALUE
MAXIMUM_8_BIT_VALUE
.public static final int MINIMUM_8_BIT_VALUE
public static final int MAXIMUM_8_BIT_VALUE
public static final int MINIMUM_LUT_NUMBER
public static final int MAXIMUM_LUT_NUMBER
public static final int DEFAULT_LUT_NUMBER
public static final java.lang.String STORED_LUTS_FILENAME
Constants.RESOURCES_DIRECTORY
.public static final java.lang.String LUT_SET
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.public static final java.lang.String STORED_LUTS
Parameter
under which all stored
LUT data are enclosed.public static final java.lang.String LUT_PREFIX
public static final java.lang.String DN14
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.DN8
,
Constant Field Valuespublic static final java.lang.String DN8
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.DN14
,
Constant Field Valuespublic static final java.lang.String ALGORITHM
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()
.
public static final java.lang.String DESCRIPTION
Parameter
whose value is a description of the set of
stored LUTs.public Stored_LUT(int lutNumber) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
public Stored_LUT() throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
public int getLutNumber()
public void setLutNumber(int lutNumber)
public double getValue(double x)
getValue
in interface org.jfree.data.function.Function2D
public static java.lang.String getLutSet() throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.public static void setLutSet(java.lang.String lutSet) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
lutSet
- the name of the stored LUT set to use.PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.Invalid_Argument_Exception
- if lutSet is not a valid LUT
set name.public static java.util.List<java.lang.String> getLutSets() throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.public static java.lang.String getDescription(java.lang.String lutSet) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.Invalid_Argument_Exception
- if lutSet is not a valid LUT
set name.public static java.lang.String getDescription() throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.public static Stored_LUT.Best_Number_Algorithm getAlgorithm(java.lang.String lutSet) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.Invalid_Argument_Exception
- if lutSet is not a valid LUT
set name.Stored_LUT.Best_Number_Algorithm
,
getBestLutNumber(HiRISE.HiPlan.HOGG.CCD_Histogram, HiRISE.HiPlan.HOGG.Stored_LUT.Algorithm_Options)
public static Stored_LUT.Best_Number_Algorithm getAlgorithm() throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException
PIRL.PVL.PVL_Exception
- if there is a problem with the stored LUT data.java.io.FileNotFoundException
- if the stored LUT data file cannot be found
or read.Stored_LUT.Best_Number_Algorithm
,
getBestLutNumber(HiRISE.HiPlan.HOGG.CCD_Histogram, HiRISE.HiPlan.HOGG.Stored_LUT.Algorithm_Options)
public static int getBestLutNumber(CCD_Histogram histogram, Stored_LUT.Algorithm_Options options)
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.
histogram
- the set of histogram data for which the best LUT number
is to be chosen.options
- a set of algorithm-dependent options.public static int getBestLutNumber(Histogram histogram, Stored_LUT.Algorithm_Options options)
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.
histogram
- the set of HIPHOP histogram data for which the best LUT
number is to be chosen.options
- a set of algorithm-dependent options.public static boolean isApplicableLut(java.lang.String ccd, int lut)
public static boolean isApplicableLut(java.lang.String ccd, int lut, Stored_LUT.Best_Number_Algorithm algorithm)
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona