Isis 3 Programmer Reference
IssWACamera.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 // $Id: IssWACamera.cpp,v 1.6 2009/08/31 15:12:29 slambright Exp $
9 #include "IssWACamera.h"
10 
11 #include <QString>
12 
13 #include "CameraDetectorMap.h"
14 #include "CameraFocalPlaneMap.h"
15 #include "CameraGroundMap.h"
16 #include "CameraSkyMap.h"
17 #include "IString.h"
18 #include "iTime.h"
19 #include "NaifStatus.h"
20 #include "RadialDistortionMap.h"
21 
22 using namespace std;
23 
24 namespace Isis {
34  IssWACamera::IssWACamera(Cube &cube) : FramingCamera(cube) {
35  m_instrumentNameLong = "Imaging Science Subsystem Wide Angle";
36  m_instrumentNameShort = "ISSWA";
37  m_spacecraftNameLong = "Cassini Huygens";
38  m_spacecraftNameShort = "Cassini";
39 
41  Pvl &lab = *cube.label();
42  PvlGroup &bandBin = lab.findGroup("BandBin", Pvl::Traverse);
43  // Get the camera characteristics
44  QString key = "INS" + toString(naifIkCode()) + "_" + bandBin["FilterName"][0] + "_FOCAL_LENGTH";
45  key = key.replace("/", "_");
46  double focalLength = Spice::getDouble(key);
47 
48  SetFocalLength(focalLength);
49  SetPixelPitch();
50  instrumentRotation()->SetFrame(Spice::getInteger("INS_" + toString(naifIkCode()) + "_FRAME_ID"));
51 
52 
53  // Get the start time in et
54  PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
55 
56  double et = iTime((QString)inst["StartTime"]).Et();
57 
58  // divide exposure duration keyword value by 1000 to convert to seconds
59  double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
60  pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
61 
62  //correct time for center of exposure duration
63  iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
64 
65  // Setup detector map
66  int summingMode = inst["SummingMode"];
67  CameraDetectorMap *detectorMap = new CameraDetectorMap(this);
68  detectorMap->SetDetectorLineSumming(summingMode);
69  detectorMap->SetDetectorSampleSumming(summingMode);
70 
71  // Setup focal plane map
72  CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
73 
74  focalMap->SetDetectorOrigin(Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE"),
75  Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_LINE"));
76 
77  // Setup distortion map
78  double k1 = Spice::getDouble("INS" + toString(naifIkCode()) + "_K1");
79  new RadialDistortionMap(this, k1);
80 
81  // Setup the ground and sky map
82  new CameraGroundMap(this);
83  new CameraSkyMap(this);
84 
85  setTime(centerTime);
86  LoadCache();
88  }
89 
90 
114  pair<iTime, iTime> IssWACamera::ShutterOpenCloseTimes(double time,
115  double exposureDuration) {
117  }
118 }
119 
120 
132 extern "C" Isis::Camera *IssWACameraPlugin(Isis::Cube &cube) {
133  return new Isis::IssWACamera(cube);
134 }
Isis::CameraFocalPlaneMap::SetDetectorOrigin
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Definition: CameraFocalPlaneMap.cpp:293
Isis::Camera::exposureDuration
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition: Camera.cpp:3063
Isis::Spice::time
iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition: Spice.cpp:884
Isis::PvlObject::findGroup
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition: PvlObject.h:129
Isis::CameraDetectorMap
Convert between parent image coordinates and detector coordinates.
Definition: CameraDetectorMap.h:47
Isis::Spice::naifIkCode
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition: Spice.cpp:968
Isis::iTime
Parse and return pieces of a time string.
Definition: iTime.h:65
Isis::Camera::m_instrumentNameLong
QString m_instrumentNameLong
Full instrument name.
Definition: Camera.h:496
Isis::CameraDetectorMap::SetDetectorSampleSumming
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Definition: CameraDetectorMap.h:108
Isis::Spice::getInteger
SpiceInt getInteger(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:1025
Isis::Pvl
Container for cube-like labels.
Definition: Pvl.h:119
Isis::FramingCamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Definition: FramingCamera.cpp:42
Isis::NaifStatus::CheckErrors
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Definition: NaifStatus.cpp:28
Isis::IssWACamera
Cassini ISS Wide Angle Camera Model.
Definition: IssWACamera.h:64
Isis::Camera
Definition: Camera.h:236
Isis::FramingCamera
Generic class for Framing Cameras.
Definition: FramingCamera.h:32
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::CameraGroundMap
Convert between undistorted focal plane and ground coordinates.
Definition: CameraGroundMap.h:73
Isis::Spice::instrumentRotation
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition: Spice.cpp:1622
Isis::CameraDetectorMap::SetDetectorLineSumming
void SetDetectorLineSumming(const double summing)
Set line summing mode.
Definition: CameraDetectorMap.h:123
Isis::PvlObject::Traverse
@ Traverse
Search child objects.
Definition: PvlObject.h:158
Isis::Sensor::setTime
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:97
Isis::RadialDistortionMap
Definition: RadialDistortionMap.h:18
Isis::iTime::Et
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition: iTime.h:126
Isis::Camera::SetPixelPitch
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition: Camera.cpp:1418
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
Isis::Cube
IO Handler for Isis Cubes.
Definition: Cube.h:167
Isis::Camera::m_spacecraftNameLong
QString m_spacecraftNameLong
Full spacecraft name.
Definition: Camera.h:498
std
Namespace for the standard library.
Isis::Camera::LoadCache
void LoadCache()
This loads the spice cache big enough for this image.
Definition: Camera.cpp:2420
Isis::Camera::m_instrumentNameShort
QString m_instrumentNameShort
Shortened instrument name.
Definition: Camera.h:497
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::Cube::label
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition: Cube.cpp:1701
Isis::CameraSkyMap
Convert between undistorted focal plane and ra/dec coordinates.
Definition: CameraSkyMap.h:31
Isis::IssWACamera::ShutterOpenCloseTimes
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
Definition: IssWACamera.cpp:114
Isis::Spice::getDouble
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition: Spice.cpp:1039
Isis::SpiceRotation::SetFrame
void SetFrame(int frameCode)
Change the frame to the given frame code.
Definition: SpiceRotation.cpp:214
Isis::Camera::m_spacecraftNameShort
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition: Camera.h:499
Isis::Camera::SetFocalLength
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition: Camera.cpp:1411
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16