Isis 3 Programmer Reference
CTXCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "CTXCamera.h"
10
11#include <QString>
12
13#include "CameraDistortionMap.h"
14#include "CameraFocalPlaneMap.h"
15#include "IException.h"
16#include "iTime.h"
17#include "IString.h"
18#include "LineScanCameraDetectorMap.h"
19#include "LineScanCameraGroundMap.h"
20#include "LineScanCameraSkyMap.h"
21#include "NaifStatus.h"
22
23using namespace std;
24namespace Isis {
34 m_instrumentNameLong = "Context Camera";
36 m_spacecraftNameLong = "Mars Reconnaissance Orbiter";
38
40 // Set up the camera info from ik/iak kernels
43
44 Pvl &lab = *cube.label();
45 // Get the start time from labels
46 PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
47 QString stime = inst["SpacecraftClockCount"];
48 double etStart = getClockTime(stime).Et();
49
50 // Get other info from labels
51 double csum = inst["SpatialSumming"];
52 double lineRate = (double) inst["LineExposureDuration"] / 1000.0;
53 lineRate *= csum;
54 double ss = inst["SampleFirstPixel"];
55 ss += 1.0;
56
57 // Setup detector map
58 LineScanCameraDetectorMap *detectorMap =
59 new LineScanCameraDetectorMap(this, etStart, lineRate);
60 detectorMap->SetDetectorSampleSumming(csum);
61 detectorMap->SetStartingDetectorSample(ss);
62
63 // Setup focal plane map
64 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
65
66 // Retrieve boresight location from instrument kernel (IK) (addendum?)
67 QString ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_SAMPLE";
68 double sampleBoreSight = getDouble(ikernKey);
69
70 ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_LINE";
71 double lineBoreSight = getDouble(ikernKey);
72
73 focalMap->SetDetectorOrigin(sampleBoreSight, lineBoreSight);
74 focalMap->SetDetectorOffset(0.0, 0.0);
75
76 // Setup distortion map
77 CameraDistortionMap *distMap = new CameraDistortionMap(this);
78 distMap->SetDistortion(naifIkCode());
79
80 // Setup the ground and sky map
82 new LineScanCameraSkyMap(this);
83
84 LoadCache();
86 }
87}
88
100extern "C" Isis::Camera *CTXCameraPlugin(Isis::Cube &cube) {
101 return new Isis::CTXCamera(cube);
102}
MRO CTX Camera Model.
Definition CTXCamera.h:62
CTXCamera(Cube &cube)
Constructs an MRO CTX Camera object using the image labels.
Definition CTXCamera.cpp:33
Distort/undistort focal plane coordinates.
Convert between distorted focal plane and detector coordinates.
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
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
Convert between parent image coordinates and detector coordinates.
Convert between undistorted focal plane and ground coordinates.
Generic class for Line Scan Cameras.
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.
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
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:1060
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
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.