Loading [MathJax]/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
Mariner10Camera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "Mariner10Camera.h"
10 
11 #include <iostream>
12 #include <iomanip>
13 
14 #include <SpiceUsr.h>
15 #include <SpiceZfc.h>
16 #include <SpiceZmc.h>
17 
18 #include <QString>
19 
20 #include "CameraDetectorMap.h"
21 #include "CameraFocalPlaneMap.h"
22 #include "CameraGroundMap.h"
23 #include "CameraSkyMap.h"
24 #include "IString.h"
25 #include "iTime.h"
26 #include "FileName.h"
27 #include "NaifStatus.h"
28 #include "Pvl.h"
29 #include "ReseauDistortionMap.h"
30 
31 using namespace std;
32 namespace Isis {
45  Mariner10Camera::Mariner10Camera(Cube &cube) : FramingCamera(cube) {
47 
48  m_spacecraftNameLong = "Mariner 10";
49  m_spacecraftNameShort = "Mariner10";
50 
51  // Turn off the aberration corrections for instrument position object
53  instrumentRotation()->SetFrame(-76000);
54 
55  // Set camera parameters
57  SetPixelPitch();
58 
59  Pvl &lab = *cube.label();
60  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
61  // Get utc start time
62  QString stime = inst["StartTime"];
63 
64  iTime startTime;
65  startTime.setUtc((QString)inst["StartTime"]);
66  setTime(startTime);
67 
68  // Setup detector map
69  new CameraDetectorMap(this);
70 
71  // Setup focal plane map, and detector origin
72  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
73 
74  QString ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_SAMPLE";
75  double sampleBoresight = getDouble(ikernKey);
76  ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_LINE";
77  double lineBoresight = getDouble(ikernKey);
78 
79  focalMap->SetDetectorOrigin(sampleBoresight, lineBoresight);
80 
81  // Setup distortion map which is dependent on encounter, use start time
82  // MOON: 1973-11-08T03:16:26.350
83  QString spacecraft = (QString)inst["SpacecraftName"];
84  QString instId = (QString)inst["InstrumentId"];
85  QString cam;
86  if(instId == "M10_VIDICON_A") {
87  cam = "a";
88  m_instrumentNameLong = "Mariner 10 Vidicon A";
89  m_instrumentNameShort = "VIDICON A";
90  }
91  else if(instId == "M10_VIDICON_B") {
92  cam = "b";
93  m_instrumentNameLong = "Mariner 10 Vidicon B";
94  m_instrumentNameShort = "VIDICON B";
95  }
96  else {
97  QString msg = "File does not appear to be a Mariner10 image. InstrumentId ["
98  + instId + "] is invalid Mariner 10 value.";
99  throw IException(IException::User, msg, _FILEINFO_);
100  }
101 
102  QString fname = FileName("$mariner10/reseaus/mar10" + cam
103  + "MasterReseaus.pvl").expanded();
104 
105  try {
106  new ReseauDistortionMap(this, lab, fname);
107  }
108  catch(IException &e) {
109  string msg = "Unable to create distortion map.";
110  throw IException(e, IException::Programmer, msg, _FILEINFO_);
111  }
112 
113  // Setup the ground and sky map
114  new CameraGroundMap(this);
115  new CameraSkyMap(this);
116 
117  LoadCache();
119  }
120 
121 
143  pair<iTime, iTime> Mariner10Camera::ShutterOpenCloseTimes(double time,
144  double exposureDuration) {
145  pair<iTime, iTime> shuttertimes;
146  // To get shutter start (open) time, subtract half exposure duration
147  shuttertimes.first = time - (exposureDuration / 2.0);
148  // To get shutter end (close) time, add half exposure duration
149  shuttertimes.second = time + (exposureDuration / 2.0);
150  return shuttertimes;
151  }
152 }
153 
154 
163 extern "C" Isis::Camera *Mariner10CameraPlugin(Isis::Cube &cube) {
164  return new Isis::Mariner10Camera(cube);
165 }
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::Camera::exposureDuration
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3063
Isis::Spice::time
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition: Spice.cpp:884
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::Spice::instrumentPosition
virtual SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
Definition: Spice.cpp:1600
Isis::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::SpicePosition::SetAberrationCorrection
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Definition: SpicePosition.cpp:186
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::Mariner10Camera
Mariner10 Camera Model.
Definition: Mariner10Camera.h:50
Isis::NaifStatus::CheckErrors
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
Isis::Camera
Definition: Camera.h:236
Isis::FramingCamera
Generic class for Framing Cameras.
Definition: FramingCamera.h:32
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::ReseauDistortionMap
Distort/undistort focal plane coordinates.
Definition: ReseauDistortionMap.h:27
Isis::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::Spice::instrumentRotation
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1622
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Sensor::setTime
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
Definition: Sensor.cpp:97
Isis::FileName::expanded
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:196
Isis::Camera::SetPixelPitch
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1418
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Mariner10Camera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: Mariner10Camera.cpp:143
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::Camera::LoadCache
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2420
Isis::Camera::m_instrumentNameShort
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:497
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::CameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:31
Isis::Spice::getDouble
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:1039
Isis::SpiceRotation::SetFrame
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition: SpiceRotation.cpp:214
Isis::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
Isis::Camera::SetFocalLength
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1411
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:50