Isis 3 Programmer Reference
MocLabels.h
Go to the documentation of this file.
1 #ifndef MocLabels_h
2 #define MocLabels_h
3 
25 #include <map>
26 #include <vector>
27 
28 #include <QString>
29 
30 #include "FileName.h"
31 
32 
33 namespace Isis {
34  class Cube;
35  class Pvl;
36 
63  class MocLabels {
64  public:
65  MocLabels(Cube &cube);
66  MocLabels(const QString &file);
68  ~MocLabels() {};
69 
74  inline bool NarrowAngle() const {
75  return p_mocNA;
76  };
81  inline bool WideAngle() const {
82  return !p_mocNA;
83  };
89  inline bool WideAngleRed() const {
90  return p_mocRedWA;
91  };
97  inline bool WideAngleBlue() const {
98  return p_mocBlueWA;
99  };
105  inline int CrosstrackSumming() const {
106  return p_crosstrackSumming;
107  };
112  inline int DowntrackSumming() const {
113  return p_downtrackSumming;
114  };
119  inline int FirstLineSample() const {
120  return p_startingSample;
121  };
127  inline double FocalPlaneTemperature() const {
128  return p_focalPlaneTemp;
129  };
136  inline double LineRate() const {
137  return p_trueLineRate;
138  };
144  inline double ExposureDuration() const {
145  return p_exposureDuration;
146  };
151  inline QString StartTime() const {
152  return p_startTime;
153  };
158  inline int Detectors() const {
159  return p_mocNA ? 2048 : 3456;
160  };
161  int StartDetector(int sample) const;
162  int EndDetector(int sample) const;
163  double Sample(int detector) const;
164  double EphemerisTime(double line) const;
165  double Gain(int line = 1);
166  double Offset(int line = 1);
167 
168  private:
169  void Init(Cube &cube);
170  void ReadLabels(Cube &cube);
171  void ValidateLabels();
172  void Compute();
173 
174  int p_crosstrackSumming;
175  int p_downtrackSumming;
176  int p_startingSample;
177  int p_orbitNumber;
178  double p_exposureDuration;
179  double p_trueLineRate;
180  double p_focalPlaneTemp;
181  bool p_mocNA;
182  bool p_mocRedWA;
183  bool p_mocBlueWA;
184  QString p_instrumentId;
185  QString p_filter;
186  QString p_clockCount;
187  QString p_gainModeId;
188  int p_offsetModeId;
189  QString p_startTime;
190  QString p_dataQuality;
191  double p_etStart;
192  double p_etEnd;
193 
194  void InitGainMaps();
195  std::map<QString, double> p_gainMapNA;
196  std::map<QString, double> p_gainMapWA;
197  double p_gain;
198  double p_offset;
199 
200  int p_nl;
201  int p_ns;
202  int p_startDetector[3456];
203  int p_endDetector[3456];
204  double p_sample[3456];
205  void InitDetectorMaps();
206 
207  struct WAGO {
208  double et;
209  double gain;
210  double offset;
211  inline bool operator<(const WAGO &w) const {
212  return (et < w.et);
213  };
214  inline bool operator==(const WAGO &w) const {
215  return (et == w.et);
216  };
217  };
218  std::vector<WAGO> p_wagos;
219  void InitWago();
220 
221  FileName p_lsk;
222  FileName p_sclk;
223  };
224 };
225 #endif
int CrosstrackSumming() const
Returns value for CrosstrackSumming from the instrument group.
Definition: MocLabels.h:105
void InitDetectorMaps()
Creates lookup table from sample to detectors and vice versa.
Definition: MocLabels.cpp:317
int FirstLineSample() const
Returns value for FirstLineSample from the instrument group.
Definition: MocLabels.h:119
int DowntrackSumming() const
Returns value for DowntrackSumming from the instrument group.
Definition: MocLabels.h:112
File name manipulation and expansion.
Definition: FileName.h:116
void InitGainMaps()
Creates a lookup of gain modes to gain values.
Definition: MocLabels.cpp:238
bool NarrowAngle() const
Indicates whether the camera was narrow angle.
Definition: MocLabels.h:74
void Init(Cube &cube)
General initializer.
Definition: MocLabels.cpp:38
int EndDetector(int sample) const
Converts from sample to ending detector.
Definition: MocLabels.cpp:295
bool WideAngleBlue() const
Indicates whether the camera was blue wide angle.
Definition: MocLabels.h:97
int Detectors() const
Returns 2048 if narrow angle and 3456 if wide angle.
Definition: MocLabels.h:158
double EphemerisTime(double line) const
Returns the ephemeris time at the given line.
Definition: MocLabels.cpp:366
double LineRate() const
Returns the value for the true line rate.
Definition: MocLabels.h:136
QString StartTime() const
Returns the value for StartTime from the instrument group.
Definition: MocLabels.h:151
void Compute()
Computes some constants.
Definition: MocLabels.cpp:152
double FocalPlaneTemperature() const
Returns value for FocalPlaneTemperature from the instrument group.
Definition: MocLabels.h:127
void ReadLabels(Cube &cube)
Reads required keywords from the labels.
Definition: MocLabels.cpp:56
double Offset(int line=1)
Returns the offset at the given line.
Definition: MocLabels.cpp:394
void InitWago()
Reads the wide-angle gain/offset table and internalizes.
Definition: MocLabels.cpp:415
bool WideAngleRed() const
Indicates whether the camera was red wide angle.
Definition: MocLabels.h:89
~MocLabels()
Empty destructor.
Definition: MocLabels.h:68
int StartDetector(int sample) const
Converts from sample to starting detector.
Definition: MocLabels.cpp:283
double Gain(int line=1)
Returns the true gain at a given line.
Definition: MocLabels.cpp:375
void ValidateLabels()
Verifies that the labels are valid.
Definition: MocLabels.cpp:101
MocLabels(Cube &cube)
Construct MocLabels object using a Pvl object.
Definition: MocLabels.cpp:30
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
Read values from MOC labels.
Definition: MocLabels.h:63
bool WideAngle() const
Indicates whether the camera was wide angle.
Definition: MocLabels.h:81
double Sample(int detector) const
Converts from detector to sample.
Definition: MocLabels.cpp:307
IO Handler for Isis Cubes.
Definition: Cube.h:170
double ExposureDuration() const
Returns the value for LineExposureDuration from the instrument group.
Definition: MocLabels.h:144