USGS

Isis 3.0 Object Programmers' Reference

Home

MocNarrowAngleCamera.cpp
Go to the documentation of this file.
1 
20 #include "MocNarrowAngleCamera.h"
21 
22 #include <QString>
23 
24 #include "CameraDistortionMap.h"
25 #include "CameraFocalPlaneMap.h"
26 #include "IException.h"
27 #include "IString.h"
28 #include "iTime.h"
31 #include "LineScanCameraSkyMap.h"
32 #include "NaifStatus.h"
33 
34 using namespace std;
35 namespace Isis {
44  MocNarrowAngleCamera::MocNarrowAngleCamera(Cube &cube) : LineScanCamera(cube) {
45  m_instrumentNameLong = "Mars Orbiter Camera Narrow Angle";
46  m_instrumentNameShort = "MOC-NA";
47  m_spacecraftNameLong = "Mars Global Surveyor";
48  m_spacecraftNameShort = "MGS";
49 
51  // Set up the camera info from ik/iak kernels
52  // LoadEulerMounting();
54  SetPixelPitch();
56 
57  // Get the start time from labels
58  Pvl &lab = *cube.label();
59  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
60  QString stime = inst["SpacecraftClockCount"];
61  double etStart = getClockTime(stime).Et();
62 
63  // Get other info from labels
64  double csum = inst["CrosstrackSumming"];
65  double dsum = inst["DowntrackSumming"];
66  double lineRate = (double) inst["LineExposureDuration"] / 1000.0;
67  lineRate *= dsum;
68  double ss = inst["FirstLineSample"];
69 
70  // Setup detector map
71  LineScanCameraDetectorMap *detectorMap =
72  new LineScanCameraDetectorMap(this, etStart, lineRate);
73  detectorMap->SetDetectorSampleSumming(csum);
74  detectorMap->SetDetectorLineSumming(dsum);
75  detectorMap->SetStartingDetectorSample(ss);
76 
77  // Setup focal plane map
78  CameraFocalPlaneMap *focalMap =
79  new CameraFocalPlaneMap(this, naifIkCode());
80  focalMap->SetDetectorOrigin(1024.5, 0.0);
81  focalMap->SetDetectorOffset(0.0, 0.0);
82 
83  // Setup distortion map
84  new CameraDistortionMap(this);
85 
86  // Setup the ground and sky map
87  new LineScanCameraGroundMap(this);
88  new LineScanCameraSkyMap(this);
89 
90  LoadCache();
92  }
93 }
94 
95 
106  return new Isis::MocNarrowAngleCamera(cube);
107 }