USGS

Isis 3.0 Object Programmers' Reference

Home

AmicaCamera.cpp
Go to the documentation of this file.
1 
21 #include "AmicaCamera.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 {
42  AmicaCamera::AmicaCamera(Cube &cube) : FramingCamera(cube) {
44  Pvl &lab = *cube.label();
45  // Get the camera characteristics
46  QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["Name"];
47  filter = filter.toUpper();
48 
49  SetFocalLength(); // Retrives from IK stored in units of meters
50  SetFocalLength(FocalLength() * 1000.0); // Convert from meters to mm
51 
52  // Get from IAK
53  SetPixelPitch();
54 
55  // Get the start time in et
56  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
57 
58  // set variables startTime and exposureDuration
59  QString stime = inst["SpacecraftClockStartCount"];
60  iTime etStart = getClockTime(stime);
61 
62  double exposureDuration = ((double) inst["ExposureDuration"]);
63  iTime centerTime = etStart + (exposureDuration / 2.0);
64 
65  // Setup focal plane map
66  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
67 
68  focalMap->SetDetectorOrigin(
70  "_BORESIGHT_SAMPLE"),
72  "_BORESIGHT_LINE"));
73 
74  // Setup detector map
75  CameraDetectorMap *detMap = new CameraDetectorMap(this);
76  detMap->SetStartingDetectorSample((int) inst["FirstSample"] + 1);
77  detMap->SetStartingDetectorLine((int) inst["FirstLine"] + 1);
78 
79  // Handle summing
80  int binning = inst["Binning"];
81  detMap->SetDetectorLineSumming(binning);
82  detMap->SetDetectorSampleSumming(binning);
83 
84  // Setup distortion map
85  CameraDistortionMap *dmap = new CameraDistortionMap(this);
86  dmap->SetDistortion(-130102);
87 
88  // Setup the ground and sky map
89  new CameraGroundMap(this);
90  new CameraSkyMap(this);
91 
92  setTime(centerTime);
93  LoadCache();
95  }
96 
119  pair<iTime, iTime> AmicaCamera::ShutterOpenCloseTimes(double time,
120  double exposureDuration) {
121  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
122  }
123 }
124 
125 
137  return new Isis::AmicaCamera(cube);
138 }