Isis 3 Programmer Reference
JunoCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "JunoCamera.h"
10
11#include <QDebug>
12#include <QString>
13
14#include "CameraDetectorMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "CameraGroundMap.h"
17#include "CameraSkyMap.h"
18#include "iTime.h"
19#include "JunoDistortionMap.h"
20#include "NaifStatus.h"
21
22using namespace std;
23
24namespace Isis {
32
33 m_instrumentNameLong = "Juno EPO Camera";
34 m_instrumentNameShort = "JNC"; // or JunoCam?
35
36 m_spacecraftNameLong = "Juno";
37 m_spacecraftNameShort = "Juno";
38
40
41 // Set up the camera characteristics
42 instrumentRotation()->SetFrame( CkFrameId() );
45
46 // Get all the necessary stuff from the labels
47 Pvl &lab = *cube.label();
48 const PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
49
50 // Get summing mode
51 // Summing modes are:
52 // 1 = 1x1 (No summing)
53 // 2 = 2x2
54 int sumMode = (int) inst["SummingMode"];
55 int summing = sumMode;
56
57 // Setup camera detector map
58 CameraDetectorMap *detMap = new CameraDetectorMap(this);
59 if ( summing > 0 ) {
60 detMap->SetDetectorSampleSumming(summing);
61 detMap->SetDetectorLineSumming(summing);
62 }
63
64 // Juno codes
65 int junoCode = naifIkCode();
66 QString juno = toString(junoCode);
67
68 // Setup focal plane map and set Juno detector boresight
69 new CameraFocalPlaneMap(this, junoCode);
70 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, junoCode);
71 double bsSample = getDouble("INS" + juno + "_BORESIGHT_SAMPLE");
72 double bsLine = getDouble("INS" + juno + "_BORESIGHT_LINE");
73 focalMap->SetDetectorOrigin(bsSample, bsLine);
74
75 // Set starting filter location on the detector
76 const PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse);
77 QString filterIkCode = bandBin.findKeyword("NaifIkCode")[0];
78 detMap->SetStartingDetectorLine(getDouble("INS" + filterIkCode + "_FILTER_OFFSET"));
79
80 // Set up distortion map, keeping z-direction positive JunoDistortion map defaults to z+
81 JunoDistortionMap *distortionMap = new JunoDistortionMap(this);
82 distortionMap->SetDistortion(CkFrameId());
83
84 // Setup the ground and sky map
85 new CameraGroundMap(this);
86 new CameraSkyMap(this);
87
88 // Set time based on clock count, frame number, exposure duration, and interframe delay
89 QString startClockCount = inst["SpacecraftClockStartCount"];
90 double observationStartEt = getClockTime(startClockCount).Et(); // in seconds
91 double frameNumber = (double) inst["FrameNumber"];
92 double interFrameDelay = (double) inst["InterFrameDelay"]; // in seconds
93 double exposureDur = ((double) inst["ExposureDuration"]) / 1000.0; // in seconds
94
95 // Get the fixed time biases
96 double startTimeBias = getDouble("INS" + juno + "_START_TIME_BIAS");
97 double interFrameDelayBias = getDouble("INS" + juno + "_INTERFRAME_DELTA");
98
99 // get start et for this frame, in seconds
100 double frameStartEt = observationStartEt + startTimeBias + (frameNumber - 1)
101 * (interFrameDelay + interFrameDelayBias);
102 // Set start time to center of exposure time to ensure the proper SPICE data is cached.
103 setTime(frameStartEt + exposureDur / 2.0);
104
105 LoadCache();
107 }
108
109
115
116
134 pair <iTime, iTime> JunoCamera::ShutterOpenCloseTimes(double time,
135 double exposureDuration) {
136
138 }
139
140
148 return -61500;
149 }
150
151
159 return 1;
160 }
161
162
170 return -61;
171 }
172
173
181 return 1;
182 }
183
184}
185
194extern "C" Isis::Camera *JunoCameraPlugin(Isis::Cube &cube) {
195 return new Isis::JunoCamera(cube);
196}
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.
Juno's JNC (JunoCam) camera model.
Definition JunoCamera.h:35
virtual int CkFrameId() const
Retrieves the CK frame ID for the JunoCam instrument.
virtual int CkReferenceId() const
Retrieves the J2000 CK Reference ID for the JunoCam instrument.
virtual int SpkReferenceId() const
Retrieves the J2000 SPK Reference ID for the JunoCam instrument.
~JunoCamera()
Destroys the JunoCamera object.
JunoCamera(Cube &cube)
Initialize the Juno camera model.
virtual int SpkTargetId() const
Retrieves the SPK Target Body ID for the JunoCam instrument.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Distort/undistort focal plane coordinates for Juno's JunoCam camera.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
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 getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition Spice.cpp:1060
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition Spice.cpp:1634
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 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.