Isis 3 Programmer Reference
LwirCamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "LwirCamera.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 
22 using namespace std;
23 
24 namespace Isis {
38  LwirCamera::LwirCamera(Cube &cube) : FramingCamera(cube) {
39  m_instrumentNameLong = "Long Wave Infrared Camera";
40  m_instrumentNameShort = "LWIR";
41  m_spacecraftNameLong = "Clementine 1";
42  m_spacecraftNameShort = "Clementine1";
43 
45 
46  // Get the camera characteristics
47  Pvl &lab = *cube.label();
48  QString filter = (lab.findGroup("BandBin", Pvl::Traverse))["FilterName"];
49 
50  filter = filter.toUpper();
51 
53  SetPixelPitch();
54 
55  // Get the start time in et
56  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
57 
58  // set variables startTime and exposureDuration
59  double time = iTime((QString)inst["StartTime"]).Et();
60 
61  // divide exposure duration keyword value by 1000 to convert to seconds
62  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
63  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration);
64 
65  /************************************************************************
66  * The following line was uncommented to maintain consistency within all
67  * clementine camera models. Not sure why the following was originally
68  * commented out:
69  * 2010-08-05 Jeannie Walldren
70  ***********************************************************************/
71  // Do not correct time for center of the exposure duration. This is because
72  // the kernels were built to accept the start times of the images.
73  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0; // Add half exposure duration
74 
75  // Setup detector map
76  new CameraDetectorMap(this);
77 
78  // Setup focal plane map
79  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
80 
81  focalMap->SetDetectorOrigin(
83  "_BORESIGHT_SAMPLE"),
85  "_BORESIGHT_LINE"));
86 
87  // Setup distortion map
88  new RadialDistortionMap(this, 0.0);
89 
90  // Setup the ground and sky map
91  new CameraGroundMap(this);
92  new CameraSkyMap(this);
93 
94  setTime(centerTime);
95  LoadCache();
97  }
98 
122  pair<iTime, iTime> LwirCamera::ShutterOpenCloseTimes(double time,
123  double exposureDuration) {
125  }
126 }
127 
128 
141 extern "C" Isis::Camera *LwirCameraPlugin(Isis::Cube &cube) {
142  return new Isis::LwirCamera(cube);
143 }
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::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
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::FramingCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Definition: FramingCamera.cpp:42
Isis::LwirCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: LwirCamera.cpp:122
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::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::RadialDistortionMap
Definition: RadialDistortionMap.h:18
Isis::iTime::Et
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:126
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::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::LwirCamera
This is the camera model for the Clementine Long-Wavelength Infrared Camera.
Definition: LwirCamera.h:57
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
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::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