USGS

Isis 3.0 Object Programmers' Reference

Home

NirCamera.cpp
Go to the documentation of this file.
1 
20 #include "NirCamera.h"
21 
22 #include "CameraDetectorMap.h"
23 #include "CameraFocalPlaneMap.h"
24 #include "CameraGroundMap.h"
25 #include "CameraSkyMap.h"
26 #include "IString.h"
27 #include "iTime.h"
28 #include "NaifStatus.h"
29 #include "RadialDistortionMap.h"
30 
31 using namespace std;
32 
33 namespace Isis {
46  NirCamera::NirCamera(Cube &cube) : FramingCamera(cube) {
48  // Get the camera characteristics
49 
50  Pvl &lab = *cube.label();
51  QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
52 
53  filter = filter.toUpper();
54 
55  if(filter.compare("A") == 0) {
56  SetFocalLength(2548.2642 * 0.038);
57  }
58  else if(filter.compare("B") == 0) {
59  SetFocalLength(2530.8958 * 0.038);
60  }
61  else if(filter.compare("C") == 0) {
62  SetFocalLength(2512.6589 * 0.038);
63  }
64  else if(filter.compare("D") == 0) {
65  SetFocalLength(2509.0536 * 0.038);
66  }
67  else if(filter.compare("E") == 0) {
68  SetFocalLength(2490.7378 * 0.038);
69  }
70  else if(filter.compare("F") == 0) {
71  SetFocalLength(2487.8694 * 0.038);
72  }
73 
74  SetPixelPitch();
75 
76  // Get the start time in et
77  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
78 
79  // set variables startTime and exposureDuration
80  double et = iTime((QString)inst["StartTime"]).Et();
81 
82  // divide exposure duration keyword value by 1000 to convert to seconds
83  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
84  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
85 
86  /************************************************************************
87  * The following line was uncommented to maintain consistency within all
88  * clementine camera models. Not sure why the following was originally
89  * commented out:
90  * 2010-08-05 Jeannie Walldren
91  ***********************************************************************/
92  // Do not correct time for center of the exposure duration. This is because
93  // the kernels were built to accept the start times of the images.
94  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
95 
96  // Setup detector map
97  new CameraDetectorMap(this);
98 
99  // Setup focal plane map
100  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
101 
102  focalMap->SetDetectorOrigin(
104  "_BORESIGHT_SAMPLE"),
106  "_BORESIGHT_LINE"));
107 
108  // Setup distortion map
109  new RadialDistortionMap(this, -0.0006364);
110 
111  // Setup the ground and sky map
112  new CameraGroundMap(this);
113  new CameraSkyMap(this);
114 
115  setTime(centerTime);
116  LoadCache();
118  }
119 
143  pair<iTime, iTime> NirCamera::ShutterOpenCloseTimes(double time,
144  double exposureDuration) {
145  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
146  }
147 }
148 
161  return new Isis::NirCamera(cube);
162 }