Isis 3 Programmer Reference
GainFlatField.h
Go to the documentation of this file.
1 #ifndef GainFlatField_h
2 #define GainFlatField_h
3 
26 #include <cmath>
27 #include <string>
28 #include <vector>
29 
30 #include "IString.h"
31 #include "HiCalTypes.h"
32 #include "HiCalUtil.h"
33 #include "HiCalConf.h"
34 #include "Module.h"
35 #include "FileName.h"
36 #include "Statistics.h"
37 #include "IException.h"
38 
39 namespace Isis {
40 
55  class GainFlatField : public Module {
56 
57  public:
58  // Constructors and Destructor
59  GainFlatField() : Module("GainFlatField") { }
60  GainFlatField(const HiCalConf &conf) : Module("GainFlatField") {
61  init(conf);
62  }
63 
65  virtual ~GainFlatField() { }
66 
72  const Statistics &Stats() const { return (_stats); }
73 
74  private:
75  std::string _amatrix;
76  Statistics _stats; // Stats Results
77 
78  void init(const HiCalConf &conf) {
79  _history.clear();
80  DbProfile prof = conf.getMatrixProfile();
81  _history.add("Profile["+ prof.Name()+"]");
82  int nsamps = ToInteger(prof("Samples"));
83 
84  // Get parameters from A-Matrix coefficients file
85  _data = loadCsv("Flats", conf, prof, nsamps);
86  _stats.Reset();
87  for ( int i = 0 ; i < _data.dim() ; i++ ) {
88  _stats.AddData(_data[i]);
89  }
90 
91  _history.add("Statistics(Average["+ToString(_stats.Average())+
92  "],StdDev["+ToString(_stats.StandardDeviation())+"])");
93  return;
94  }
95 
96  };
97 
98 } // namespace Isis
99 #endif
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:325
HiVector _data
Data vector.
Definition: Module.h:166
const Statistics & Stats() const
Return statistics A matrix corection.
Definition: GainFlatField.h:72
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
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:65
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
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
Module manages HiRISE calibration vectors from various sources.
Definition: Module.h:54
virtual ~GainFlatField()
Destructor.
Definition: GainFlatField.h:65
GainFlatField Module - Computes flat field correction for sample.
Definition: GainFlatField.h:55
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QString Name() const
Returns the name of this property.
Definition: DbProfile.h:118
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