Isis 3 Programmer Reference
SsiCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "SsiCamera.h"
10
11#include <QString>
12
13#include "CameraDetectorMap.h"
14#include "CameraDistortionMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "CameraGroundMap.h"
17#include "CameraSkyMap.h"
18#include "IString.h"
19#include "iTime.h"
20#include "NaifStatus.h"
21#include "Pvl.h"
22#include "PvlObject.h"
23#include "RadialDistortionMap.h"
24#include "Spice.h"
25
26using namespace std;
27
28namespace Isis {
39 m_instrumentNameLong = "Solid State Imaging System";
41 m_spacecraftNameLong = "Galileo Orbiter";
42 m_spacecraftNameShort = "Galileo";
43
45 // Get the camera characteristics
46 double k1;
47
48 Pvl &lab = *cube.label();
49 iTime removeCoverDate("1994/04/01 00:00:00");
50 iTime imageDate(lab.findKeyword("StartTime", PvlObject::Traverse)[0]);
51 /*
52 * Change the Focal Length and K1 constant based on whether or not the protective cover is on
53 * See "The Direction of the North Pole and the Control Network of Asteroid 951 Gaspra" Icarus 107, 18-22 (1994)
54 */
55 if(imageDate < removeCoverDate) {
56 int code = naifIkCode();
57 QString key = "INS" + toString(code) + "_FOCAL_LENGTH_COVER";
59 k1 = Spice::getDouble("INS" + toString(naifIkCode()) + "_K1_COVER");
60 }
61 else {
63 k1 = Spice::getDouble("INS" + toString(naifIkCode()) + "_K1");
64 }
65
67
68 // Get the start time in et
69 PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
70
71 double et = iTime((QString)inst["StartTime"]).Et();
72
73 //?????????? NEED THESE??????
74 // exposure duration keyword value is measured in seconds
75 double exposureDuration = ((double) inst["ExposureDuration"]);
76 pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
77
78 // Get summation mode
79 double sumMode = inst["Summing"];
80
81 // Setup detector map
82 CameraDetectorMap *detectorMap = new CameraDetectorMap(this);
83 detectorMap->SetDetectorSampleSumming(sumMode);
84 detectorMap->SetDetectorLineSumming(sumMode);
85
86 // Setup focal plane map
87 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
88
89 focalMap->SetDetectorOrigin(
91 "_BORESIGHT_SAMPLE"),
93 "_BORESIGHT_LINE"));
94
95 // Setup distortion map
96 new RadialDistortionMap(this, k1);
97
98 // Setup the ground and sky map
99 new CameraGroundMap(this);
100 new CameraSkyMap(this);
101
102 setTime(et);
103 LoadCache();
105 }
106
128 pair<iTime, iTime> SsiCamera::ShutterOpenCloseTimes(double time,
129 double exposureDuration) {
130 pair <iTime, iTime> shuttertimes;
131 // To get shutter start (open) time, subtract half exposure duration
132 shuttertimes.first = time - (exposureDuration / 2.0);
133 // To get shutter end (close) time, add half exposure duration
134 shuttertimes.second = time + (exposureDuration / 2.0);
135 return shuttertimes;
136 }
137}
138
139
151extern "C" Isis::Camera *SsiCameraPlugin(Isis::Cube &cube) {
152 return new Isis::SsiCamera(cube);
153}
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.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
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
This is the camera model for the Galileo Solid State Imaging Camera.
Definition SsiCamera.h:54
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
SsiCamera(Cube &cube)
Constructs a SsiCamera object using the image labels.
Definition SsiCamera.cpp:38
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.