File failed to load: https://isis.astrogeology.usgs.gov/9.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
IssNACamera.cpp
1
6
7/* SPDX-License-Identifier: CC0-1.0 */
8// $Id: IssNACamera.cpp,v 1.6 2009/08/31 15:12:29 slambright Exp $
9#include "IssNACamera.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#include "iTime.h"
22
23using namespace std;
24namespace Isis {
35 m_instrumentNameLong = "Imaging Science Subsystem Narrow Angle";
36 m_instrumentNameShort = "ISSNA";
37 m_spacecraftNameLong = "Cassini Huygens";
38 m_spacecraftNameShort = "Cassini";
39
40 Pvl &lab = *cube.label();
41
42 // Get the filter wheels positions dependent focal length.
43 // If we can not get the focal length for this specific filter wheel combination then
44 // use the default.
45 double focalLength = 0.0;
46 try {
47 PvlGroup bandBin = lab.findGroup("BandBin", Pvl::Traverse);
48 QString key = QString("INS%1_%2_FOCAL_LENGTH").
49 arg(naifIkCode()).arg(bandBin["FilterName"][0]);
50 key = key.replace("/", "_");
51 focalLength = getDouble(key);
52 }
53 catch (IException &firstException) {
54 try {
55 QString key = "INS-82360_DEFAULT_FOCAL_LENGTH";
56 focalLength = getDouble(key);
57 }
58 catch (IException &secondException) {
59 PvlGroup bandBin = lab.findGroup("BandBin", Pvl::Traverse);
61 QString("Unable to find a focal length for the requested Cassini ISS NA "
62 "filter combination [%1] or the default focal length")
63 .arg(bandBin["FilterName"][0]),
64 _FILEINFO_);
65 finalError.append(firstException);
66 finalError.append(secondException);
67 throw finalError;
68 }
69 }
70
72
73 SetFocalLength(focalLength);
76
77 // Get the start time in et
78 PvlGroup inst = lab.findGroup("Instrument", Pvl::Traverse);
79
80 double et = iTime((QString)inst["StartTime"]).Et();
81
82 // divide exposure duration keyword value by 1000 to convert to seconds
83 double exposureDuration = ((double) inst["ExposureDuration"]) / 1000.0;
84 pair<iTime, iTime> shuttertimes = ShutterOpenCloseTimes(et, exposureDuration);
85
86 //correct time for center of exposure duration
87 iTime centerTime = shuttertimes.first.Et() + exposureDuration / 2.0;
88
89 // Setup detector map
90 int summingMode = inst["SummingMode"];
91 CameraDetectorMap *detectorMap = new CameraDetectorMap(this);
92 detectorMap->SetDetectorLineSumming(summingMode);
93 detectorMap->SetDetectorSampleSumming(summingMode);
94
95 // Setup focal plane map
96 CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
97
98 focalMap->SetDetectorOrigin(Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_SAMPLE"),
99 Spice::getDouble("INS" + toString(naifIkCode()) + "_BORESIGHT_LINE"));
100
101 // Setup distortion map
102 double k1 = Spice::getDouble("INS" + toString(naifIkCode()) + "_K1");
103 new RadialDistortionMap(this, k1);
104
105 // Setup the ground and sky map
106 new CameraGroundMap(this);
107 new CameraSkyMap(this);
108
109 setTime(centerTime);
110 LoadCache();
112 }
113
141}
142
143
155extern "C" Isis::Camera *IssNACameraPlugin(Isis::Cube &cube) {
156 return new Isis::IssNACamera(cube);
157}
Convert between parent image coordinates and detector coordinates.
void SetDetectorLineSumming(const double summing)
Set line summing mode.
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
Convert between distorted focal plane and detector coordinates.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
Convert between undistorted focal plane and ground coordinates.
QString m_spacecraftNameLong
Full spacecraft name.
Definition Camera.h:499
virtual double exposureDuration() const
Return the exposure duration for the pixel that the camera is set to.
Definition Camera.cpp:3093
void SetFocalLength()
Reads the focal length from the instrument kernel.
Definition Camera.cpp:1422
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
Definition Camera.cpp:1429
void LoadCache()
This loads the spice cache big enough for this image.
Definition Camera.cpp:2450
QString m_instrumentNameShort
Shortened instrument name.
Definition Camera.h:498
QString m_spacecraftNameShort
Shortened spacecraft name.
Definition Camera.h:500
QString m_instrumentNameLong
Full instrument name.
Definition Camera.h:497
Convert between undistorted focal plane and ra/dec coordinates.
IO Handler for Isis Cubes.
Definition Cube.h:168
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
Definition Cube.cpp:1734
FramingCamera(Cube &cube)
Constructs the FramingCamera object.
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)=0
Returns the shutter open and close times.
Isis exception class.
Definition IException.h:91
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition IException.h:118
void append(const IException &exceptionSource)
Appends the given exception (and its list of previous exceptions) to this exception's causational exc...
Cassini ISS Narrow Angle Camera Model.
Definition IssNACamera.h:67
virtual std::pair< iTime, iTime > ShutterOpenCloseTimes(double time, double exposureDuration)
Returns the shutter open and close times.
IssNACamera(Cube &cube)
Constructs a IssNACamera object using the image labels.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Contains multiple PvlContainers.
Definition PvlGroup.h:41
Container for cube-like labels.
Definition Pvl.h:119
@ Traverse
Search child objects.
Definition PvlObject.h:158
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
Definition PvlObject.h:129
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:99
virtual iTime time() const
Returns the ephemeris time in seconds which was used to obtain the spacecraft and sun positions.
Definition Spice.cpp:891
virtual SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Definition Spice.cpp:1634
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
Definition Spice.cpp:975
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition Spice.cpp:1046
SpiceInt getInteger(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition Spice.cpp:1032
void SetFrame(int frameCode)
Change the frame to the given frame code.
Parse and return pieces of a time string.
Definition iTime.h:65
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
Definition iTime.h:126
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
Namespace for the standard library.