Isis 3.0 Programmer Reference
Back | Home
LoHighCamera.cpp
Go to the documentation of this file.
1 
23 #include "LoHighCamera.h"
24 #include "LoHighDistortionMap.h"
25 #include "LoCameraFiducialMap.h"
26 
27 #include <QString>
28 
29 #include "Affine.h"
30 #include "CameraDetectorMap.h"
31 #include "CameraFocalPlaneMap.h"
32 #include "CameraGroundMap.h"
33 #include "CameraSkyMap.h"
34 #include "IException.h"
35 #include "IString.h"
36 #include "iTime.h"
37 #include "NaifStatus.h"
38 
39 using namespace std;
40 namespace Isis {
52  LoHighCamera::LoHighCamera(Cube &cube) : FramingCamera(cube) {
54 
55  m_instrumentNameLong = "High Resolution Camera";
56  m_instrumentNameShort = "High";
57 
58  // LO3 High instrument kernel code = -533001
59  if (naifIkCode() == -533001) {
60  m_spacecraftNameLong = "Lunar Orbiter 3";
61  m_spacecraftNameShort = "LO3";
62  }
63  // L04 High instrument kernel code = -534001
64  else if (naifIkCode() == -534001) {
65  m_spacecraftNameLong = "Lunar Orbiter 4";
66  m_spacecraftNameShort = "LO4";
67  }
68  // LO5 High instrument kernel code = -535001
69  else if (naifIkCode() == -535001) {
70  m_spacecraftNameLong = "Lunar Orbiter 5";
71  m_spacecraftNameShort = "LO5";
72  }
73  else {
74  QString msg = "File does not appear to be a Lunar Orbiter image: ";
75  msg += QString::number(naifIkCode());
76  msg += " is not a supported instrument kernel code for Lunar Orbiter.";
78  }
79 
80  // Get the Instrument label information needed to define the camera for this frame
81  Pvl &lab = *cube.label();
82  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
83  QString spacecraft = (QString)inst["SpacecraftName"];
84  QString instId = (QString)inst["InstrumentId"];
85 
86  // Turn off the aberration corrections for the instrument position object
88 
89  // Get the camera characteristics
91  SetPixelPitch();
92 
93  // Get the start time in et
94  double time = iTime((QString)inst["StartTime"]).Et();
95 
96  // Setup focal plane map
97  LoCameraFiducialMap fid(inst, naifIkCode());
98 
99  // Setup detector map
100  new CameraDetectorMap(this);
101 
102  // Setup focalplane map
103  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
104  // Try (0.,0.)
105  focalMap->SetDetectorOrigin(0.0, 0.0);
106 
107  // Setup distortion map
108  LoHighDistortionMap *distortionMap = new LoHighDistortionMap(this);
109  distortionMap->SetDistortion(naifIkCode());
110  // Setup the ground and sky map
111  new CameraGroundMap(this);
112  new CameraSkyMap(this);
113 
114  // Determine the NAIF ID for the CK frame reference.
115  if ( spacecraft.contains("3") ) {
116  m_ckFrameId = -533000;
117  }
118  else if ( spacecraft.contains("4") ) {
119  m_ckFrameId = -534000;
120  }
121  else if ( spacecraft.contains("5") ) {
122  m_ckFrameId = -535000;
123  }
124  else {
125  QString msg = "File does not appear to be an LunarOrbiter 3,4,5 image";
127  }
128 
129  setTime(time);
130  LoadCache();
132  }
133 
134 
157  pair<iTime, iTime> LoHighCamera::ShutterOpenCloseTimes(double time,
158  double exposureDuration) {
159  pair<iTime, iTime> shuttertimes;
160  // To get shutter start (open) time, subtract half the exposure duration from the center time
161  shuttertimes.first = time - (exposureDuration / 2);
162  // To get shutter end (close) time, add half the exposure duration to the center time
163  shuttertimes.second = time + (exposureDuration / 2);
164  return shuttertimes;
165  }
166 }
167 
168 
181  return new Isis::LoHighCamera(cube);
182 }
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1485
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Parse and return pieces of a time string.
Definition: iTime.h:74
Distort/undistort focal plane coordinates.
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Defines the Lunar Orbiter High Resolution camera class.
Definition: LoHighCamera.h:67
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:494
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1298
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void SetDistortion(const int naifIkCode)
Load LO High Resolution Camera perspective &amp; distortion coefficients.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1492
Search child objects.
Definition: PvlObject.h:170
SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
Definition: Spice.cpp:1454
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:135
Convert between parent image coordinates and detector coordinates.
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions...
Definition: Spice.cpp:804
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Convert between undistorted focal plane and ground coordinates.
Convert between distorted focal plane and detector coordinates.
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:495
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:134
Computes map from image coordinates to focal plane based on fiducials.
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:112
Isis::Camera * LoHighCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate a LoHighCamera object.
Container for cube-like labels.
Definition: Pvl.h:135
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2489
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:496
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:43
Isis exception class.
Definition: IException.h:99
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:888
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:47
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:497
int m_ckFrameId
LO 3,4,5 CK frame id.
Definition: LoHighCamera.h:99
Generic class for Framing Cameras.
Definition: FramingCamera.h:48
IO Handler for Isis Cubes.
Definition: Cube.h:158

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 ISIS Support Center
File Modified: 07/12/2023 23:22:24