Isis Developer Reference
GainLineDrift.h
Go to the documentation of this file.
1#ifndef GainLineDrift_h
2#define GainLineDrift_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
23#include "IException.h"
24
25namespace Isis {
40 class GainLineDrift : public Module {
41
42 public:
43 // Constructors and Destructor
44 GainLineDrift() : Module("GainLineDrift") { }
45 GainLineDrift(const HiCalConf &conf) : Module("GainLineDrift") {
46 init(conf);
47 }
48
50 virtual ~GainLineDrift() { }
51
52 private:
53 std::string _gdfile;
54 int _ccd;
55 int _channel;
56 HiVector _coefs;
57
58 void init(const HiCalConf &conf) {
60 DbProfile prof = conf.getMatrixProfile();
61 _history.add("Profile["+ prof.Name()+"]");
62 _ccd = CpmmToCcd(ToInteger(prof("CpmmNumber")));
63 _channel = ToInteger(prof("ChannelNumber"));
64
65 // Get parameters from gainVline coefficients file
66 _coefs = loadCsv("LineGainDrift", conf, prof, 4);
67 _history.add("Coefs["+ToString(_coefs[0])+ ","+
68 ToString(_coefs[1])+ ","+
69 ToString(_coefs[2])+ ","+
70 ToString(_coefs[3])+ "]");
71
72 int bin = ToInteger(prof("Summing"));
73 double linetime = ToDouble(prof("ScanExposureDuration"));
74 HiLineTimeEqn timet(bin, linetime);
75 int nlines = ToInteger(prof("Lines"));
76
77 HiVector gainV(nlines);
78 for ( int i = 0 ; i < nlines ; i++ ) {
79 double lt = timet(i);
80 gainV[i] = _coefs[0] + (_coefs[1] * lt) +
81 _coefs[2] * exp(_coefs[3] * lt);
82 }
83
84 _data = gainV;
85 return;
86 }
87
88 };
89
90} // namespace Isis
91#endif
A DbProfile is a container for access parameters to a database.
Definition DbProfile.h:51
Computes a gain correction for each line (Zg Module)
Definition GainLineDrift.h:40
GainLineDrift()
Definition GainLineDrift.h:44
virtual ~GainLineDrift()
Destructor.
Definition GainLineDrift.h:50
GainLineDrift(const HiCalConf &conf)
Definition GainLineDrift.h:45
void clear()
Definition HiCalTypes.h:65
void add(const QString &event)
Definition HiCalTypes.h:55
Compute HiRISE line times.
Definition HiCalUtil.h:361
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 is free and unencumbered software released into the public domain.
Definition Apollo.h:16
int CpmmToCcd(int cpmm)
Convert HiRISE Cpmm number to Ccd number.
Definition HiCalUtil.h:71
TNT::Array1D< double > HiVector
1-D Buffer
Definition HiCalTypes.h:27
QString ToString(const T &value)
Helper function to convert values to strings.
Definition HiCalUtil.h:246
double ToDouble(const T &value)
Helper function to convert values to doubles.
Definition HiCalUtil.h:234
int ToInteger(const T &value)
Helper function to convert values to Integers.
Definition HiCalUtil.h:222