File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ApolloMetricCamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "ApolloMetricCamera.h"
10 
11 #include "ApolloMetricDistortionMap.h"
12 
13 #include <QString>
14 
15 #include "CameraDetectorMap.h"
16 #include "CameraFocalPlaneMap.h"
17 #include "CameraGroundMap.h"
18 #include "CameraSkyMap.h"
19 #include "FileName.h"
20 #include "IException.h"
21 #include "IString.h"
22 #include "iTime.h"
23 #include "NaifStatus.h"
24 #include "ReseauDistortionMap.h"
25 
26 using namespace std;
27 namespace Isis {
39  ApolloMetricCamera::ApolloMetricCamera(Cube &cube) : FramingCamera(cube) {
41 
42  m_instrumentNameLong = "Metric Camera";
43  m_instrumentNameShort = "Metric";
44 
45  Pvl &lab = *cube.label();
46  const PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
47 
48  // The Spacecraft Name should be either Apollo 15, 16, or 17. The name
49  // itself could be formatted any number of ways, but the number contained
50  // in the name should be unique between the missions
51  // We use the naifIkCode instead now
52  //QString spacecraft = inst.findKeyword("SpacecraftName")[0];
53  // Apollo 15 Pan naif code = -917240
54  if (naifIkCode() == -915240) {
55  p_ckFrameId = -915240;
56  p_ckReferenceId = 1;
57  p_spkTargetId = -915;
58  m_spacecraftNameLong = "Apollo 15";
59  m_spacecraftNameShort = "Apollo15";
60  }
61  // Apollo 16 Pan naif code = -917240
62  else if (naifIkCode() == -916240) {
63  p_ckFrameId = -916240;
64  p_ckReferenceId = 1;
65  p_spkTargetId = -916;
66  m_spacecraftNameLong = "Apollo 16";
67  m_spacecraftNameShort = "Apollo16";
68  }
69  // Apollo 17 Pan naif code = -917240
70  else if (naifIkCode() == -917240) {
71  p_ckFrameId = -917240;
72  p_ckReferenceId = 1;
73  p_spkTargetId = -917;
74  m_spacecraftNameLong = "Apollo 17";
75  m_spacecraftNameShort = "Apollo17";
76  }
77  else {
78  QString msg = "File does not appear to be an Apollo image";
79  throw IException(IException::User, msg, _FILEINFO_);
80  }
81 
82  // Get the camera characteristics
84  SetPixelPitch();
85 
86  // Setup detector map
87  new CameraDetectorMap(this);
88 
89  // Setup focal plane map
90  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
91  focalMap->SetDetectorOrigin(ParentSamples() / 2.0, ParentLines() / 2.0);
92 
93  QString ppKey("INS" + toString(naifIkCode()) + "_PP");
94  QString odkKey("INS" + toString(naifIkCode()) + "_OD_K");
95  QString decenterKey("INS" + toString(naifIkCode()) + "_DECENTER");
96 
97  new ApolloMetricDistortionMap(this, getDouble(ppKey, 0),
98  getDouble(ppKey, 1), getDouble(odkKey, 0), getDouble(odkKey, 1),
99  getDouble(odkKey, 2), getDouble(decenterKey, 0),
100  getDouble(decenterKey, 1), getDouble(decenterKey, 2));
101 
102  // Setup the ground and sky map
103  new CameraGroundMap(this);
104  new CameraSkyMap(this);
105 
106  // Create a cache and grab spice info since it does not change for
107  // a framing camera (fixed spacecraft position and pointing)
108  // Convert the start time to et
109  setTime((QString)inst["StartTime"]);
110  LoadCache();
112  }
113 
114 
136  pair<iTime, iTime> ApolloMetricCamera::ShutterOpenCloseTimes(double time,
137  double exposureDuration) {
138  pair<iTime, iTime> shuttertimes;
139  // To get shutter start (open) time, subtract half exposure duration
140  shuttertimes.first = time - (exposureDuration / 2.0);
141  // To get shutter end (close) time, add half exposure duration
142  shuttertimes.second = time + (exposureDuration / 2.0);
143  return shuttertimes;
144  }
145 
146 } // End Apollo namespace
147 
148 
160 extern "C" Isis::Camera *ApolloMetricCameraPlugin(Isis::Cube &cube) {
161  return new Isis::ApolloMetricCamera(cube);
162 }
Isis::ApolloMetricCamera::p_spkTargetId
int p_spkTargetId
Spacecraft Kernel Target ID.
Definition: ApolloMetricCamera.h:109
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::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
Isis::Camera::ParentLines
int ParentLines() const
Returns the number of lines in the parent alphacube.
Definition: Camera.cpp:2806
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::ApolloMetricCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: ApolloMetricCamera.cpp:136
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::ApolloMetricCamera::p_ckReferenceId
int p_ckReferenceId
"Camera-matrix" Kernel Reference ID
Definition: ApolloMetricCamera.h:108
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::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Camera::ParentSamples
int ParentSamples() const
Returns the number of samples in the parent alphacube.
Definition: Camera.cpp:2816
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::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::ApolloMetricCamera
Apollo Metric Camera Model.
Definition: ApolloMetricCamera.h:53
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
std
Namespace for the standard library.
Isis::ApolloMetricCamera::p_ckFrameId
int p_ckFrameId
"Camera-matrix" Kernel Frame ID
Definition: ApolloMetricCamera.h:107
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::ApolloMetricDistortionMap
Apollo Metric Distortion Map.
Definition: ApolloMetricDistortionMap.h:28
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:07