Isis Developer Reference
MocLabels.h
Go to the documentation of this file.
1 #ifndef MocLabels_h
2 #define MocLabels_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <map>
13 #include <vector>
14 
15 #include <QString>
16 
17 #include "FileName.h"
18 
19 
20 namespace Isis {
21  class Cube;
22  class Pvl;
23 
50  class MocLabels {
51  public:
52  MocLabels(Cube &cube);
53  MocLabels(const QString &file);
55  ~MocLabels() {};
56 
61  inline bool NarrowAngle() const {
62  return p_mocNA;
63  };
68  inline bool WideAngle() const {
69  return !p_mocNA;
70  };
76  inline bool WideAngleRed() const {
77  return p_mocRedWA;
78  };
84  inline bool WideAngleBlue() const {
85  return p_mocBlueWA;
86  };
92  inline int CrosstrackSumming() const {
93  return p_crosstrackSumming;
94  };
99  inline int DowntrackSumming() const {
100  return p_downtrackSumming;
101  };
106  inline int FirstLineSample() const {
107  return p_startingSample;
108  };
114  inline double FocalPlaneTemperature() const {
115  return p_focalPlaneTemp;
116  };
123  inline double LineRate() const {
124  return p_trueLineRate;
125  };
131  inline double ExposureDuration() const {
132  return p_exposureDuration;
133  };
138  inline QString StartTime() const {
139  return p_startTime;
140  };
145  inline int Detectors() const {
146  return p_mocNA ? 2048 : 3456;
147  };
148  int StartDetector(int sample) const;
149  int EndDetector(int sample) const;
150  double Sample(int detector) const;
151  double EphemerisTime(double line) const;
152  double Gain(int line = 1);
153  double Offset(int line = 1);
154 
155  private:
156  void Init(Cube &cube);
157  void ReadLabels(Cube &cube);
158  void ValidateLabels();
159  void Compute();
160 
161  int p_crosstrackSumming;
162  int p_downtrackSumming;
163  int p_startingSample;
164  int p_orbitNumber;
165  double p_exposureDuration;
166  double p_trueLineRate;
167  double p_focalPlaneTemp;
168  bool p_mocNA;
169  bool p_mocRedWA;
170  bool p_mocBlueWA;
171  QString p_instrumentId;
172  QString p_filter;
173  QString p_clockCount;
174  QString p_gainModeId;
175  int p_offsetModeId;
176  QString p_startTime;
177  QString p_dataQuality;
178  double p_etStart;
179  double p_etEnd;
180 
181  void InitGainMaps();
182  std::map<QString, double> p_gainMapNA;
183  std::map<QString, double> p_gainMapWA;
184  double p_gain;
185  double p_offset;
186 
187  int p_nl;
188  int p_ns;
189  int p_startDetector[3456];
190  int p_endDetector[3456];
191  double p_sample[3456];
192  void InitDetectorMaps();
193 
194  struct WAGO {
195  double et;
196  double gain;
197  double offset;
198  inline bool operator<(const WAGO &w) const {
199  return (et < w.et);
200  };
201  inline bool operator==(const WAGO &w) const {
202  return (et == w.et);
203  };
204  };
205  std::vector<WAGO> p_wagos;
206  void InitWago();
207 
208  FileName p_lsk;
209  FileName p_sclk;
210  };
211 };
212 #endif
Isis::MocLabels::MocLabels
MocLabels(Cube &cube)
Construct MocLabels object using a Pvl object.
Definition: MocLabels.cpp:38
AlphaCube.h
Isis::MocLabels::~MocLabels
~MocLabels()
Empty destructor.
Definition: MocLabels.h:55
FileName.h
Cube.h
Isis::MocLabels::FirstLineSample
int FirstLineSample() const
Returns value for FirstLineSample from the instrument group.
Definition: MocLabels.h:106
mode13_table
static MOC_XTS_TABLE mode13_table[MOC_XTS_MODE_13]
Definition: mocxtrack.h:474
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::MocLabels::Offset
double Offset(int line=1)
Returns the offset at the given line.
Definition: MocLabels.cpp:402
Isis::MocLabels::DowntrackSumming
int DowntrackSumming() const
Returns value for DowntrackSumming from the instrument group.
Definition: MocLabels.h:99
Isis::MocLabels
Read values from MOC labels.
Definition: MocLabels.h:50
Isis::MocLabels::NarrowAngle
bool NarrowAngle() const
Indicates whether the camera was narrow angle.
Definition: MocLabels.h:61
Isis::MocLabels::CrosstrackSumming
int CrosstrackSumming() const
Returns value for CrosstrackSumming from the instrument group.
Definition: MocLabels.h:92
Isis::MocLabels::EphemerisTime
double EphemerisTime(double line) const
Returns the ephemeris time at the given line.
Definition: MocLabels.cpp:374
IString.h
Isis::MocLabels::FocalPlaneTemperature
double FocalPlaneTemperature() const
Returns value for FocalPlaneTemperature from the instrument group.
Definition: MocLabels.h:114
Isis::MocLabels::Sample
double Sample(int detector) const
Converts from detector to sample.
Definition: MocLabels.cpp:315
Isis::MocLabels::LineRate
double LineRate() const
Returns the value for the true line rate.
Definition: MocLabels.h:123
mode27_table
static MOC_XTS_TABLE mode27_table[MOC_XTS_MODE_27]
Definition: mocxtrack.h:83
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
MocLabels.h
TextFile.h
Isis::MocLabels::WideAngleRed
bool WideAngleRed() const
Indicates whether the camera was red wide angle.
Definition: MocLabels.h:76
Isis::MocLabels::StartTime
QString StartTime() const
Returns the value for StartTime from the instrument group.
Definition: MocLabels.h:138
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::MocLabels::WideAngleBlue
bool WideAngleBlue() const
Indicates whether the camera was blue wide angle.
Definition: MocLabels.h:84
IException.h
std
Namespace for the standard library.
Isis::MocLabels::Detectors
int Detectors() const
Returns 2048 if narrow angle and 3456 if wide angle.
Definition: MocLabels.h:145
Isis::MocLabels::EndDetector
int EndDetector(int sample) const
Converts from sample to ending detector.
Definition: MocLabels.cpp:303
mocxtrack.h
Isis::MocLabels::WideAngle
bool WideAngle() const
Indicates whether the camera was wide angle.
Definition: MocLabels.h:68
Isis::MocLabels::ExposureDuration
double ExposureDuration() const
Returns the value for LineExposureDuration from the instrument group.
Definition: MocLabels.h:131
iTime.h
Isis::MocLabels::StartDetector
int StartDetector(int sample) const
Converts from sample to starting detector.
Definition: MocLabels.cpp:291
Isis::MocLabels::Gain
double Gain(int line=1)
Returns the true gain at a given line.
Definition: MocLabels.cpp:383
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16