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 <QString>
23 
24 #include "CameraDetectorMap.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 #include "RadialDistortionMap.h"
32 
33 using namespace std;
34 
35 namespace Isis {
48  NirCamera::NirCamera(Cube &cube) : FramingCamera(cube) {
49  m_instrumentNameLong = "Near Infrared Camera";
50  m_instrumentNameShort = "NIR";
51  m_spacecraftNameLong = "Clementine 1";
52  m_spacecraftNameShort = "Clementine1";
53 
55  // Get the camera characteristics
56 
57  Pvl &lab = *cube.label();
58  QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
59 
60  filter = filter.toUpper();
61 
62  if(filter.compare("A") == 0) {
63  SetFocalLength(2548.2642 * 0.038);
64  }
65  else if(filter.compare("B") == 0) {
66  SetFocalLength(2530.8958 * 0.038);
67  }
68  else if(filter.compare("C") == 0) {
69  SetFocalLength(2512.6589 * 0.038);
70  }
71  else if(filter.compare("D") == 0) {
72  SetFocalLength(2509.0536 * 0.038);
73  }
74  else if(filter.compare("E") == 0) {
75  SetFocalLength(2490.7378 * 0.038);
76  }
77  else if(filter.compare("F") == 0) {
78  SetFocalLength(2487.8694 * 0.038);
79  }
80 
81  SetPixelPitch();
82 
83  // Get the start time in et
84  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
85 
86  // set variables startTime and exposureDuration
87  double et = iTime((QString)inst["StartTime"]).Et();
88 
89  // divide exposure duration keyword value by 1000 to convert to seconds
90  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
91  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
92 
93  /************************************************************************
94  * The following line was uncommented to maintain consistency within all
95  * clementine camera models. Not sure why the following was originally
96  * commented out:
97  * 2010-08-05 Jeannie Walldren
98  ***********************************************************************/
99  // Do not correct time for center of the exposure duration. This is because
100  // the kernels were built to accept the start times of the images.
101  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
102 
103  // Setup detector map
104  new CameraDetectorMap(this);
105 
106  // Setup focal plane map
107  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
108 
109  focalMap->SetDetectorOrigin(
111  "_BORESIGHT_SAMPLE"),
113  "_BORESIGHT_LINE"));
114 
115  // Setup distortion map
116  new RadialDistortionMap(this, -0.0006364);
117 
118  // Setup the ground and sky map
119  new CameraGroundMap(this);
120  new CameraSkyMap(this);
121 
122  setTime(centerTime);
123  LoadCache();
125  }
126 
150  pair<iTime, iTime> NirCamera::ShutterOpenCloseTimes(double time,
151  double exposureDuration) {
152  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
153  }
154 }
155 
168  return new Isis::NirCamera(cube);
169 }