53 LroWideAngleCamera::LroWideAngleCamera(
Cube &cube) :
71 QString stime = inst[
"SpacecraftClockStartCount"];
80 QString instId = inst[
"InstrumentId"][0].toUpper();
82 int frameletSize = 14;
84 int filterIKBase = 10;
86 if (instId ==
"WAC-UV") {
89 filterIKBase = 15 - 1;
93 else if (instId ==
"WAC-VIS") {
96 filterIKBase = 10 - 3;
101 QString msg =
"Invalid value [" + instId
102 +
"] for keyword [InstrumentId]";
111 const PvlKeyword &filtNames = bandBin[
"Center"];
114 if (nbands != filtNames.
size()) {
116 mess <<
"Number bands in (file) label (" << nbands
117 <<
") do not match number of values in BandBin/Center keyword (" 118 << filtNames.
size() <<
") - required for band-dependent geoemtry";
123 bool dataflipped = (inst[
"DataFlipped"][0].toUpper() ==
"YES");
126 QString instCode =
"INS" + QString::number(
naifIkCode());
128 QString ikernKey = instCode +
"_FILTER_BANDCENTER";
131 ikernKey = instCode +
"_FILTER_OFFSET";
135 ikernKey = instCode +
"_FILTER_BANDID";
143 for (
int i = 0 ; i < foffset.size() ; i++) {
144 filterToDetectorOffset.
add(fbc[i], foffset[i]);
145 wavel.
add(foffset[i], fbc[i]);
146 filterIKCode.
add(fbc[i],
naifIkCode() - (filterIKBase + fbandid[i]));
152 int frameletOffsetFactor = inst[
"ColorOffset"];
153 if ( dataflipped ) frameletOffsetFactor *= -1;
155 for (
int j = 0 ; j < wavel.
size() ; j++) {
156 int wavelen = wavel.
getNth(j);
157 filterToFrameletOffset.
add(wavelen, j * frameletOffsetFactor);
162 for (
int i = 0; i < filtNames.
size(); i++) {
163 if (!filterToDetectorOffset.
exists(filtNames[i].toInt())) {
164 QString msg =
"Unrecognized filter name [" + filtNames[i] +
"]";
168 p_detectorStartLines.push_back(filterToDetectorOffset.
get(filtNames[i].toInt()));
169 p_frameletOffsets.push_back(filterToFrameletOffset.
get(filtNames[i].toInt()));
171 QString kBase =
"INS" + QString::number(filterIKCode.
get(filtNames[i].toInt()));
172 p_focalLength.push_back(
getDouble(kBase+
"_FOCAL_LENGTH"));
173 p_boreSightSample.push_back(
getDouble(kBase+
"_BORESIGHT_SAMPLE"));
174 p_boreSightLine.push_back(
getDouble(kBase+
"_BORESIGHT_LINE"));
178 double frameletRate = (double) inst[
"InterframeDelay"] / 1000.0;
185 bool flippedFramelets = dataflipped;
190 QString instModeId = inst[
"InstrumentModeId"][0].toUpper();
193 if (instModeId ==
"BW") {
194 instModeId += inst[
"Mode"][0];
197 p_frameletOffsets[0] = 0;
200 ikernKey = instCode +
"_" + instModeId +
"_SAMPLE_OFFSET";
207 for (
int i = 0 ; i < filtNames.
size() ; i++ ) {
208 fplane->
addFilter(filterIKCode.
get(filtNames[i].toInt()));
209 distort->
addFilter(filterIKCode.
get(filtNames[i].toInt()));
213 bool evenFramelets = (inst[
"Framelets"][0].toUpper() ==
"EVEN");
221 if(instId ==
"WAC-UV") {
246 int maxbands = min(p_detectorStartLines.size(), p_frameletOffsets.size());
247 if ((vband <= 0) || (vband > maxbands)) {
249 mess <<
"Requested virtual band (" << vband
250 <<
") outside valid (BandBin/Center) limits (1 - " << maxbands
267 p_boreSightLine[vband-1] + 1.0);
284 dtpool_c(key.toLatin1().data(), &found, &n, ctype);
296 QVariant poolKeySize = getStoredResult(key +
"_SIZE",
SpiceIntType);
298 int nvals = poolKeySize.toInt();
306 QString mess =
"Kernel pool keyword " + key +
" not found!";
311 for (
int i = 0 ; i < nvals ; i++) {
void SetBandFirstDetectorLine(int firstLine)
Change the starting line in the detector based on band.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
void SetFocalLength()
Reads the focal length from the instrument kernel.
virtual int CkReferenceId() const
CK Reference ID - J2000.
void SetFrameletOrderReversed(bool frameletOrderReversed, int nframelets)
Changes the direction of the framelets.
int PoolKeySize(const QString &key) const
PvlGroupIterator findGroup(const QString &name, PvlGroupIterator beg, PvlGroupIterator end)
Find a group with the specified name, within these indexes.
T & get(const K &key)
Returns the value associated with the name provided.
bool IsBandIndependent()
The camera model is band dependent, so this method returns false.
double p_exposureDur
Exposure Duration value from labels.
CameraDistortionMap * DistortionMap()
Returns a pointer to the CameraDistortionMap object.
void SetFrameletOffset(int frameletOffset)
Reset the frame offset.
SpiceInt getInteger(const QString &key, int index=0)
This returns a value from the NAIF text pool.
QString m_instrumentNameLong
Full instrument name.
T & getNth(int nth)
Returns the nth value in the collection.
void SetDetectorSampleSumming(const double summing)
Set sample summing mode.
void SetPixelPitch()
Reads the Pixel Pitch from the instrument kernel.
void SetFrameletsGeometricallyFlipped(bool frameletsFlipped)
Mirrors the each framelet in the file.
Namespace for the standard library.
Convert between undistorted focal plane and ground coordinates.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
int size() const
Returns the size of the collection.
PushFrameCameraDetectorMap * DetectorMap()
Returns a pointer to the PushFrameCameraDetectorMap object.
double toDouble(const QString &string)
Global function to convert from a string to a double.
This error is for when a programmer made an API call that was illegal.
void setBand(int vband)
Implements band-dependant distortion parameters.
void SetDetectorLineSumming(const double summing)
Set line summing mode.
int ParentLines() const
Returns the number of lines in the parent alphacube.
Distort/undistort focal plane coordinates.
Generic class for Push Frame Cameras.
void SetFrame(int frameCode)
Change the frame to the given frame code.
int size() const
Returns the number of values stored in this keyword.
virtual int CkFrameId() const
CK frame ID - - Instrument Code from spacit run on CK.
QString m_instrumentNameShort
Shortened instrument name.
PvlKeyword & findKeyword(const QString &kname, FindOptions opts)
Finds a keyword in the current PvlObject, or deeper inside other PvlObjects and Pvlgroups within this...
Contains multiple PvlContainers.
bool exists(const K &key) const
Checks the existance of a particular key in the list.
SpiceInt naifIkCode() const
This returns the NAIF IK code to use when reading from instrument kernels.
#define _FILEINFO_
Macro for the filename and line number.
void add(const K &key, const T &value)
Adds the element to the list.
LRO Wide Angle Camera Model.
A type of error that could only have occurred due to a mistake on the user's part (e...
A single keyword-value pair.
iTime getClockTime(QString clockValue, int sclkCode=-1, bool clockTicks=false)
This converts the spacecraft clock ticks value (clockValue) to an iTime.
Convert between parent image coordinates and detector coordinates.
void setBand(int vband)
Implements band-dependant focal plane parameters.
Collector/container for arbitrary items.
Container for cube-like labels.
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
void LoadCache()
This loads the spice cache big enough for this image.
~LroWideAngleCamera()
Destroys the LroWideAngleCamera object.
QString m_spacecraftNameLong
Full spacecraft name.
Pvl * label() const
Returns a pointer to the IsisLabel object associated with the cube.
void SetStartingDetectorSample(const double sample)
Set the starting detector sample.
void SetBand(const int band)
Sets the band in the camera model.
int p_nframelets
Number of framelets in whole image.
static void CheckErrors(bool resetNaif=true)
This method looks for any naif errors that might have occurred.
void addFilter(int naifIkCode)
Add an additional set of parameters for a given LROC/WAC filter.
Namespace for ISIS/Bullet specific routines.
SpiceRotation * instrumentRotation() const
Accessor method for the instrument rotation.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
Convert between undistorted focal plane and ra/dec coordinates.
QString m_spacecraftNameShort
Shortened spacecraft name.
IntParameterList GetVector(const QString &key)
Isis::Camera * LroWideAngleCameraPlugin(Isis::Cube &cube)
This is the function that is called in order to instantiate a LroWideAngleCamera object.
void SetGeometricTilingHint(int startSize=128, int endSize=8)
This method sets the best geometric tiling size for projecting from this camera model.
double Et() const
Returns the ephemeris time (TDB) representation of the time as a double.
virtual void SetBand(const int band)
Virtual method that sets the band number.
Distort/undistort focal plane coordinates.
double p_etStart
Ephemeris Start iTime.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
virtual int SpkReferenceId() const
SPK Reference ID - J2000.
void addFilter(int naifIkCode)
Add an additional set of parameters for a given LROC/WAC filter.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
IO Handler for Isis Cubes.