Official websites use .gov
A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS
A lock ( ) or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Isis 3 Programmer Reference
HrscCamera.cpp
1
6
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "HrscCamera.h"
10
11#include <string>
12
13#include <QString>
14
15#include "CameraDistortionMap.h"
16#include "CameraFocalPlaneMap.h"
17#include "iTime.h"
18#include "LineScanCameraGroundMap.h"
19#include "LineScanCameraSkyMap.h"
20#include "NaifStatus.h"
21#include "Statistics.h"
22#include "VariableLineScanCameraDetectorMap.h"
23
24using namespace std;
25namespace Isis {
34 m_instrumentNameLong = "High Resolution Stereo Camera";
35 m_instrumentNameShort = "HRSC";
36 m_spacecraftNameLong = "Mars Express";
38
40 // Setup camera characteristics from instrument and frame kernel
42 SetPixelPitch(0.007);
44
45 ReadLineRates(cube);
46
47 // Get required keywords from instrument group
48 Pvl &lab = *cube.label();
49 PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
50
51 // Setup detector map for transform of image pixels to detector position
53 DetectorMap()->SetDetectorSampleSumming(inst["Summing"]);
54
55 // Setup focal plane map for transform of detector position to
56 // focal plane x/y. This will read the appropriate CCD
57 // transformation coefficients from the instrument kernel
58
60
61 QString ikernKey = "INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE";
62 double sampleBoresight = getDouble(ikernKey);
63
64 ikernKey = "INS" + toString(naifIkCode()) + "_BORESIGHT_LINE";
65 double lineBoresight = getDouble(ikernKey);
66
67 FocalPlaneMap()->SetDetectorOrigin(sampleBoresight, lineBoresight);
68
69 // Setup distortion map. This will read the optical distortion
70 // coefficients from the instrument kernel
71 new CameraDistortionMap(this);
72
73 // Setup the ground and sky map to transform undistorted focal
74 // plane x/y to lat/lon or ra/dec respectively.
76 new LineScanCameraSkyMap(this);
77
78 LoadCache();
80 }
81
82
86
87
95 return (-41001);
96 }
97
98
106 return (1);
107 }
108
109
117 return (1);
118 }
119
120
125 Table timesTable = cube.readTable("LineScanTimes");
126
127 if(timesTable.Records() <= 0) {
128 QString msg = "Table [LineScanTimes] in [";
129 msg += cube.fileName() + "] must not be empty";
130 throw IException(IException::Unknown, msg, _FILEINFO_);
131 }
132
133 for(int i = 0; i < timesTable.Records(); i++) {
134 p_lineRates.push_back(LineRateChange((int)timesTable[i][2],
135 (double)timesTable[i][0],
136 timesTable[i][1]));
137 }
138
139 if(p_lineRates.size() <= 0) {
140 QString msg = "There is a problem with the data within the Table ";
141 msg += "[LineScanTimes] in [" + cube.fileName() + "]";
142 throw IException(IException::Unknown, msg, _FILEINFO_);
143 }
144 }
145}
146
147
158extern "C" Isis::Camera *HrscCameraPlugin(Isis::Cube &cube) {
159 return new Isis::HrscCamera(cube);
160}
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Distort/undistort focal plane coordinates.
Convert between distorted focal plane and detector coordinates.
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
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition Camera.cpp:2866
QString m_instrumentNameLong
Full instrument name.
Definition Camera.h:497
IO Handler for Isis Cubes.
Definition Cube.h:168
Table readTable(const QString &name)
Read a Table from the cube.
Definition Cube.cpp:1200
virtual QString fileName() const
Returns the opened cube's filename.
Definition Cube.cpp:1837
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:1975
HRSC Camera Model.
Definition HrscCamera.h:58
HrscCamera(Cube &cube)
Creates a HrscCamera Camera Model.
~HrscCamera()
Destroys the HiriseCamera object.
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
virtual int CkReferenceId() const
CK Reference ID - J2000.
void ReadLineRates(Cube &cube)
std::vector< LineRateChange > p_lineRates
Vector of the variable line rates for this camera model.
Definition HrscCamera.h:73
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
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.
LineScanCameraDetectorMap * DetectorMap()
Returns a pointer to the LineScanCameraDetectorMap 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.
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition Spice.cpp:1844
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition Spice.cpp:1185
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition Spice.cpp:1256
void SetFrame(int frameCode)
Change the frame to the given frame code.
Convert between parent image coordinates and detector coordinates.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(const LinearAlgebra::Vector &vector, int precision)
A global function to format LinearAlgebra::Vector as a QString with the given precision.
Namespace for the standard library.