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 "CameraDetectorMap.h"
24 #include "CameraDistortionMap.h"
25 #include "CameraFocalPlaneMap.h"
26 #include "CameraGroundMap.h"
27 #include "CameraSkyMap.h"
28 #include "IString.h"
29 #include "iTime.h"
30 #include "NaifStatus.h"
31 
32 using namespace std;
33 
34 namespace Isis {
47  HiresCamera::HiresCamera(Cube &cube) : FramingCamera(cube) {
49  Pvl &lab = *cube.label();
50  // Get the camera characteristics
51  QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
52  filter = filter.toUpper();
53 
55  SetPixelPitch();
56 
57  // Get the start time in et
58  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
59 
60  // set variables startTime and exposureDuration
61  double time = iTime((QString)inst["StartTime"]).Et();
62 
63  // divide exposure duration keyword value by 1000 to convert to seconds
64  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
65  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration);
66 
67  /************************************************************************
68  * The following line was uncommented to maintain consistency within all
69  * clementine camera models. Not sure why the following was originally
70  * commented out:
71  * 2010-08-05 Jeannie Walldren
72  ***********************************************************************/
73  // Do not correct time for center of the exposure duration. This is because
74  // the kernels were built to accept the start times of the images.
75  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
76 
77  // Setup detector map
78  new CameraDetectorMap(this);
79 
80  // Setup focal plane map
81  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
82 
83  focalMap->SetDetectorOrigin(
85  "_BORESIGHT_SAMPLE"),
87  "_BORESIGHT_LINE"));
88 
89  // Setup distortion map
90  new CameraDistortionMap(this);
91 
92  // Setup the ground and sky map
93  new CameraGroundMap(this);
94  new CameraSkyMap(this);
95 
96  setTime(centerTime);
97  LoadCache();
99  }
100 
124  pair<iTime, iTime> HiresCamera::ShutterOpenCloseTimes(double time,
125  double exposureDuration) {
126  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
127  }
128 }
129 
130 
143  return new Isis::HiresCamera(cube);
144 }