Isis 3 Programmer Reference
NirCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "NirCamera.h"
10
11#include <QString>
12
13#include "CameraDetectorMap.h"
14#include "CameraFocalPlaneMap.h"
15#include "CameraGroundMap.h"
16#include "CameraSkyMap.h"
17#include "IString.h"
18#include "iTime.h"
19#include "NaifStatus.h"
20#include "RadialDistortionMap.h"
21
22using namespace std;
23
24namespace Isis {
38 m_instrumentNameLong = "Near Infrared Camera";
40 m_spacecraftNameLong = "Clementine 1";
41 m_spacecraftNameShort = "Clementine1";
42
44 // Get the camera characteristics
45
46 Pvl &lab = *cube.label();
47 QString filter = (QString)(lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
48
49 filter = filter.toUpper();
50
51 if(filter.compare("A") == 0) {
52 SetFocalLength(2548.2642 * 0.038);
53 }
54 else if(filter.compare("B") == 0) {
55 SetFocalLength(2530.8958 * 0.038);
56 }
57 else if(filter.compare("C") == 0) {
58 SetFocalLength(2512.6589 * 0.038);
59 }
60 else if(filter.compare("D") == 0) {
61 SetFocalLength(2509.0536 * 0.038);
62 }
63 else if(filter.compare("E") == 0) {
64 SetFocalLength(2490.7378 * 0.038);
65 }
66 else if(filter.compare("F") == 0) {
67 SetFocalLength(2487.8694 * 0.038);
68 }
69
71
72 // Get the start time in et
73 PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
74
75 // set variables startTime and exposureDuration
76 double et = iTime((QString)inst["StartTime"]).Et();
77
78 // divide exposure duration keyword value by 1000 to convert to seconds
79 double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
80 pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
81
82 /************************************************************************
83 * The following line was uncommented to maintain consistency within all
84 * clementine camera models. Not sure why the following was originally
85 * commented out:
86 * 2010-08-05 Jeannie Walldren
87 ***********************************************************************/
88 // Do not correct time for center of the exposure duration. This is because
89 // the kernels were built to accept the start times of the images.
90 iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
91
92 // Setup detector map
93 new CameraDetectorMap(this);
94
95 // Setup focal plane map
96 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
97
98 focalMap->SetDetectorOrigin(
100 "_BORESIGHT_SAMPLE"),
102 "_BORESIGHT_LINE"));
103
104 // Setup distortion map
105 new RadialDistortionMap(this, -0.0006364);
106
107 // Setup the ground and sky map
108 new CameraGroundMap(this);
109 new CameraSkyMap(this);
110
111 setTime(centerTime);
112 LoadCache();
114 }
115
139 pair<iTime, iTime> NirCamera::ShutterOpenCloseTimes(double time,
140 double exposureDuration) {
142 }
143}
144
156extern "C" Isis::Camera *NirCameraPlugin(Isis::Cube &cube) {
157 return new Isis::NirCamera(cube);
158}
Convert between parent image coordinates and detector coordinates.
Convert between distorted focal plane and detector coordinates.
Convert between undistorted focal plane and ground coordinates.
QString m_spacecraftNameLong
Full spacecraft name.
Definition Camera.h:499
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition Camera.cpp:3093
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition Camera.cpp:1422
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition Camera.cpp:1429
void LoadCache()
This loads the spice cache big enough for this image.
Definition Camera.cpp:2450
QString m_instrumentNameShort
Shortened instrument name.
Definition Camera.h:498
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition Camera.h:500
QString m_instrumentNameLong
Full instrument name.
Definition Camera.h:497
Convert between undistorted focal plane and ra/dec coordinates.
IO Handler for Isis Cubes.
Definition Cube.h:168
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:1707
Generic class for Framing Cameras.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
This is the camera model for the Clementine Near Infrared Camera.
Definition NirCamera.h:64
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
NirCamera(Cube &cube)
Constructs a Clementine HiresCamera object using the image labels.
Definition NirCamera.cpp:37
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
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:99
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition Spice.cpp:975
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition Spice.cpp:1046
Parse and return pieces of a time string.
Definition iTime.h:65
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition iTime.h:126
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
Namespace for the standard library.