File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
HrscCamera.cpp
1 
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 
24 using namespace std;
25 namespace Isis {
33  HrscCamera::HrscCamera(Cube &cube) : LineScanCamera(cube) {
34  m_instrumentNameLong = "High Resolution Stereo Camera";
35  m_instrumentNameShort = "HRSC";
36  m_spacecraftNameLong = "Mars Express";
37  m_spacecraftNameShort = "MEX";
38 
40  // Setup camera characteristics from instrument and frame kernel
42  SetPixelPitch(0.007);
43  instrumentRotation()->SetFrame(-41210);
44 
45  // Get required keywords from instrument group
46  Pvl &lab = *cube.label();
47  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
48 
49  ReadLineRates(lab.fileName());
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 
59  new CameraFocalPlaneMap(this, naifIkCode());
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.
75  new LineScanCameraGroundMap(this);
76  new LineScanCameraSkyMap(this);
77 
78  LoadCache();
80  }
81 
82 
85  }
86 
87 
94  int HrscCamera::CkFrameId() const {
95  return (-41001);
96  }
97 
98 
106  return (1);
107  }
108 
109 
117  return (1);
118  }
119 
120 
124  void HrscCamera::ReadLineRates(QString filename) {
125  Table timesTable("LineScanTimes", filename);
126 
127  if(timesTable.Records() <= 0) {
128  QString msg = "Table [LineScanTimes] in [";
129  msg += 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 [" + filename + "]";
142  throw IException(IException::Unknown, msg, _FILEINFO_);
143  }
144  }
145 }
146 
147 
158 extern "C" Isis::Camera *HrscCameraPlugin(Isis::Cube &cube) {
159  return new Isis::HrscCamera(cube);
160 }
Isis::LineScanCameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: LineScanCameraSkyMap.h:34
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::HrscCamera::p_lineRates
std::vector< LineRateChange > p_lineRates
Vector of the variable line rates for this camera model.
Definition: HrscCamera.h:73
Isis::HrscCamera
HRSC Camera Model.
Definition: HrscCamera.h:58
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::CameraDetectorMap::SetDetectorSampleSumming
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Definition: CameraDetectorMap.h:108
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::VariableLineScanCameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: VariableLineScanCameraDetectorMap.h:49
Isis::NaifStatus::CheckErrors
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
Isis::Camera
Definition: Camera.h:236
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::Spice::instrumentRotation
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1622
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::HrscCamera::CkFrameId
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
Definition: HrscCamera.cpp:94
Isis::Camera::SetPixelPitch
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1418
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::HrscCamera::CkReferenceId
virtual int CkReferenceId() const
CK Reference ID - J2000.
Definition: HrscCamera.cpp:105
Isis::Table
Class for storing Table blobs information.
Definition: Table.h:61
Isis::LineScanCamera
Generic class for Line Scan Cameras.
Definition: LineScanCamera.h:36
Isis::PvlContainer::fileName
QString fileName() const
Returns the filename used to initialise the Pvl object.
Definition: PvlContainer.h:232
Isis::LineScanCameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: LineScanCameraGroundMap.h:49
Isis::HrscCamera::SpkReferenceId
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
Definition: HrscCamera.cpp:116
Isis::CameraDistortionMap
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:41
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
Isis::HrscCamera::ReadLineRates
void ReadLineRates(QString filename)
Definition: HrscCamera.cpp:124
Isis::Camera::FocalPlaneMap
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
Definition: Camera.cpp:2836
std
Namespace for the standard library.
Isis::Camera::LoadCache
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2420
Isis::Camera::m_instrumentNameShort
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:497
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::Spice::getDouble
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:1039
Isis::Table::Records
int Records() const
Returns the number of records.
Definition: Table.cpp:313
Isis::SpiceRotation::SetFrame
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition: SpiceRotation.cpp:214
Isis::LineScanCamera::DetectorMap
LineScanCameraDetectorMap * DetectorMap()
Returns a pointer to the LineScanCameraDetectorMap object.
Definition: LineScanCamera.h:72
Isis::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
Isis::HrscCamera::~HrscCamera
~HrscCamera()
Destroys the HiriseCamera object.
Definition: HrscCamera.cpp:84
Isis::Camera::SetFocalLength
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1411
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::LineRateChange
Container class for storing timing information for a section of an image.
Definition: VariableLineScanCameraDetectorMap.h:83

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:35