File failed to load: https://isis.astrogeology.usgs.gov/9.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
ClipperPushBroomCamera.cpp
1
6
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
60
61 // set up detector map
63
64 // Turn off the aberration corrections for the instrument position object
66
67 // Set up focal plane map
68 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
69 // center of array (same for WAC and NAC based on XY origin in EIS_Sensor_summary.xlsx)
70 focalMap->SetDetectorOrigin(2047.5, 0.5);
71
72 // Can be +/- 1024 pixel offset
73 // Detector offset from label is 0 - 2047 but ISIS is zero based
74 // with the detector offset being +/- 1024 pixels (2048/2)
75 // Double check this against the SIS
76 double detectorOffset = -(toDouble(inst["DetectorOffset"]) - 1024.0);
77 focalMap->SetDetectorOffset(0.0, detectorOffset);
78
79 // Set up distortion map
80 CameraDistortionMap *distMap = new CameraDistortionMap(this);
81 distMap->SetDistortion(naifIkCode());
82
83 // Set up the ground and sky map
85 new LineScanCameraSkyMap(this);
86
87 setTime(etStart.Et());
88
89 LoadCache();
91 }
92
93
99
100
108 return (-159000);
109 }
110
111
119 return (1);
120 }
121
122
130 return (1);
131 }
132
137 Table timesTable("LineScanTimes", filename);
138
139 if(timesTable.Records() <= 0) {
140 QString msg = "Table [LineScanTimes] in [";
141 msg += filename + "] must not be empty";
142 throw IException(IException::Unknown, msg, _FILEINFO_);
143 }
144
145 for(int i = 0; i < timesTable.Records(); i++) {
146 p_lineRates.push_back(LineRateChange((int)timesTable[i][2],
147 (double)timesTable[i][0],
148 timesTable[i][1]));
149 }
150
151 if(p_lineRates.size() <= 0) {
152 QString msg = "There is a problem with the data within the Table ";
153 msg += "[LineScanTimes] in [" + filename + "]";
154 throw IException(IException::Unknown, msg, _FILEINFO_);
155 }
156 }
157}
158
167extern "C" Isis::Camera *ClipperPushBroomCameraPlugin(Isis::Cube &cube) {
168 return new Isis::ClipperPushBroomCamera(cube);
169}
Distort/undistort focal plane coordinates.
virtual void SetDistortion(int naifIkCode)
Load distortion coefficients.
Convert between distorted focal plane and detector coordinates.
void SetDetectorOffset(const double sampleOffset, const double lineOffset)
Set the detector offset.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
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:1734
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.
LineScanCamera(Isis::Cube &cube)
Constructs the LineScanCamera object.
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.
QString fileName() const
Returns the filename used to initialise the Pvl object.
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition PvlObject.h:129
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 SpicePosition * instrumentPosition() const
Accessor method for the instrument position.
Definition Spice.cpp:1612
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
virtual void SetAberrationCorrection(const QString &correction)
Set the aberration correction (light time)
Class for storing Table blobs information.
Definition Table.h:61
int Records() const
Returns the number of records.
Definition Table.cpp:371
Convert between parent image coordinates and detector coordinates.
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
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition IString.cpp:149