USGS

Isis 3.0 Object Programmers' Reference

Home

Mariner10Camera.cpp
Go to the documentation of this file.
1 
23 #include "Mariner10Camera.h"
24 
25 #include <iostream>
26 #include <iomanip>
27 
28 #include <SpiceUsr.h>
29 #include <SpiceZfc.h>
30 #include <SpiceZmc.h>
31 
32 #include "CameraDetectorMap.h"
33 #include "CameraFocalPlaneMap.h"
34 #include "CameraGroundMap.h"
35 #include "CameraSkyMap.h"
36 #include "IString.h"
37 #include "iTime.h"
38 #include "FileName.h"
39 #include "NaifStatus.h"
40 #include "Pvl.h"
41 #include "ReseauDistortionMap.h"
42 
43 using namespace std;
44 namespace Isis {
57  Mariner10Camera::Mariner10Camera(Cube &cube) : FramingCamera(cube) {
59 
60  // Turn off the aberration corrections for instrument position object
62  instrumentRotation()->SetFrame(-76000);
63 
64  // Set camera parameters
66  SetPixelPitch();
67 
68  Pvl &lab = *cube.label();
69  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
70  // Get utc start time
71  QString stime = inst["StartTime"];
72 
73  iTime startTime;
74  startTime.setUtc((QString)inst["StartTime"]);
75  setTime(startTime);
76 
77  // Setup detector map
78  new CameraDetectorMap(this);
79 
80  // Setup focal plane map, and detector origin
81  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
82 
83  QString ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_SAMPLE";
84  double sampleBoresight = getDouble(ikernKey);
85  ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_LINE";
86  double lineBoresight = getDouble(ikernKey);
87 
88  focalMap->SetDetectorOrigin(sampleBoresight, lineBoresight);
89 
90  // Setup distortion map which is dependent on encounter, use start time
91  // MOON: 1973-11-08T03:16:26.350
92  QString spacecraft = (QString)inst["SpacecraftName"];
93  QString instId = (QString)inst["InstrumentId"];
94  QString cam;
95  if(instId == "M10_VIDICON_A") {
96  cam = "a";
97  }
98  else if(instId == "M10_VIDICON_B") {
99  cam = "b";
100  }
101  else {
102  QString msg = "File does not appear to be a Mariner10 image. InstrumentId ["
103  + instId + "] is invalid Mariner 10 value.";
105  }
106 
107  QString fname = FileName("$mariner10/reseaus/mar10" + cam
108  + "MasterReseaus.pvl").expanded();
109 
110  try {
111  new ReseauDistortionMap(this, lab, fname);
112  }
113  catch(IException &e) {
114  string msg = "Unable to create distortion map.";
116  }
117 
118  // Setup the ground and sky map
119  new CameraGroundMap(this);
120  new CameraSkyMap(this);
121 
122  LoadCache();
124  }
125 
147  pair<iTime, iTime> Mariner10Camera::ShutterOpenCloseTimes(double time,
148  double exposureDuration) {
149  pair<iTime, iTime> shuttertimes;
150  // To get shutter start (open) time, subtract half exposure duration
151  shuttertimes.first = time - (exposureDuration / 2.0);
152  // To get shutter end (close) time, add half exposure duration
153  shuttertimes.second = time + (exposureDuration / 2.0);
154  return shuttertimes;
155  }
156 }
157 
158 
168  return new Isis::Mariner10Camera(cube);
169 }