Isis 3 Programmer Reference
MocNarrowAngleCamera.cpp
Go to the documentation of this file.
1 
20 #include "MocNarrowAngleCamera.h"
21 
22 #include <QString>
23 
24 #include "CameraDistortionMap.h"
25 #include "CameraFocalPlaneMap.h"
26 #include "IException.h"
27 #include "IString.h"
28 #include "iTime.h"
31 #include "LineScanCameraSkyMap.h"
32 #include "NaifStatus.h"
33 
34 using namespace std;
35 namespace Isis {
44  MocNarrowAngleCamera::MocNarrowAngleCamera(Cube &cube) : LineScanCamera(cube) {
45  m_instrumentNameLong = "Mars Orbiter Camera Narrow Angle";
46  m_instrumentNameShort = "MOC-NA";
47  m_spacecraftNameLong = "Mars Global Surveyor";
48  m_spacecraftNameShort = "MGS";
49 
51  // Set up the camera info from ik/iak kernels
52  // LoadEulerMounting();
54  SetPixelPitch();
56 
57  // Get the start time from labels
58  Pvl &lab = *cube.label();
59  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
60  QString stime = inst["SpacecraftClockCount"];
61  double etStart = getClockTime(stime).Et();
62 
63  // Get other info from labels
64  double csum = inst["CrosstrackSumming"];
65  double dsum = inst["DowntrackSumming"];
66  double lineRate = (double) inst["LineExposureDuration"] / 1000.0;
67  lineRate *= dsum;
68  double ss = inst["FirstLineSample"];
69 
70  // Setup detector map
71  LineScanCameraDetectorMap *detectorMap =
72  new LineScanCameraDetectorMap(this, etStart, lineRate);
73  detectorMap->SetDetectorSampleSumming(csum);
74  detectorMap->SetDetectorLineSumming(dsum);
75  detectorMap->SetStartingDetectorSample(ss);
76 
77  // Setup focal plane map
78  CameraFocalPlaneMap *focalMap =
79  new CameraFocalPlaneMap(this, naifIkCode());
80  focalMap->SetDetectorOrigin(1024.5, 0.0);
81  focalMap->SetDetectorOffset(0.0, 0.0);
82 
83  // Setup distortion map
84  new CameraDistortionMap(this);
85 
86  // Setup the ground and sky map
87  new LineScanCameraGroundMap(this);
88  new LineScanCameraSkyMap(this);
89 
90  LoadCache();
92  }
93 }
94 
95 
106  return new Isis::MocNarrowAngleCamera(cube);
107 }
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.
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.
Isis::Camera * MocNarrowAngleCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate a MocNarrowAngleCamera object...
Search child objects.
Definition: PvlObject.h:170
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
void SetDetectorLineSumming(const double summing)
Set line summing mode.
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
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
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
Distort/undistort focal plane coordinates.
Container for cube-like labels.
Definition: Pvl.h:135
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
void SetStartingDetectorSample(const double sample)
Set the starting detector sample.
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
SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1489
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:510
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
MOC Narrow Angle Camera Model.
IO Handler for Isis Cubes.
Definition: Cube.h:170