Isis 3 Programmer Reference
UvvisCamera.cpp
Go to the documentation of this file.
1 
21 #include "UvvisCamera.h"
22 
23 #include <QString>
24 
25 #include "CameraDetectorMap.h"
26 #include "CameraFocalPlaneMap.h"
27 #include "CameraGroundMap.h"
28 #include "CameraSkyMap.h"
30 #include "IString.h"
31 #include "iTime.h"
32 #include "NaifStatus.h"
33 
34 using namespace std;
35 
36 namespace Isis {
46  UvvisCamera::UvvisCamera(Cube &cube) : FramingCamera(cube) {
47  m_instrumentNameLong = "Ultraviolet Visible Camera";
48  m_instrumentNameShort = "UVVIS";
49  m_spacecraftNameLong = "Clementine 1";
50  m_spacecraftNameShort = "Clementine1";
51 
53  // Get the camera characteristics
55  SetPixelPitch();
56 
57  // Get the start time in et
58  Pvl &lab = *cube.label();
59  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
60 
61  // set variables startTime and exposureDuration
62  double time = iTime((QString)inst["StartTime"]).Et();
63 
64  // divide exposure duration keyword value by 1000 to convert to seconds
65  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
66  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(time, exposureDuration);
67  // Add half exposure duration to get time at center of image
68  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
69 
70  // Setup detector map
71  new CameraDetectorMap(this);
72 
73  // Setup focal plane map
74  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
75 
76  focalMap->SetDetectorOrigin(
78  "_BORESIGHT_SAMPLE"),
80  "_BORESIGHT_LINE"));
81 
82  QString ppKey("INS" + toString(naifIkCode()) + "_PP");
83  QString odKey("INS" + toString(naifIkCode()) + "_OD_K");
84  QString decenterKey("INS" + toString(naifIkCode()) + "_DECENTER");
85 
86  // Setup distortion map
88  getDouble(ppKey, 0), getDouble(ppKey, 1),
89  getDouble(odKey, 0), getDouble(odKey, 1), getDouble(odKey, 2),
90  getDouble(decenterKey, 0), getDouble(decenterKey, 1));
91 
92 
93 
94  // Setup the ground and sky map
95  new CameraGroundMap(this);
96  new CameraSkyMap(this);
97 
98  setTime(centerTime);
99  LoadCache();
101  }
102 
103 
126  pair<iTime, iTime> UvvisCamera::ShutterOpenCloseTimes(double time,
127  double exposureDuration) {
129  }
130 }
131 
132 
145  return new Isis::UvvisCamera(cube);
146 }
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
Parse and return pieces of a time string.
Definition: iTime.h:78
Isis::Camera * UvvisCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate a UvvisCamera object. ...
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:507
This is the camera model for the Clementine Ultraviolet/Visible Camera.
Definition: UvvisCamera.h:80
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1437
Namespace for the standard library.
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.
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.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
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
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
Distortion map for the Clementine UVVIS camera.
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: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
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
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:48
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:510
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3075
Generic class for Framing Cameras.
Definition: FramingCamera.h:48
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:139
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:963
IO Handler for Isis Cubes.
Definition: Cube.h:170
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions...
Definition: Spice.cpp:809