Isis 3.0 Object Programmers' Reference
Home
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
KaguyaMiCamera.cpp
Go to the documentation of this file.
1
20
#include "
KaguyaMiCamera.h
"
21
22
#include <iomanip>
23
24
#include "
CameraFocalPlaneMap.h
"
25
#include "
IException.h
"
26
#include "
IString.h
"
27
#include "
iTime.h
"
28
#include "
LineScanCameraDetectorMap.h
"
29
#include "
LineScanCameraGroundMap.h
"
30
#include "
LineScanCameraSkyMap.h
"
31
#include "
KaguyaMiCameraDistortionMap.h
"
32
#include "
NaifStatus.h
"
33
34
using namespace
std;
35
namespace
Isis {
44
KaguyaMiCamera::KaguyaMiCamera(
Cube
&cube) :
LineScanCamera
(cube) {
45
NaifStatus::CheckErrors
();
46
// Set up the camera info from ik/iak kernels
47
48
SetFocalLength
();
49
//Kaguya IK kernal uses INS-131???_PIXEL_SIZE instead of PIXEL_PITCH
50
QString ikernKey =
"INS"
+
toString
(
naifIkCode
()) +
"_PIXEL_SIZE"
;
51
SetPixelPitch
(
getDouble
(ikernKey));
52
53
54
// Get the start time from labels
55
Pvl
&lab = *cube.
label
();
56
PvlGroup
&inst = lab.
findGroup
(
"Instrument"
,
Pvl::Traverse
);
57
QString stime = (QString)inst[
"StartTime"
];
58
SpiceDouble etStart=0;
59
60
if
(stime !=
"NULL"
) {
61
etStart =
iTime
(stime).
Et
();
62
}
63
else
{
64
//TODO throw an error if "StartTime" keyword is absent
65
}
66
67
NaifStatus::CheckErrors
();
68
69
70
// Get other info from labels
71
double
lineRate = (double) inst[
"CorrectedSamplingInterval"
] / 1000.0;
72
setTime
(etStart);
73
74
// Setup detector map
75
LineScanCameraDetectorMap
*detectorMap =
new
LineScanCameraDetectorMap
(
this
, etStart, lineRate);
76
detectorMap->
SetDetectorSampleSumming
(1.0);
77
detectorMap->
SetStartingDetectorSample
(1.0);
78
79
// Setup focal plane map
80
CameraFocalPlaneMap
*focalMap =
new
CameraFocalPlaneMap
(
this
,
naifIkCode
());
81
// Retrieve boresight location from instrument kernel (IK) (addendum?)
82
ikernKey =
"INS"
+
toString
(
naifIkCode
()) +
"_CENTER"
;
83
double
sampleBoreSight =
getDouble
(ikernKey,0);
84
double
lineBoreSight =
getDouble
(ikernKey,1)-1.0;
85
86
focalMap->
SetDetectorOrigin
(sampleBoreSight, lineBoreSight);
87
focalMap->
SetDetectorOffset
(0.0, 0.0);
88
89
90
KaguyaMiCameraDistortionMap
*distMap =
new
KaguyaMiCameraDistortionMap
(
this
);
91
//LroNarrowAngleDistortionMap *distMap = new LroNarrowAngleDistortionMap(this);
92
distMap->
SetDistortion
(
naifIkCode
());
93
94
// Setup the ground and sky map
95
new
LineScanCameraGroundMap
(
this
);
96
new
LineScanCameraSkyMap
(
this
);
97
98
LoadCache
();
99
100
NaifStatus::CheckErrors
();
101
}
102
}
103
114
extern
"C"
Isis::Camera
*
KaguyaMiCameraPlugin
(
Isis::Cube
&cube) {
115
return
new
Isis::KaguyaMiCamera
(cube);
116
}