Isis 3 Programmer Reference
ClipperPushBroomCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "ClipperPushBroomCamera.h"
10
11#include "CameraDistortionMap.h"
12#include "CameraFocalPlaneMap.h"
13#include "iTime.h"
14#include "LineScanCameraGroundMap.h"
15#include "LineScanCameraSkyMap.h"
16#include "NaifStatus.h"
17
18namespace Isis {
25
26 m_spacecraftNameLong = "Europa Clipper";
27 m_spacecraftNameShort = "Clipper";
28
29 int frameCode = naifIkCode();
30
31 if (frameCode == -159103) {
32 m_instrumentNameLong = "Europa Imaging System Push Broom Narrow Angle Camera";
33 m_instrumentNameShort = "EIS-PBNAC";
34 }
35 else if (frameCode == -159104) {
36 m_instrumentNameLong = "Europa Imaging System Push Broom Wide Angle Camera";
37 m_instrumentNameShort = "EIS-PBWAC";
38 }
39 else {
40 QString msg = "Unable to construct Clipper Push Broom camera model. "
41 "Unrecognized NaifFrameCode [" + toString(frameCode) + "].";
42 throw IException(IException::User, msg, _FILEINFO_);
43 }
44
46
47 Pvl &lab = *cube.label();
48
49 PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse);
50 QString key = "INS" + toString(naifIkCode()) + "_" + bandBin["FilterName"][0] + "_FOCAL_LENGTH";
52
54
55 PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
56 QString startTime = inst["StartTime"];
57 iTime etStart(startTime);
58
59 ReadLineRates(lab.fileName());
60
61 // set up detector map
63
64 // Set up focal plane map
65 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
66 // center of array (same for WAC and NAC based on XY origin in EIS_Sensor_summary.xlsx)
67 focalMap->SetDetectorOrigin(2048.5, 1024.5);
68
69 // Set up distortion map
70 CameraDistortionMap *distMap = new CameraDistortionMap(this);
71 distMap->SetDistortion(naifIkCode());
72
73 // Set up the ground and sky map
75 new LineScanCameraSkyMap(this);
76
77 setTime(etStart.Et());
78
79 LoadCache();
81 }
82
83
89
90
98 return (-159000);
99 }
100
101
109 return (1);
110 }
111
112
120 return (1);
121 }
122
127 Table timesTable("LineScanTimes", filename);
128
129 if(timesTable.Records() <= 0) {
130 QString msg = "Table [LineScanTimes] in [";
131 msg += filename + "] must not be empty";
132 throw IException(IException::Unknown, msg, _FILEINFO_);
133 }
134
135 for(int i = 0; i < timesTable.Records(); i++) {
136 p_lineRates.push_back(LineRateChange((int)timesTable[i][2],
137 (double)timesTable[i][0],
138 timesTable[i][1]));
139 }
140
141 if(p_lineRates.size() <= 0) {
142 QString msg = "There is a problem with the data within the Table ";
143 msg += "[LineScanTimes] in [" + filename + "]";
144 throw IException(IException::Unknown, msg, _FILEINFO_);
145 }
146 }
147}
148
157extern "C" Isis::Camera *ClipperPushBroomCameraPlugin(Isis::Cube &cube) {
158 return new Isis::ClipperPushBroomCamera(cube);
159}
Distort/undistort focal plane coordinates.
Convert between distorted focal plane and detector coordinates.
QString m_spacecraftNameLong
Full spacecraft name.
Definition Camera.h:499
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
This is the camera model for the Europa Clipper Push Broom Camera.
virtual int CkFrameId() const
CK frame ID - Instrument Code from spacit run on CK.
virtual int CkReferenceId() const
CK Reference ID - J2000.
ClipperPushBroomCamera(Cube &cube)
Constructs a ClipperPushBroomCamera object using the image labels.
std::vector< LineRateChange > p_lineRates
Vector of the variable line rates for this camera model.
~ClipperPushBroomCamera()
Destructor for a ClipperPushBroomCamera object.
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
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
Isis exception class.
Definition IException.h:91
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition IException.h:118
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition IException.h:126
Container class for storing timing information for a section of an image.
Convert between undistorted focal plane and ground coordinates.
Generic class for Line Scan Cameras.
Convert between undistorted focal plane and ra/dec coordinates.
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
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
Class for storing Table blobs information.
Definition Table.h:61
Convert between parent image coordinates and detector coordinates.
Parse and return pieces of a time string.
Definition iTime.h:65
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