Isis 3 Programmer Reference
Chandrayaan1M3Camera.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "Chandrayaan1M3Camera.h"
10
11#include <QString>
12
13#include "Chandrayaan1M3DistortionMap.h"
14#include "CameraDistortionMap.h"
15#include "CameraFocalPlaneMap.h"
16#include "IException.h"
17#include "iTime.h"
18#include "IString.h"
19#include "LineScanCameraDetectorMap.h"
20#include "LineScanCameraGroundMap.h"
21#include "LineScanCameraSkyMap.h"
22#include "NaifStatus.h"
23
24using namespace std;
25namespace Isis {
38 m_instrumentNameLong = "Moon Mineralogy Mapper";
40 m_spacecraftNameLong = "Chandrayaan 1";
41 m_spacecraftNameShort = "Chan1";
42
44 // Set up the camera info from ik/iak kernels
47
48 // Get the start time from labels
49 Pvl &lab = *cube.label();
50 PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
51 QString stime = inst["SpacecraftClockStartCount"];
52 double etStart = getClockTime(stime).Et();
53
54 // Get other info from labels
55 double csum = inst["SpatialSumming"];
56 double lineRate = (double) inst["LineExposureDuration"] / 1000.0;
57 //lineRate *= csum;
58
59 // Setup detector map
60 LineScanCameraDetectorMap *detectorMap =
61 new LineScanCameraDetectorMap(this, etStart, lineRate);
62 detectorMap->SetDetectorSampleSumming(csum);
63
64 // Setup focal plane map
65 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
66
67 // Retrieve boresight location from instrument kernel (IK) (addendum?)
68 QString ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_SAMPLE";
69 double sampleBoreSight = getDouble(ikernKey);
70
71 ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_LINE";
72 double lineBoreSight = getDouble(ikernKey);
73
74 focalMap->SetDetectorOrigin(sampleBoreSight, lineBoreSight);
75 focalMap->SetDetectorOffset(0.0, 0.0);
76
77 QString ppKey("INS" + toString(naifIkCode()) + "_PP");
78 QString odKey("INS" + toString(naifIkCode()) + "_OD_K");
79 QString decenterKey("INS" + toString(naifIkCode()) + "_DECENTER");
80
81
82 // Setup distortion map
84 getDouble(ppKey, 0), getDouble(ppKey, 1),
85 getDouble(odKey, 0), getDouble(odKey, 1), getDouble(odKey, 2),
86 getDouble(decenterKey, 0), getDouble(decenterKey, 1));
87
88 // Setup the ground and sky map
90 new LineScanCameraSkyMap(this);
91
92 LoadCache();
94 }
95}
96
97
106extern "C" Isis::Camera *Chandrayaan1M3CameraPlugin(Isis::Cube &cube) {
107 return new Isis::Chandrayaan1M3Camera(cube);
108}
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
Chandrayaan1 M3 Camera Model.
Distortion map for the Chandrayaan1 M3 camera.
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
Chandrayaan1M3Camera(Cube &cube)
Constructs a Chandrayaan 1 M3 Camera object using the image labels.
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.