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
25namespace 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) {
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
A DbProfile is a container for access parameters to a database.
Definition DbProfile.h:51
GainFlatField Module - Computes flat field correction for sample.
Definition GainFlatField.h:41
const Statistics & Stats() const
Return statistics A matrix corection.
Definition GainFlatField.h:58
GainFlatField()
Definition GainFlatField.h:45
GainFlatField(const HiCalConf &conf)
Definition GainFlatField.h:46
virtual ~GainFlatField()
Destructor.
Definition GainFlatField.h:51
void clear()
Definition HiCalTypes.h:65
void add(const QString &event)
Definition HiCalTypes.h:55
Module manages HiRISE calibration vectors from various sources.
Definition Module.h:39
HiVector _data
Data vector.
Definition Module.h:151
HiHistory _history
Hierarchial component history.
Definition Module.h:152
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
This class is used to accumulate statistics on double arrays.
Definition Statistics.h:94
double Average() const
Computes and returns the average.
Definition Statistics.cpp:300
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
Definition Statistics.cpp:141
double StandardDeviation() const
Computes and returns the standard deviation.
Definition Statistics.cpp:312
void Reset()
Reset all accumulators and counters to zero.
Definition Statistics.cpp:113
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString ToString(const T &value)
Helper function to convert values to strings.
Definition HiCalUtil.h:246
int ToInteger(const T &value)
Helper function to convert values to Integers.
Definition HiCalUtil.h:222