20#include "HiCalTypes.h"
24#include "SplineFill.h"
25#include "Statistics.h"
26#include "SpecialPixel.h"
27#include "IException.h"
46 class ZeroReverse :
public Module {
50 ZeroReverse() : Module(
"ZeroReverse") { }
51 ZeroReverse(
HiCalData &cal,
const HiCalConf &conf) :
52 Module(
"ZeroReverse") {
96 int line0 =
toInt(
ConfKey(prof,
"ZeroReverseFirstLine",QString(
"0")));
97 int lineN =
toInt(
ConfKey(prof,
"ZeroReverseLastLine",QString(
"19")));
98 QString tfile= conf.getMatrixSource(
"ReverseClockStatistics",prof);
102 _stats.AddData(revclk[0], revclk.dim1()*revclk.dim2());
106 "],Mean["+
ToString(_stats.Average()) +
107 "],StdDev["+
ToString(_stats.StandardDeviation()) +
108 "],LisPixels["+
ToString(_stats.LisPixels())+
109 "],HisPixels["+
ToString(_stats.HisPixels()) +
110 "],NulPixels["+
ToString(_stats.NullPixels())+
"])");
112 DbAccess triggers(
Pvl(tfile).findObject(
"ReverseClockStatistics"));
113 QString tprofName = conf.resolve(
"{FILTER}{CCD}_{CHANNEL}_{BIN}",prof);
114 _history.add(
"ReverseClockStatistics(File["+tfile+
115 "],Profile["+tprofName+
"])");
127 "],RevStdDevTrigger["+
ToString(revstddev)+
128 "],RevLisTolerance["+
ToString(lisTol)+
129 "],RevHisTolerance["+
ToString(hisTol)+
130 "],RevNulTolerance["+
ToString(nulTol)+
"])");
132 if ((_stats.LisPixels() > lisTol) || (_stats.HisPixels() > hisTol) ||
133 (_stats.NullPixels() > nulTol) ||
134 (_stats.StandardDeviation() > revstddev)) {
137 _history.add(
"Trigger(True - Reverse Clock set to constant,"
138 "ReverseClock["+
ToString(revmean)+
"])");
141 _history.add(
"Trigger(False - Reverse Clock processing invoked)");
146 _history.add(
"Trigger(Profile["+tprofName+
"],NotFound!)");
161 o <<
"# History = " <<
_history << std::endl;
164 << std::setw(
_fmtWidth+1) <<
"Applied\n";
166 for (
int i = 0 ; i <
_data.dim() ; i++) {
46 class ZeroReverse :
public Module {
…};
DbAccess manages programatic access to a database through profiles.
const DbProfile getProfile(const QString &name="") const
Retrieves the specified access profile.
bool profileExists(const QString &profile) const
Checks existance of a database user profile.
A DbProfile is a container for access parameters to a database.
QString Name() const
Returns the name of this property.
Container for HiRISE calibration data.
HiVector _data
Data vector.
HiHistory _history
Hierarchial component history.
const HiVector & ref() const
Return data via a const reference.
int _fmtWidth
Default field with of double.
const HiHistory & History() const
Return recorded history of events.
QString formatDbl(const double &value) const
Properly format values that could be special pixels.
Container for cube-like labels.
Compute a low pass filter from a Module class content.
This class is used to accumulate statistics on double arrays.
virtual ~ZeroReverse()
Destructor.
void init(HiCalData &cal, const HiCalConf &conf)
Initialize and compute data solution.
bool wasTriggered() const
Specifies if the input trigger conditions were met.
virtual void printOn(std::ostream &o) const
Virtual dump of data processing vectors.
const Statistics & Stats() const
Return statistics for raw Reverse Clock buffer.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
int toInt(const QString &string)
Global function to convert from a string to an integer.
TNT::Array2D< double > HiMatrix
2-D buffer
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.
TNT::Array1D< double > HiVector
1-D Buffer
QString ToString(const T &value)
Helper function to convert values to strings.
HiVector averageLines(const HiMatrix &m, int sline=0, int eline=-1)
Reduces by averaging specified lines from a buffer.
double toDouble(const QString &string)
Global function to convert from a string to a double.
HiMatrix cropLines(const HiMatrix &m, int sline, int eline)
Crop specified lines from a buffer.