public class CCD_Histogram
extends java.lang.Object
implements org.jfree.data.function.Function2D
The CCD response, DN14, in 14-bit data number to input signal in electron count is determined by an offset and a gain. In practice, the HiRISE calibration team measures inverse gain rather than gain, but the conversion is trivial.
A CCD_Histogram has a set of source_data, which are the 14-bit counts for a particular source CCD. The source CCD is described by a source_offset and source_inverse_gain.
The same data can be used to represent a different target CCD through the use of a target_offset and target_inverse_gain. Doing so only makes sense if one can assume that the same electron signal distribution is applied to the target CCD that was applied to the source CCD. This assumption is reasonable for HIPHOP modeling of CCDs with the same color filters; it is not reasonable for CCDs of differing color filters or for real Martian scenes. Consider, for example, the case in which the rightmost red CCD, RED0, images a bright surface while the leftmost red CCD, RED9, images a very dark surface. Clearly the two will receive very different electron signals, and thus RED0's data should not be used to represent RED9's histogram.
The 14-bit DN value for a CCD is given by the following equation:
DN14 = (signal / inverse gain) + offset
The original signal in electron count is thus the following:
signal = (DN14 - offset) * inverse gain
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CCD_DATA
The name of the aggregate (group)
Parameter under which all CCD data
are stored. |
static java.lang.String |
CCD_DATA_FILENAME
The name of the PVL file containing the CCD data.
|
static double |
DEFAULT_INVERSE_GAIN
The default inverse gain for the histogram.
|
static double |
DEFAULT_OFFSET
The default offset for the histogram.
|
static int |
DEFAULT_PIXELS
The default pixel count for the CCD image this histogram represents.
|
static java.lang.String |
ID
Class identification name with source code version and date.
|
static java.lang.String |
INVERSE_GAINS
The name of the
Parameter whose value is a set array of CCD inverse
gains. |
static int |
MAXIMUM_RANGE
The maximum value of the histogram's range.
|
static int |
MINIMUM_RANGE
The minimum value of the histogram's range.
|
static java.lang.String |
OFFSET
The name of the
Parameter whose value is the CCD offset. |
Constructor and Description |
---|
CCD_Histogram()
Creates a new CCD histogram.
|
CCD_Histogram(int pixels)
Creates a new CCD histogram given a number of pixels to represent.
|
CCD_Histogram(int mean,
int std,
double offset,
double inverse_gain,
int pixels)
Creates a new CCD histogram with a Gaussian distribution in signal, a CCD
offset, a CCD inverse gain, and the number of pixels to represent.
|
CCD_Histogram(PIRL.PVL.Parameter hiphop_data)
Creates a new CCD histogram given a HIPHOP CCD aggregate parameter.
|
CCD_Histogram(PIRL.PVL.Parameter hiphop_data,
double target_offset,
double target_inverse_gain) |
CCD_Histogram(PIRL.PVL.Parameter hiphop_data,
double target_offset,
double target_inverse_gain,
int pixels) |
CCD_Histogram(PIRL.PVL.Parameter hiphop_data,
int pixels)
Creates a new CCD histogram given a HIPHOP CCD aggregate parameter and
number of pixels to represent.
|
CCD_Histogram(PIRL.PVL.Parameter hiphop_data,
java.lang.String target_ccd_name) |
CCD_Histogram(PIRL.PVL.Parameter hiphop_data,
java.lang.String target_ccd_name,
int pixels) |
CCD_Histogram(short[] source_data)
Creates a new CCD histogram given a set of source data.
|
CCD_Histogram(short[] source_data,
int source_minimum)
Creates a new CCD histogram given a set of source data and a source minimum
value.
|
CCD_Histogram(short[] source_data,
int source_minimum,
double source_offset,
double source_inverse_gain,
double target_offset,
double target_inverse_gain,
int pixels)
Creates a new CCD histogram given a set of source data, a source minimum
value, source CCD properties, target CCD properties, and the number of
pixels to represent.
|
CCD_Histogram(short[] source_data,
int source_minimum,
double source_offset,
double source_inverse_gain,
int pixels)
Creates a new CCD histogram given a set of source data, a source minimum
value, source CCD properties, and the number of pixels to represent.
|
Modifier and Type | Method and Description |
---|---|
static double |
ccd_inverse_gain(java.lang.String ccd_name,
int binning) |
static double |
ccd_offset(java.lang.String ccd_name) |
double |
getValue(double x)
Returns the value of the function (y) for a given input (x).
|
double |
mean()
Gets the mean value of the target CCD histogram.
|
int |
pixels()
Gets the number of pixels represented by this histogram.
|
void |
pixels(int pixels)
Sets the number of pixels represented by this histogram.
|
double |
source_frequency(double source_dn) |
double |
source_inverse_gain()
Gets the CCD inverse gain for the source of this histogram data.
|
int |
source_maximum()
Gets the maximum DN14 value of this histogram.
|
int |
source_minimum()
Gets the minimum DN14 value of this histogram.
|
double |
source_offset()
Gets the CCD offset for the source of this histogram data.
|
double |
source_to_target_dn(double source_dn) |
double |
standard_deviation()
Gets the standard deviation of the target CCD histogram.
|
double |
target_frequency(double target_dn) |
double |
target_inverse_gain()
Gets the CCD inverse gain for the target detector represented by this
histogram.
|
void |
target_inverse_gain(double target_inverse_gain)
Sets the CCD inverse gain for the target detector represented by this
histogram.
|
int |
target_maximum() |
int |
target_minimum() |
double |
target_offset()
Gets the CCD offset for the target detector represented by this histogram.
|
void |
target_offset(double target_offset)
Sets the CCD offset for the target detector represented by this histogram.
|
double |
target_to_source_dn(double target_dn) |
public static final java.lang.String ID
public static final int MINIMUM_RANGE
public static final int MAXIMUM_RANGE
public static final int DEFAULT_PIXELS
public static final double DEFAULT_INVERSE_GAIN
public static final double DEFAULT_OFFSET
public static final java.lang.String CCD_DATA_FILENAME
Constants.RESOURCES_DIRECTORY
.public static final java.lang.String CCD_DATA
Parameter
under which all CCD data
are stored.public static final java.lang.String OFFSET
Parameter
whose value is the CCD offset.public static final java.lang.String INVERSE_GAINS
Parameter
whose value is a set array of CCD inverse
gains.public CCD_Histogram(short[] source_data, int source_minimum, double source_offset, double source_inverse_gain, double target_offset, double target_inverse_gain, int pixels)
source_data
- the source CCD histogram data.source_minimum
- the minimum 14-bit value in the histogram data; the
integer value of source_offset is used if this value is less
than 0.source_offset
- the CCD offset for the source of the histogram data;
DEFAULT_OFFSET
is used if this value is less than 0.source_inverse_gain
- the CCD inverse gain for the source of the
histogram data; DEFAULT_INVERSE_GAIN
is used if this value is
less than 1.target_offset
- the CCD offset for the target to be represented by
this CCD_Histogram; source_offset is used if this
value is less than 0.target_inverse_gain
- the CCD inverse gain for the target to be
represented by this CCD_Histogram; source_inverse_gain
is used if this value is less than 1.pixels
- the total number of pixels in the histogram; DEFAULT_PIXELS
is used if this value is less than 1.public CCD_Histogram(short[] source_data, int source_minimum, double source_offset, double source_inverse_gain, int pixels)
source_data
- the source CCD histogram data.source_minimum
- the minimum 14-bit value in the histogram data; the
integer value of source_offset is used if this value is less
than 0.source_offset
- the CCD offset for the source of the histogram data;
DEFAULT_OFFSET
is used if this value is less than 0.source_inverse_gain
- the CCD inverse gain for the source of the
histogram data; DEFAULT_INVERSE_GAIN
is used if this value is
less than 1.pixels
- the total number of pixels in the histogram; DEFAULT_PIXELS
is used if this value is less than 1.public CCD_Histogram(short[] source_data, int source_minimum)
source_data
- the source CCD histogram data.source_minimum
- the minimum 14-bit value in the histogram data; the
integer value of source_offset is used if this value is less
than 0.public CCD_Histogram(short[] source_data)
source_data
- the source CCD histogram data.public CCD_Histogram(PIRL.PVL.Parameter hiphop_data, int pixels) throws PIRL.PVL.PVL_Exception
Transfer_File_Parameters
for the HiRISE
CCDs. If it is not, a PVL_Exception
will be thrown.hiphop_data
- the HIPHOP histogram data.pixels
- the total number of pixels in the histogram; DEFAULT_PIXELS
is used if this value is less than 1.PIRL.PVL.PVL_Exception
- if the HIPHOP data parameter is not the right
format.public CCD_Histogram(PIRL.PVL.Parameter hiphop_data) throws PIRL.PVL.PVL_Exception
Transfer_File_Parameters
for the HiRISE CCDs. If it is not, a PVL_Exception
will be thrown.hiphop_data
- the HIPHOP histogram data.PIRL.PVL.PVL_Exception
- if the HIPHOP data parameter is not the right
format.public CCD_Histogram(PIRL.PVL.Parameter hiphop_data, java.lang.String target_ccd_name, int pixels) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
Invalid_Argument_Exception
public CCD_Histogram(PIRL.PVL.Parameter hiphop_data, java.lang.String target_ccd_name) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
Invalid_Argument_Exception
public CCD_Histogram(PIRL.PVL.Parameter hiphop_data, double target_offset, double target_inverse_gain, int pixels) throws PIRL.PVL.PVL_Exception
PIRL.PVL.PVL_Exception
public CCD_Histogram(PIRL.PVL.Parameter hiphop_data, double target_offset, double target_inverse_gain) throws PIRL.PVL.PVL_Exception
PIRL.PVL.PVL_Exception
public CCD_Histogram(int mean, int std, double offset, double inverse_gain, int pixels)
mean
- the mean value of the Gaussian distribution; a random value
is used if this value is less than 1.std
- the standard deviation of the Gaussian distribution; a random
value is used if this value is less than 1.offset
- the offset for the histogram data, for both the source CCD
and the target CCD; DEFAULT_OFFSET
is used if this value is
less than 0.inverse_gain
- the inverse gain for the histogram data, for both
the source CCD and the target CCD; DEFAULT_INVERSE_GAIN
is used
if this value is less than 1.pixels
- the total number of pixels in the histogram; DEFAULT_PIXELS
is used if this value is less than 1.public CCD_Histogram(int pixels)
pixels
- the total number of pixels in the histogram; DEFAULT_PIXELS
is used if this value is less than 1.public CCD_Histogram()
public double source_offset()
public double source_inverse_gain()
public int source_minimum()
Parameter
.
All DN14 values less than the minimum have a count of zero.
public int source_maximum()
All DN14 values greater than the maximum have a count of zero.
public double target_offset()
public void target_offset(double target_offset)
target_offset
- the new target CCD offset.public double target_inverse_gain()
public void target_inverse_gain(double target_inverse_gain)
target_inverse_gain
- the new target CCD inverse gain.public int target_minimum()
public int target_maximum()
public int pixels()
public void pixels(int pixels)
pixels
- the new total number of pixels in the histogram.public double mean()
public double standard_deviation()
public double getValue(double x)
target_offset
and target_inverse_gain
; the pixel count is thus that for the target CCD.
The function value is scaled such that the total area under the histogram
from target_minimum()
to target_maximum()
14-bit DN value,
equals the number of pixels
represented.
getValue
in interface org.jfree.data.function.Function2D
x
- the input x-value, a 14-bit pixel brightness for the target CCD.public double source_frequency(double source_dn)
public double target_frequency(double target_dn)
public double source_to_target_dn(double source_dn)
public double target_to_source_dn(double target_dn)
public static double ccd_offset(java.lang.String ccd_name) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
Invalid_Argument_Exception
public static double ccd_inverse_gain(java.lang.String ccd_name, int binning) throws PIRL.PVL.PVL_Exception, java.io.FileNotFoundException, Invalid_Argument_Exception
PIRL.PVL.PVL_Exception
java.io.FileNotFoundException
Invalid_Argument_Exception
Copyright \ (C) Arizona Board of Regents on behalf of the \ Planetary Image Research Laboratory, Lunar and \ Planetary Laboratory at the University of Arizona