USGS

Isis 3.0 Object Programmers' Reference

Home

HiresCamera.cpp
Go to the documentation of this file.
1 
21 #include "HiresCamera.h"
22 
23 #include <QString>
24 
25 #include "CameraDetectorMap.h"
26 #include "CameraDistortionMap.h"
27 #include "CameraFocalPlaneMap.h"
28 #include "CameraGroundMap.h"
29 #include "CameraSkyMap.h"
30 #include "IString.h"
31 #include "iTime.h"
32 #include "NaifStatus.h"
33 
34 using namespace std;
35 
36 namespace Isis {
49  HiresCamera::HiresCamera(Cube &cube) : FramingCamera(cube) {
50  m_instrumentNameLong = "High Resolution Camera";
51  m_instrumentNameShort = "HiRES";
52  m_spacecraftNameLong = "Clementine 1";
53  m_spacecraftNameShort = "Clementine1";
54 
56  Pvl &lab = *cube.label();
57  // Get the camera characteristics
58  QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
59  filter = filter.toUpper();
60 
62  SetPixelPitch();
63 
64  // Get the start time in et
65  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
66 
67  // set variables startTime and exposureDuration
68  double time = iTime((QString)inst["StartTime"]).Et();
69 
70  // divide exposure duration keyword value by 1000 to convert to seconds
71  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
72  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration);
73 
74  /************************************************************************
75  * The following line was uncommented to maintain consistency within all
76  * clementine camera models. Not sure why the following was originally
77  * commented out:
78  * 2010-08-05 Jeannie Walldren
79  ***********************************************************************/
80  // Do not correct time for center of the exposure duration. This is because
81  // the kernels were built to accept the start times of the images.
82  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
83 
84  // Setup detector map
85  new CameraDetectorMap(this);
86 
87  // Setup focal plane map
88  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
89 
90  focalMap->SetDetectorOrigin(
92  "_BORESIGHT_SAMPLE"),
94  "_BORESIGHT_LINE"));
95 
96  // Setup distortion map
97  new CameraDistortionMap(this);
98 
99  // Setup the ground and sky map
100  new CameraGroundMap(this);
101  new CameraSkyMap(this);
102 
103  setTime(centerTime);
104  LoadCache();
106  }
107 
131  pair<iTime, iTime> HiresCamera::ShutterOpenCloseTimes(double time,
132  double exposureDuration) {
133  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
134  }
135 }
136 
137 
150  return new Isis::HiresCamera(cube);
151 }