USGS

Isis 3.0 Object Programmers' Reference

Home

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