11#include "MarciCamera.h"
12#include "MarciDistortionMap.h"
16#include "CameraFocalPlaneMap.h"
17#include "CameraSkyMap.h"
18#include "IException.h"
20#include "NaifStatus.h"
21#include "PushFrameCameraDetectorMap.h"
22#include "PushFrameCameraGroundMap.h"
47 if(inst[
"InstrumentId"][0] !=
"Marci") {
48 string msg =
"The image does not appear to be a Marci Image";
61 int sumMode = inst[
"SummingMode"];
65 QString stime = inst[
"SpacecraftClockCount"];
71 map<QString, int> filterToDetectorOffset;
72 filterToDetectorOffset.insert(pair<QString, int>(
"BLUE", 709));
73 filterToDetectorOffset.insert(pair<QString, int>(
"GREEN", 734));
74 filterToDetectorOffset.insert(pair<QString, int>(
"ORANGE", 760));
75 filterToDetectorOffset.insert(pair<QString, int>(
"RED", 786));
76 filterToDetectorOffset.insert(pair<QString, int>(
"NIR", 811));
77 filterToDetectorOffset.insert(pair<QString, int>(
"LONG_UV", 266));
78 filterToDetectorOffset.insert(pair<QString, int>(
"SHORT_UV", 293));
80 map<QString, int> filterToFilterNumbers;
81 filterToFilterNumbers.insert(pair<QString, int>(
"BLUE", 0));
82 filterToFilterNumbers.insert(pair<QString, int>(
"GREEN", 1));
83 filterToFilterNumbers.insert(pair<QString, int>(
"ORANGE", 2));
84 filterToFilterNumbers.insert(pair<QString, int>(
"RED", 3));
85 filterToFilterNumbers.insert(pair<QString, int>(
"NIR", 4));
86 filterToFilterNumbers.insert(pair<QString, int>(
"LONG_UV", 5));
87 filterToFilterNumbers.insert(pair<QString, int>(
"SHORT_UV", 6));
89 int frameletOffsetFactor = inst[
"ColorOffset"];
91 if((
int)inst[
"DataFlipped"] != 0) frameletOffsetFactor *= -1;
92 map<QString, int> filterToFrameletOffset;
93 filterToFrameletOffset.insert(pair<QString, int>(
"NIR", 0 * frameletOffsetFactor));
94 filterToFrameletOffset.insert(pair<QString, int>(
"RED", 1 * frameletOffsetFactor));
95 filterToFrameletOffset.insert(pair<QString, int>(
"ORANGE", 2 * frameletOffsetFactor));
96 filterToFrameletOffset.insert(pair<QString, int>(
"GREEN", 3 * frameletOffsetFactor));
97 filterToFrameletOffset.insert(pair<QString, int>(
"BLUE", 4 * frameletOffsetFactor));
98 filterToFrameletOffset.insert(pair<QString, int>(
"LONG_UV", 5 * frameletOffsetFactor));
99 filterToFrameletOffset.insert(pair<QString, int>(
"SHORT_UV", 6 * frameletOffsetFactor));
103 const PvlKeyword &filtNames = bandBin[
"FilterName"];
105 for(
int i = 0; i < filtNames.size(); i++) {
106 if(filterToDetectorOffset.find(filtNames[i]) == filterToDetectorOffset.end()) {
107 QString msg =
"Unrecognized filter name [" + filtNames[i] +
"]";
111 p_detectorStartLines.push_back(filterToDetectorOffset.find(filtNames[i])->second);
112 p_filterNumbers.push_back(filterToFilterNumbers.find(filtNames[i])->second);
113 p_frameletOffsets.push_back(filterToFrameletOffset.find(filtNames[i])->second);
120 dmap->SetDetectorSampleSumming(sumMode);
121 dmap->SetDetectorLineSumming(sumMode);
122 dmap->SetFrameletsGeometricallyFlipped(
false);
125 bool flippedFramelets = (int)inst[
"DataFlipped"] != 0;
126 dmap->SetFrameletOrderReversed(flippedFramelets, numFramelets);
147 bool evenFramelets = (inst[
"Framelets"][0] ==
"Even");
156 else if(sumMode == 2) {
159 else if(sumMode == 4) {
182 int maxVirtualBands = min(p_detectorStartLines.size(), p_frameletOffsets.size());
184 if (((vband <= 0) || (vband > maxVirtualBands)) && (vband >
Bands())) {
186 mess <<
"Requested virtual band (" << vband
187 <<
") outside valid (BandBin/Center) limits (1 - " << maxVirtualBands
194 if ((vband > maxVirtualBands) && (vband <=
Bands())) {
203 dmap->SetFrameletOffset(p_frameletOffsets.at(vband-1));
206 distmap->SetFilter(p_filterNumbers.at(vband-1));
Convert between distorted focal plane and detector coordinates.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
QString m_spacecraftNameLong
Full spacecraft name.
int ParentLines() const
Returns the number of lines in the parent alphacube.
void SetGeometricTilingHint(int startSize=128, int endSize=8)
This method sets the best geometric tiling size for projecting from this camera model.
void SetFocalLength()
Reads the focal length from the instrument kernel.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
void LoadCache()
This loads the spice cache big enough for this image.
QString m_instrumentNameShort
Shortened instrument name.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
QString m_spacecraftNameShort
Shortened spacecraft name.
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
virtual void SetBand(const int band)
Virtual method that sets the band number.
QString m_instrumentNameLong
Full instrument name.
int Bands() const
Returns the number of bands in the image.
Convert between undistorted focal plane and ra/dec coordinates.
IO Handler for Isis Cubes.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
@ Programmer
This error is for when a programmer made an API call that was illegal.
Adds specific functionality to C++ strings.
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
int p_nframelets
Number of framelets in whole image.
double p_interframeDelay
Interframe Delay value from labels.
double p_etStart
Ephemeris Start iTime.
void SetBand(const int band)
Sets the band in the camera model.
virtual int CkReferenceId() const
CK Reference ID - MRO_MME_OF_DATE.
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
MarciCamera(Cube &cube)
Constructor for the Marci Camera Model.
~MarciCamera()
Destroys the Themis Vis Camera object.
bool IsBandIndependent()
The camera model is band dependent, so this method returns false.
double p_exposureDur
Exposure Duration value from labels.
Distort/undistort focal plane coordinates.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
Convert between parent image coordinates and detector coordinates.
void SetBandFirstDetectorLine(int firstLine)
Change the starting line in the detector based on band.
Convert between undistorted focal plane and ground coordinates.
Generic class for Push Frame Cameras.
PushFrameCameraDetectorMap * DetectorMap()
Returns a pointer to the PushFrameCameraDetectorMap object.
Contains multiple PvlContainers.
Container for cube-like labels.
A single keyword-value pair.
@ Traverse
Search child objects.
virtual iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
This is free and unencumbered software released into the public domain.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Namespace for the standard library.