Isis 3 Programmer Reference
Apollo.h
Go to the documentation of this file.
1 #ifndef Apollo_h
2 #define Apollo_h
3 
27 #include "iTime.h"
28 #include "IString.h"
29 #include "IException.h"
30 
31 namespace Isis {
44  class Apollo {
45  public:
46 
55  Apollo (QString spacecraft, QString instrument) {
56  initialize(spacecraft.toUpper(), instrument.toUpper());
57  };
58 
59 
68  Apollo(QString filename) {
69  QString spacecraft, instrument;
70  if (filename.mid(0,4) == "AS15") spacecraft = "APOLLO 15";
71  else if (filename.mid(0,4) == "AS16") spacecraft = "APOLLO 16";
72  else if (filename.mid(0,4) == "AS17") spacecraft = "APOLLO 17";
73  // throw an error
74  else {
75  QString msg = "The image filename does not match the required formatting.";
77  }
78 
79  if (filename.mid(5,1) == "M") instrument = "METRIC";
80  else if (filename.mid(5,1) == "P") instrument = "PANORAMIC";
81  else if (filename.mid(5,1) == "H") instrument = "HASSELBLAD";
82  // throw an error
83  else {
84  QString msg = "The image filename does not match the required formatting.";
86  }
87 
88  initialize(spacecraft, instrument);
89  };
90 
91 
93  ~Apollo () {};
94 
100  bool IsMetric () {return p_instrumentId == "METRIC";}
101 
102 
108  bool IsPanoramic () {return p_instrumentId == "PANORAMIC";}
109 
110 
116  bool IsHasselblad () {return p_instrumentId == "HASSELBLAD";}
117 
118 
124  bool IsApollo15 () {return p_spacecraftName == "APOLLO 15";}
125 
126 
132  bool IsApollo16 () {return p_spacecraftName == "APOLLO 16";}
133 
134 
140  bool IsApollo17 () {return p_spacecraftName == "APOLLO 17";}
141 
142 
151  int Width () {return p_imageWidth;};
152 
153 
162  int Height () {return p_imageHeight;};
163 
164 
173  int Bands () { return p_imageBands;};
174 
175 
185 
186 
195  double PixelPitch () {return p_imagePixelPitch;};
196 
197 
203  QString SpacecraftName () {return p_spacecraftName;};
204 
205 
211  QString InstrumentId () {return p_instrumentId;};
212 
213 
222  QString NaifFrameCode () {return p_naifFrameCode;};
223 
224 
230  QString TargetName () {return "MOON";};
231 
232 
242 
243  private:
244 
256  void initialize(QString spacecraft, QString instrument) {
257  if (instrument == "METRIC") {
258  p_instrumentId = "METRIC";
259  p_reseauDimension = 403;
260  p_imageWidth = 22900;
261  p_imageHeight = 22900;
262  p_imageBands = 1;
263  p_imagePixelPitch = 200.5;
264  }
265  else if (instrument == "PANORAMIC") {
266  p_instrumentId = "PANORAMIC";
267  p_reseauDimension = 0;
268  p_imageWidth = 231480; // 228987
269  p_imageHeight = 23007;
270  p_imageBands = 1;
271  p_imagePixelPitch = 200.5;
272  }
273  else if (instrument == "HASSELBLAD") {
274  p_instrumentId = "HASSELBLAD";
275  p_reseauDimension = 403;
276  p_imageWidth = 12800;
277  p_imageHeight = 12800;
278  p_imageBands = 3;
279  p_imagePixelPitch = 200.5;
280  }
281  else {
282  QString msg = "Unknown instrument: " + instrument;
284  }
285 
286  if (spacecraft == "APOLLO 15" ){
287  p_spacecraftName = "APOLLO 15";
288  // Apollo 15 launched 1971-07-26 at 13:34 GMT
289  p_launchDate = "1971-07-26T13:33:39.11";
290  if (IsMetric()) p_naifFrameCode = "-915240";
291  else if (IsPanoramic()) p_naifFrameCode = "-915230";
292  }
293  else if (spacecraft == "APOLLO 16") {
294  p_spacecraftName = "APOLLO 16";
295  // Apollo 16 launched 1972-04-16 at 17:54 GMT
296  p_launchDate = "1972-04-16T17:53:36.238";
297  if (IsMetric()) p_naifFrameCode = "-916240";
298  else if (IsPanoramic()) p_naifFrameCode = "-916230";
299  }
300  else if (spacecraft == "APOLLO 17") {
301  p_spacecraftName = "APOLLO 17";
302  // Apollo 17 launched 1972-12-07 at 05:33 GMT
303  p_launchDate = "1972-12-07T05:33:00.000";
304  if (IsMetric()) p_naifFrameCode = "-917240";
305  else if (IsPanoramic()) p_naifFrameCode = "-917230";
306  }
307  else {
308  QString msg = "Unknown spacecraft: " + spacecraft;
310  }
311  }
312 
313 
320  QString p_instrumentId;
321  QString p_naifFrameCode;
323  };
324 };
325 
326 #endif
QString p_spacecraftName
Spacecraft name.
Definition: Apollo.h:319
Parse and return pieces of a time string.
Definition: iTime.h:78
bool IsApollo17()
Checks if the spacecraft is Apollo 17.
Definition: Apollo.h:140
QString InstrumentId()
Returns the instrument ID.
Definition: Apollo.h:211
Apollo(QString filename)
Constructor.
Definition: Apollo.h:68
bool IsHasselblad()
Checks if the instrument is an Apollo Hasselblad camera.
Definition: Apollo.h:116
double PixelPitch()
Returns pixel pitch for the image.
Definition: Apollo.h:195
int p_imageWidth
Image width.
Definition: Apollo.h:314
QString SpacecraftName()
Returns the spacecraft name.
Definition: Apollo.h:203
Apollo(QString spacecraft, QString instrument)
Constructor.
Definition: Apollo.h:55
QString NaifFrameCode()
Returns the NAIF frame code.
Definition: Apollo.h:222
int Width()
Returns the width of the image.
Definition: Apollo.h:151
bool IsApollo15()
Checks if the spacecraft is Apollo 15.
Definition: Apollo.h:124
~Apollo()
Destroys the Apollo object.
Definition: Apollo.h:93
double p_imagePixelPitch
Pixel pitch.
Definition: Apollo.h:318
iTime p_launchDate
Mission launch date.
Definition: Apollo.h:322
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
A type of error that could only have occurred due to a mistake on the user's part (e...
Definition: IException.h:142
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:134
int p_imageHeight
Image height.
Definition: Apollo.h:315
int Height()
Returns the height of the image.
Definition: Apollo.h:162
int Bands()
Returns number of bands in the image.
Definition: Apollo.h:173
Reads user Apollos from a data file.
Definition: Apollo.h:44
QString TargetName()
Returns the target name which is always the Moon.
Definition: Apollo.h:230
Isis exception class.
Definition: IException.h:107
bool IsApollo16()
Checks if the spacecraft is Apollo 16.
Definition: Apollo.h:132
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
bool IsPanoramic()
Checks if the instrument is an Apollo Panoramic camera.
Definition: Apollo.h:108
int p_imageBands
Number of bands in the image.
Definition: Apollo.h:316
void initialize(QString spacecraft, QString instrument)
Sets variables based on the spacecraft name and instrument.
Definition: Apollo.h:256
int ReseauDimension()
Returns the reseau dimension of the image.
Definition: Apollo.h:184
QString p_naifFrameCode
NAIF frame code.
Definition: Apollo.h:321
bool IsMetric()
Checks if the instrument is an Apollo Metric camera.
Definition: Apollo.h:100
iTime LaunchDate()
Returns the launch date of the mission.
Definition: Apollo.h:241
int p_reseauDimension
Dimensions of the reseaus.
Definition: Apollo.h:317
QString p_instrumentId
Instrument ID.
Definition: Apollo.h:320