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 
22 using namespace std;
23 
24 namespace Isis {
35  MexHrscSrcCamera::MexHrscSrcCamera(Cube &cube) : FramingCamera(cube) {
36  m_instrumentNameLong = "Super Resolution Channel";
37  m_instrumentNameShort = "SRC";
38  m_spacecraftNameLong = "Mars Express";
39  m_spacecraftNameShort = "MEX";
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  QString clockCount = inst["SpacecraftClockStartCount"];
79  double et = getClockTime(clockCount).Et();
80  double exposureDuration = (double)inst["ExposureDuration"] / 1000.0;
81 
82  pair<iTime, iTime> startStop = ShutterOpenCloseTimes(et, exposureDuration);
83  setTime(et);
84 
85  // Internalize all the NAIF SPICE information into memory.
86  LoadCache();
88  }
89 
101  pair<iTime, iTime> MexHrscSrcCamera::ShutterOpenCloseTimes(double time,
102  double exposureDuration) {
104  }
105 }
106 
115 extern "C" Isis::Camera *MexHrscSrcCameraPlugin(Isis::Cube &cube) {
116  return new Isis::MexHrscSrcCamera(cube);
117 }
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::Camera::exposureDuration
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3063
Isis::Spice::time
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition: Spice.cpp:884
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::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
Isis::MexHrscSrcCamera
This is the camera model for the Mex HRSC SRC Framing Camera.
Definition: MexHrscSrcCamera.h:29
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::MexHrscSrcCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Reimplemented from FrameCamera.
Definition: MexHrscSrcCamera.cpp:101
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::Spice::getClockTime
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition: Spice.cpp:1053
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::FramingCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Definition: FramingCamera.cpp:42
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::FramingCamera
Generic class for Framing Cameras.
Definition: FramingCamera.h:32
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::CameraDetectorMap::SetDetectorLineSumming
void SetDetectorLineSumming(const double summing)
Set line summing mode.
Definition: CameraDetectorMap.h:123
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Sensor::setTime
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:97
Isis::iTime::Et
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:126
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::CameraDistortionMap
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:41
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
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::CameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:31
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::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
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