Isis 3 Programmer Reference
KaguyaTcCamera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "KaguyaTcCamera.h"
10#include "KaguyaTcCameraDistortionMap.h"
11
12#include <QString>
13
14#include "LineScanCameraDetectorMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "LineScanCameraGroundMap.h"
17#include "LineScanCameraSkyMap.h"
18#include "IException.h"
19#include "IString.h"
20#include "iTime.h"
21#include "NaifStatus.h"
22
23using namespace std;
24namespace Isis {
34 m_instrumentNameLong = "Terrain Camera";
36 m_spacecraftNameLong = "Kaguya";
37 m_spacecraftNameShort = "Kaguya";
38
40 // Get the camera characteristics
43
44 // Get the start time in et
45 Pvl &lab = *cube.label();
46 PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
47
48 QString clockCount = inst["SpacecraftClockStartCount"];
49 double time = getClockTime(clockCount, -1, true).Et();
50
51 // Setup detector map
52 double lineRate = (double) inst["LineSamplingInterval"] / 1000.0;
53
54 // Convert between parent image coordinates and detector coordinates (detector coordinate line, detector coordinate sample)
55 LineScanCameraDetectorMap *detectorMap = new LineScanCameraDetectorMap(this, time, lineRate);
56
57 // Detetermine what to set the starting detector sample to, based on swath mode
58 QString swathMode = inst["SwathModeId"];
59
60 double startingDetectorSample = 1;
61 if (swathMode.compare("FULL") == 0) {
62 startingDetectorSample = 1;
63 }
64 else if (swathMode.compare("NOMINAL") == 0) {
65 startingDetectorSample = 297;
66 }
67 else if (swathMode.compare("HALF") == 0) {
68 startingDetectorSample = 1172;
69 }
70
71 detectorMap->SetStartingDetectorSample(startingDetectorSample);
72
73 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
74
75 // This sets the origin of the detector (not image samp,line). It is zero bassed.
76 // The detector offsets are 0,0 because the borsight is in the center of the array
77 // The origin of the detector does not depend on swath mode.
78 QString key;
79 key = "INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE";
80 double sampleBoreSight = getDouble(key);
81
82 key = "INS" + toString(naifIkCode()) + "_BORESIGHT_LINE";
83 double lineBoreSight = getDouble(key);
84 focalMap->SetDetectorOrigin(sampleBoreSight, lineBoreSight);
85
86 // Setup distortion map
88
89 // Setup the ground and sky map
91 new LineScanCameraSkyMap(this);
92
94 LoadCache();
96 }
97
101
102
110 return (-131000);
111 }
112
120 return (1);
121 }
122
130 return (1);
131 }
132
133}
134
135
144extern "C" Isis::Camera *KaguyaTcCameraPlugin(Isis::Cube &cube) {
145 return new Isis::KaguyaTcCamera(cube);
146}
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
Distort/undistort focal plane coordinates for Kaguya's TC cameras.
This is the camera model for the Kaguya Terrain Cameras TC1 and TC2.
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
~KaguyaTcCamera()
Destroys the KaguyaTcCamera object.
KaguyaTcCamera(Cube &cube)
Constructor for the Kaguya TC Camera Model.
virtual int CkReferenceId() const
CK Reference ID - J2000.
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
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 getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition Spice.cpp:1060
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
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.