94 void init(
const HiCalConf &conf) {
100 int samples =
ToInteger(prof(
"Samples"));
103 _BM =
loadCsv(
"DarkCurrent", conf, prof, samples);
104 _slope =
loadCsv(
"DarkSlope", conf, prof, 256);
105 _intercept =
loadCsv(
"DarkIntercept", conf, prof, 256);
117 double fpa_py_temp =
ToDouble(prof(
"FpaPositiveYTemperature"));
118 double fpa_my_temp =
ToDouble(prof(
"FpaNegativeYTemperature"));
119 double temp = (fpa_py_temp+fpa_my_temp) / 2.0;
123 smooth.Process(_slope);
124 _slope = smooth.ref();
126 smooth.Process(_intercept);
127 _intercept = smooth.ref();
130 for (
int i = 0 ; i < _slope.dim() ; i++) {
131 t_prof[i] = _intercept[i] + _slope[i] * temp;
134 _tempProf =
rebin(t_prof, samples);
139 double linetime =
ToDouble(prof(
"ScanExposureDuration"));
140 double scale = linetime * 1.0E-6 * (_bin*_bin) *
141 (20.0*103.0/89.0 + _tdi);
143 for (
int j = 0 ; j < samples ; j++) {
144 dc[j] = _BM[j] * scale *
HiTempEqn(_tempProf[j]) / baseT;
149 _data = smooth.ref();
153 for (
int i = 0 ; i <
_data.dim() ; i++ ) {
163 virtual void printOn(std::ostream &o)
const {
164 o <<
"# History = " <<
_history << std::endl;
166 o << std::setw(
_fmtWidth) <<
"DarkMatrix" 168 << std::setw(
_fmtWidth+1) <<
"ZeroDark\n";
170 for (
int i = 0 ; i <
_data.dim() ; i++) {
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:325
int _fmtWidth
Default field with of double.
Definition: Module.h:168
HiVector _data
Data vector.
Definition: Module.h:166
double HiTempEqn(const double temperature, const double napcm2=2.0, const double px=12.0)
Implements (classic) HiRISE temperature equation.
Definition: HiCalUtil.h:405
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:108
void clear()
Definition: HiCalTypes.h:78
ZeroDark(const HiCalConf &conf)
Definition: ZeroDark.h:67
HiHistory _history
Hierarchial component history.
Definition: Module.h:167
HiVector loadCsv(const QString &csvBase, const HiCalConf &conf, const DbProfile &prof, const int &elements=0)
Provide generic loading of CSV file for all modules.
Definition: Module.h:116
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:164
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:65
ZeroDark()
Definition: ZeroDark.h:66
QString formatDbl(const double &value) const
Properly format values that could be special pixels.
Definition: Module.h:184
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
Computes a complex dark subtraction component (ZeroDark module)
Definition: ZeroDark.h:62
int ToInteger(const T &value)
Helper function to convert values to Integers.
Definition: HiCalUtil.h:236
void Reset()
Reset all accumulators and counters to zero.
Definition: Statistics.cpp:126
Compute a low pass filter from a Module class content.
Definition: LowPassFilter.h:45
Module manages HiRISE calibration vectors from various sources.
Definition: Module.h:54
HiVector rebin(const HiVector &v, int n)
Rebins a vector to a different size.
Definition: HiCalUtil.h:430
double ToDouble(const T &value)
Helper function to convert values to doubles.
Definition: HiCalUtil.h:248
virtual ~ZeroDark()
Destructor.
Definition: ZeroDark.h:72
void add(const QString &event)
Definition: HiCalTypes.h:68
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
T ConfKey(const DbProfile &conf, const QString &keyname, const T &defval, int index=0)
Find a keyword in a profile using default for non-existant keywords.
Definition: HiCalUtil.h:219
QString Name() const
Returns the name of this property.
Definition: DbProfile.h:118
const Statistics & Stats() const
Return statistics for filtered - raw Buffer.
Definition: ZeroDark.h:79
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:154
QString ToString(const T &value)
Helper function to convert values to strings.
Definition: HiCalUtil.h:260
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:313
TNT::Array1D< double > HiVector
1-D Buffer
Definition: HiCalTypes.h:40