File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
GainLineDrift.h
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 
25 namespace 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) {
59  _history.clear();
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
Isis::Module::_history
HiHistory _history
Hierarchial component history.
Definition: Module.h:152
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::Module
Module manages HiRISE calibration vectors from various sources.
Definition: Module.h:39
Isis::GainLineDrift
Computes a gain correction for each line (Zg Module)
Definition: GainLineDrift.h:40
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::GainLineDrift::~GainLineDrift
virtual ~GainLineDrift()
Destructor.
Definition: GainLineDrift.h:50
Isis::HiLineTimeEqn
Compute HiRISE line times.
Definition: HiCalUtil.h:361
Isis::ToInteger
int ToInteger(const T &value)
Helper function to convert values to Integers.
Definition: HiCalUtil.h:222
Isis::DbProfile
A DbProfile is a container for access parameters to a database.
Definition: DbProfile.h:51
Isis::HiVector
TNT::Array1D< double > HiVector
1-D Buffer
Definition: HiCalTypes.h:27
Isis::ToDouble
double ToDouble(const T &value)
Helper function to convert values to doubles.
Definition: HiCalUtil.h:234
Isis::CpmmToCcd
int CpmmToCcd(int cpmm)
Convert HiRISE Cpmm number to Ccd number.
Definition: HiCalUtil.h:71
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:29