Isis 3.0 Programmer Reference
Back | Home
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 }
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1485
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.
SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1476
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:494
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1298
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:1492
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
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 Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:135
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.
Convert between distorted focal plane and detector coordinates.
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:495
void SetTimeBias(double timeBias)
Apply a time bias when invoking SetEphemerisTime method.
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
int CrosstrackSumming() const
Returns value for CrosstrackSumming from the instrument group.
Definition: MocLabels.h:105
A type of error that could only have occurred due to a mistake on the user&#39;s part (e...
Definition: IException.h:134
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:2489
int DowntrackSumming() const
Returns value for DowntrackSumming from the instrument group.
Definition: MocLabels.h:112
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:496
int FirstLineSample() const
Returns value for FirstLineSample from the instrument group.
Definition: MocLabels.h:119
void SetStartingDetectorSample(const double sample)
Set the starting detector sample.
double PixelPitch() const
Returns the pixel pitch.
Definition: Camera.cpp:2804
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:99
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:888
iTime getClockTime(QString clockValue, int sclkCode=-1)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Definition: Spice.cpp:969
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:497
Read values from MOC labels.
Definition: MocLabels.h:63
bool WideAngleRed() const
Indicates whether the camera was red wide angle.
Definition: MocLabels.h:89
double LineRate() const
Returns the value for the true line rate.
Definition: MocLabels.h:136
IO Handler for Isis Cubes.
Definition: Cube.h:158

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:23:45