Isis 3 Programmer Reference
Chandrayaan1M3Camera.cpp
Go to the documentation of this file.
1 
21 #include "Chandrayaan1M3Camera.h"
22 
23 #include <QString>
24 
26 #include "CameraDistortionMap.h"
27 #include "CameraFocalPlaneMap.h"
28 #include "IException.h"
29 #include "iTime.h"
30 #include "IString.h"
33 #include "LineScanCameraSkyMap.h"
34 #include "NaifStatus.h"
35 
36 using namespace std;
37 namespace Isis {
49  Chandrayaan1M3Camera::Chandrayaan1M3Camera(Cube &cube) : LineScanCamera(cube) {
50  m_instrumentNameLong = "Moon Mineralogy Mapper";
51  m_instrumentNameShort = "M3";
52  m_spacecraftNameLong = "Chandrayaan 1";
53  m_spacecraftNameShort = "Chan1";
54 
56  // Set up the camera info from ik/iak kernels
58  SetPixelPitch();
59 
60  // Get the start time from labels
61  Pvl &lab = *cube.label();
62  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
63  QString stime = inst["SpacecraftClockStartCount"];
64  double etStart = getClockTime(stime).Et();
65 
66  // Get other info from labels
67  double csum = inst["SpatialSumming"];
68  double lineRate = (double) inst["LineExposureDuration"] / 1000.0;
69  //lineRate *= csum;
70 
71  // Setup detector map
72  LineScanCameraDetectorMap *detectorMap =
73  new LineScanCameraDetectorMap(this, etStart, lineRate);
74  detectorMap->SetDetectorSampleSumming(csum);
75 
76  // Setup focal plane map
77  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
78 
79  // Retrieve boresight location from instrument kernel (IK) (addendum?)
80  QString ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_SAMPLE";
81  double sampleBoreSight = getDouble(ikernKey);
82 
83  ikernKey = "INS" + toString((int)naifIkCode()) + "_BORESIGHT_LINE";
84  double lineBoreSight = getDouble(ikernKey);
85 
86  focalMap->SetDetectorOrigin(sampleBoreSight, lineBoreSight);
87  focalMap->SetDetectorOffset(0.0, 0.0);
88 
89  QString ppKey("INS" + toString(naifIkCode()) + "_PP");
90  QString odKey("INS" + toString(naifIkCode()) + "_OD_K");
91  QString decenterKey("INS" + toString(naifIkCode()) + "_DECENTER");
92 
93 
94  // Setup distortion map
96  getDouble(ppKey, 0), getDouble(ppKey, 1),
97  getDouble(odKey, 0), getDouble(odKey, 1), getDouble(odKey, 2),
98  getDouble(decenterKey, 0), getDouble(decenterKey, 1));
99 
100  // Setup the ground and sky map
101  new LineScanCameraGroundMap(this);
102  new LineScanCameraSkyMap(this);
103 
104  LoadCache();
106  }
107 }
108 
109 
119  return new Isis::Chandrayaan1M3Camera(cube);
120 }
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1430
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
void SetDetectorOffset(const double sampleOffset, const double lineOffset)
Set the detector offset.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:507
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1437
Namespace for the standard library.
Generic class for Line Scan Cameras.
Search child objects.
Definition: PvlObject.h:170
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Convert between undistorted focal plane and ground coordinates.
Convert between distorted focal plane and detector coordinates.
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:508
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:893
iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition: Spice.cpp:977
Container for cube-like labels.
Definition: Pvl.h:135
Distortion map for the Chandrayaan1 M3 camera.
Convert between undistorted focal plane and ra/dec coordinates.
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2432
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:509
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1346
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:43
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:510
Isis::Camera * Chandrayaan1M3CameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate an Chandrayaan1M3Camera object...
Chandrayaan1 M3 Camera Model.
Convert between parent image coordinates and detector coordinates.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:139
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:963
IO Handler for Isis Cubes.
Definition: Cube.h:170