Isis 3.0 Programmer Reference
Back | Home
RosettaOsirisCamera.cpp
Go to the documentation of this file.
1 
21 #include "RosettaOsirisCamera.h"
22 
23 #include "CameraDetectorMap.h"
24 #include "CameraDistortionMap.h"
25 #include "CameraFocalPlaneMap.h"
26 #include "CameraGroundMap.h"
27 #include "CameraSkyMap.h"
28 #include "IString.h"
29 #include "iTime.h"
30 #include "NaifStatus.h"
31 
32 using namespace std;
33 
34 namespace Isis {
47  RosettaOsirisCamera::RosettaOsirisCamera(Cube &cube) : FramingCamera(cube) {
48  m_instrumentNameLong = "Optical, Spectroscopic, and Infrared Remote Imaging System";
49  m_instrumentNameShort = "OSIRIS";
50  m_spacecraftNameLong = "Rosetta";
51  m_spacecraftNameShort = "Rosetta";
52 
54 
55  // The Osiris focal length is fixed and is designed not to change throught the operational
56  // temperature. For OSIRIS, the focal length is in mm, so we shouldn't need the unit conversion
57 
58  QString ikCode = toString(naifIkCode());
59 
60  QString fl = "INS" + ikCode + "_FOCAL_LENGTH";
61  double focalLength = Spice::getDouble(fl);
62  SetFocalLength(focalLength);
63 
64  // For setting the pixel pitch, the Naif keyword PIXEL_SIZE is used instead of the ISIS
65  // default of PIXEL_PITCH, so set the value directly. Needs to be converted from microns to mm.
66  QString pp = "INS" + ikCode + "_PIXEL_SIZE";
67 
68  double pixelPitch = Spice::getDouble(pp);
69  pixelPitch /= 1000.0;
70  SetPixelPitch(pixelPitch);
71 
72  // Setup focal plane map. The class will read data from the instrument addendum kernel to pull
73  // out the affine transforms from detector samp,line to focal plane x,y.
74  // cout << "Setting up FocalPlaneMap...\n";
75  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
76 
77  // The boresight position recorded in the IK is zero-based and therefore needs to be adjusted
78  // for ISIS
79  // Don't know if this is true for OSIRIS. For now, we'll keep as is and see if things look off -Sasha
80  double boresightSample = Spice::getDouble("INS" + ikCode + "_BORESIGHT",0) + 1.0;
81  double boresightLine = Spice::getDouble("INS" + ikCode + "_BORESIGHT",1) + 1.0;
82  focalMap->SetDetectorOrigin(boresightSample,boresightLine); //Presumably, don't need to worry about z (?)
83 
84  new CameraDetectorMap(this);
85  new CameraDistortionMap(this);
86 
87  // Setup the ground and sky map
88  new CameraGroundMap(this);
89  new CameraSkyMap(this);
90 
91  // Setup clock start and stop times.
92  Pvl &lab = *cube.label();
93  PvlGroup &inst = lab.findGroup("Instrument", Pvl::Traverse);
94  QString clockStartCount = inst["SpacecraftClockStartCount"];
95  double start = getClockTime(clockStartCount).Et();
96  // QString clockStopCount = inst["SpacecraftClockStopCount"];
97  // double stop = getClockTime(clockStopCount).Et();
98  double exposureTime = (double) inst["ExposureDuration"];
99 
100  iTime centerTime = start + (exposureTime / 2.0);
101  setTime( centerTime );
102 
103  // Internalize all the NAIF SPICE information into memory.
104  LoadCache();
106 
107  return;
108  }
109 
125  /* This should not be an issue with the Osiris cameras, so this can likely be deleted.
126  It has been left here just in case something of importance in it was missed. -Sasha
127  */
128  pair<iTime, iTime> RosettaOsirisCamera::ShutterOpenCloseTimes(double time,
129  double exposureDuration) {
130  return FramingCamera::ShutterOpenCloseTimes(time, exposureDuration);
131  }
132 }
133 
146  return new Isis::RosettaOsirisCamera(cube);
147 }
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1485
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Isis::Camera * RosettaOsirisCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate an OsirisNacCamera object.
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:141
Parse and return pieces of a time string.
Definition: iTime.h:74
This is the camera model for the Osiris NAC Framing Camera.
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:494
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1298
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1492
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.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:135
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
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
Contains multiple PvlContainers.
Definition: PvlGroup.h:57
Distort/undistort focal plane coordinates.
void setTime(const iTime &time)
By setting the time you essential set the position of the spacecraft and body as indicated in the cla...
Definition: Sensor.cpp:112
Container for cube-like labels.
Definition: Pvl.h:135
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2489
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:496
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:43
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
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:47
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:497
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Reimplemented from FrameCamera.
Generic class for Framing Cameras.
Definition: FramingCamera.h:48
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:958
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:28:30