Isis 3 Programmer Reference
MocWideAngleCamera.cpp
Go to the documentation of this file.
1 
20 #include "MocWideAngleCamera.h"
23 #include "MocLabels.h"
24 
25 #include <QString>
26 
27 #include "CameraFocalPlaneMap.h"
28 #include "IException.h"
29 #include "iTime.h"
31 #include "LineScanCameraSkyMap.h"
32 #include "NaifStatus.h"
33 
34 using namespace std;
35 namespace Isis {
36  // constructors
48  MocWideAngleCamera::MocWideAngleCamera(Cube &cube) : LineScanCamera(cube) {
49  m_instrumentNameLong = "Mars Orbiter Camera Wide Angle";
50  m_instrumentNameShort = "MOC-WA";
51  m_spacecraftNameLong = "Mars Global Surveyor";
52  m_spacecraftNameShort = "MGS";
53 
55  // See if we have a moc camera
56  Pvl &lab = *cube.label();
57  MocLabels *moclab = new MocLabels(cube);
58  double lineRate = moclab->LineRate();
59  double csum = moclab->CrosstrackSumming();
60  double dsum = moclab->DowntrackSumming();
61  double ss = moclab->FirstLineSample();
62  bool isRed = moclab->WideAngleRed();
63 
64  // Set up the camera info from ik/iak kernels
65  // LoadEulerMounting();
67  SetPixelPitch();
68 
69  if(PixelPitch() == 1) {
71  "Cube file needs to be spiceinit'd with updated iak", _FILEINFO_);
72  }
74 
75  // Get the start time from labels
76  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
77  QString stime = inst["SpacecraftClockCount"];
78  double etStart = getClockTime(stime).Et();
79 
80  // Setup detector map
81  MocWideAngleDetectorMap *detectorMap =
82  new MocWideAngleDetectorMap(this, etStart, lineRate, moclab);
83  detectorMap->SetDetectorSampleSumming(csum);
84  detectorMap->SetDetectorLineSumming(dsum);
85  detectorMap->SetStartingDetectorSample(ss);
86 
87  // Setup focal plane map
88  CameraFocalPlaneMap *focalMap =
89  new CameraFocalPlaneMap(this, naifIkCode());
90  if(isRed) {
91  focalMap->SetDetectorOrigin(1674.65, 0.0);
92  focalMap->SetDetectorOffset(0.0, 6.7785);
93  }
94  else {
95  focalMap->SetDetectorOrigin(1688.58, 0.0);
96  focalMap->SetDetectorOffset(0.0, -0.8486);
97  }
98 
99  // Setup distortion map
100  new MocWideAngleDistortionMap(this, isRed);
101 
102  // Setup the ground and sky map
103  new LineScanCameraGroundMap(this);
104  new LineScanCameraSkyMap(this);
105 
106  LoadCache();
108  }
109 }
110 
111 
123  return new Isis::MocWideAngleCamera(cube);
124 }
int CrosstrackSumming() const
Returns value for CrosstrackSumming from the instrument group.
Definition: MocLabels.h:105
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1430
int FirstLineSample() const
Returns value for FirstLineSample from the instrument group.
Definition: MocLabels.h:119
int DowntrackSumming() const
Returns value for DowntrackSumming from the instrument group.
Definition: MocLabels.h:112
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.
MOC Wide Angle Camera Model.
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:507
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1437
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Namespace for the standard library.
Generic class for Line Scan Cameras.
Search child objects.
Definition: PvlObject.h:170
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
double LineRate() const
Returns the value for the true line rate.
Definition: MocLabels.h:136
void SetDetectorLineSumming(const double summing)
Set line summing mode.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Convert between parent image coordinates and detector coordinates.
Convert between undistorted focal plane and ground coordinates.
bool WideAngleRed() const
Indicates whether the camera was red wide angle.
Definition: MocLabels.h:89
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
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:142
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
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2754
Container for cube-like labels.
Definition: Pvl.h:135
Distort/undistort focal plane coordinates.
Isis::Camera * MocWideAngleCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate a MocWideAngleCamera object.
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
Isis exception class.
Definition: IException.h:107
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1489
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:510
Read values from MOC labels.
Definition: MocLabels.h:63
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:139
IO Handler for Isis Cubes.
Definition: Cube.h:170