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
20namespace Isis {
21 class Cube;
22 class Pvl;
23
50 class MocLabels {
51 public:
52 MocLabels(Cube &cube);
53 MocLabels(const QString &file);
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
IO Handler for Isis Cubes.
Definition Cube.h:168
Read values from MOC labels.
Definition MocLabels.h:50
double ExposureDuration() const
Returns the value for LineExposureDuration from the instrument group.
Definition MocLabels.h:131
double Offset(int line=1)
Returns the offset at the given line.
Definition MocLabels.cpp:403
int CrosstrackSumming() const
Returns value for CrosstrackSumming from the instrument group.
Definition MocLabels.h:92
double FocalPlaneTemperature() const
Returns value for FocalPlaneTemperature from the instrument group.
Definition MocLabels.h:114
bool WideAngleBlue() const
Indicates whether the camera was blue wide angle.
Definition MocLabels.h:84
~MocLabels()
Empty destructor.
Definition MocLabels.h:55
int StartDetector(int sample) const
Converts from sample to starting detector.
Definition MocLabels.cpp:292
double EphemerisTime(double line) const
Returns the ephemeris time at the given line.
Definition MocLabels.cpp:375
bool NarrowAngle() const
Indicates whether the camera was narrow angle.
Definition MocLabels.h:61
MocLabels(Cube &cube)
Construct MocLabels object using a Pvl object.
Definition MocLabels.cpp:39
int FirstLineSample() const
Returns value for FirstLineSample from the instrument group.
Definition MocLabels.h:106
int Detectors() const
Returns 2048 if narrow angle and 3456 if wide angle.
Definition MocLabels.h:145
QString StartTime() const
Returns the value for StartTime from the instrument group.
Definition MocLabels.h:138
bool WideAngle() const
Indicates whether the camera was wide angle.
Definition MocLabels.h:68
double Sample(int detector) const
Converts from detector to sample.
Definition MocLabels.cpp:316
int DowntrackSumming() const
Returns value for DowntrackSumming from the instrument group.
Definition MocLabels.h:99
int EndDetector(int sample) const
Converts from sample to ending detector.
Definition MocLabels.cpp:304
double Gain(int line=1)
Returns the true gain at a given line.
Definition MocLabels.cpp:384
bool WideAngleRed() const
Indicates whether the camera was red wide angle.
Definition MocLabels.h:76
double LineRate() const
Returns the value for the true line rate.
Definition MocLabels.h:123
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16