Isis Developer Reference
GainFlatField.h
Go to the documentation of this file.
1 #ifndef GainFlatField_h
2 #define GainFlatField_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <cmath>
13 #include <string>
14 #include <vector>
15 
16 #include "IString.h"
17 #include "HiCalTypes.h"
18 #include "HiCalUtil.h"
19 #include "HiCalConf.h"
20 #include "Module.h"
21 #include "FileName.h"
22 #include "Statistics.h"
23 #include "IException.h"
24 
25 namespace Isis {
26 
41  class GainFlatField : public Module {
42 
43  public:
44  // Constructors and Destructor
45  GainFlatField() : Module("GainFlatField") { }
46  GainFlatField(const HiCalConf &conf) : Module("GainFlatField") {
47  init(conf);
48  }
49 
51  virtual ~GainFlatField() { }
52 
58  const Statistics &Stats() const { return (_stats); }
59 
60  private:
61  std::string _amatrix;
62  Statistics _stats; // Stats Results
63 
64  void init(const HiCalConf &conf) {
65  _history.clear();
66  DbProfile prof = conf.getMatrixProfile();
67  _history.add("Profile["+ prof.Name()+"]");
68  int nsamps = ToInteger(prof("Samples"));
69 
70  // Get parameters from A-Matrix coefficients file
71  _data = loadCsv("Flats", conf, prof, nsamps);
72  _stats.Reset();
73  for ( int i = 0 ; i < _data.dim() ; i++ ) {
74  _stats.AddData(_data[i]);
75  }
76 
77  _history.add("Statistics(Average["+ToString(_stats.Average())+
78  "],StdDev["+ToString(_stats.StandardDeviation())+"])");
79  return;
80  }
81 
82  };
83 
84 } // namespace Isis
85 #endif
Isis::Module::_history
HiHistory _history
Hierarchial component history.
Definition: Module.h:152
Isis::HiHistory::clear
void clear()
Definition: HiCalTypes.h:65
FileName.h
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::Statistics::AddData
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition: Statistics.cpp:141
Isis::DbProfile::Name
QString Name() const
Returns the name of this property.
Definition: DbProfile.h:104
Isis::ToString
QString ToString(const T &value)
Helper function to convert values to strings.
Definition: HiCalUtil.h:246
Isis::GainFlatField
GainFlatField Module - Computes flat field correction for sample.
Definition: GainFlatField.h:41
Isis::Module
Module manages HiRISE calibration vectors from various sources.
Definition: Module.h:39
HiCalConf.h
Isis::Statistics::Reset
void Reset()
Reset all accumulators and counters to zero.
Definition: Statistics.cpp:113
IString.h
Isis::Module::_data
HiVector _data
Data vector.
Definition: Module.h:151
Isis::Module::loadCsv
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:101
Isis::GainFlatField::~GainFlatField
virtual ~GainFlatField()
Destructor.
Definition: GainFlatField.h:51
Isis::GainFlatField::GainFlatField
GainFlatField()
Definition: GainFlatField.h:45
Isis::Statistics::StandardDeviation
double StandardDeviation() const
Computes and returns the standard deviation.
Definition: Statistics.cpp:312
Isis::ToInteger
int ToInteger(const T &value)
Helper function to convert values to Integers.
Definition: HiCalUtil.h:222
HiCalUtil.h
Isis::DbProfile
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:51
HiCalTypes.h
Isis::HiHistory::add
void add(const QString &event)
Definition: HiCalTypes.h:55
Isis::Statistics::Average
double Average() const
Computes and returns the average.
Definition: Statistics.cpp:300
Statistics.h
IException.h
Module.h
Isis::GainFlatField::GainFlatField
GainFlatField(const HiCalConf &conf)
Definition: GainFlatField.h:46
Isis::GainFlatField::Stats
const Statistics & Stats() const
Return statistics A matrix corection.
Definition: GainFlatField.h:58
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16