Isis 3 Programmer Reference
MexHrscSrcCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "MexHrscSrcCamera.h"
10
11#include <QString>
12
13#include "CameraDetectorMap.h"
14#include "CameraDistortionMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "CameraGroundMap.h"
17#include "CameraSkyMap.h"
18#include "IString.h"
19#include "iTime.h"
20#include "NaifStatus.h"
21
22using namespace std;
23
24namespace Isis {
36 m_instrumentNameLong = "Super Resolution Channel";
38 m_spacecraftNameLong = "Mars Express";
40
42
43 SetFocalLength(Spice::getDouble("INS" + toString(naifIkCode()) + "_FOCAL_LENGTH"));
44
45 // For setting the pixel pitch, the Naif keyword PIXEL_SIZE is used instead of the ISIS
46 // default of PIXEL_PITCH, so set the value directly.
47 QString pp = "INS" + toString(naifIkCode()) + "_PIXEL_SIZE";
48 double pixelPitch = Spice::getDouble(pp);
49 pixelPitch /= 1000.0;
50 SetPixelPitch(pixelPitch);
51
52 // SRC doesn't appear to use any summing modes
53 CameraDetectorMap *detectorMap = new CameraDetectorMap(this);
54 detectorMap->SetDetectorSampleSumming(1);
55 detectorMap->SetDetectorLineSumming(1);
56
57 // Setup focal plane map. The class will read data from the instrument addendum kernel to pull
58 // out the affine transforms from detector samp,line to focal plane x,y.
59 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
60
61 // The boresight position recorded in the IK is zero-based and therefore needs to be adjusted
62 // for ISIS
63 double boresightSample = Spice::getDouble("INS" + toString(naifIkCode()) + "_CCD_CENTER",0) + 1.0;
64 double boresightLine = Spice::getDouble("INS" + toString(naifIkCode()) + "_CCD_CENTER",1) + 1.0;
65 focalMap->SetDetectorOrigin(boresightSample,boresightLine);
66
67 // The distortion is documented as near 1 pixel at the corners. This is less than the
68 // point spread, so zero distortion is used
69 new CameraDistortionMap(this);
70
71 // Setup the ground and sky map
72 new CameraGroundMap(this);
73 new CameraSkyMap(this);
74
75 // The observation start time and clock count for SRC are based on the center of the exposure.
76 Pvl &lab = *cube.label();
77 PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
78
79 iTime startTime;
80 startTime.setUtc((QString)inst["StartTime"]);
81 setTime(startTime);
82
83 // Internalize all the NAIF SPICE information into memory.
84 LoadCache();
86 }
87
88
100 pair<iTime, iTime> MexHrscSrcCamera::ShutterOpenCloseTimes(double time,
101 double exposureDuration) {
103 }
104}
105
106
115extern "C" Isis::Camera *MexHrscSrcCameraPlugin(Isis::Cube &cube) {
116 return new Isis::MexHrscSrcCamera(cube);
117}
Convert between parent image coordinates and detector coordinates.
Distort/undistort focal plane 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.
This is the camera model for the Mex HRSC SRC Framing Camera.
MexHrscSrcCamera(Cube &cube)
Create a MexHrscSrcCamera object.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Reimplemented from FrameCamera.
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
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
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
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
Namespace for the standard library.