Isis 3 Programmer Reference
LroWideAngleCameraFocalPlaneMap.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include <cmath>
10#include <sstream>
11#include <iomanip>
12#include <algorithm>
13
14#include "Camera.h"
15#include "IString.h"
16#include "LroWideAngleCameraFocalPlaneMap.h"
17
18using namespace std;
19
20namespace Isis {
34 int naifIkCode) :
36 naifIkCode) {
37 }
38
39
56
57 QString xkey = "INS" + toString(naifIkCode) + "_TRANSX";
58 QString ykey = "INS" + toString(naifIkCode) + "_TRANSY";
59 QString ixkey = "INS" + toString(naifIkCode) + "_ITRANSS";
60 QString iykey = "INS" + toString(naifIkCode) + "_ITRANSL";
62 for (int i = 0; i < 3; ++i) {
63 trans_p.m_transx[i] = p_camera->getDouble(xkey, i);
64 trans_p.m_transy[i] = p_camera->getDouble(ykey, i);
65 trans_p.m_itranss[i] = p_camera->getDouble(ixkey, i);
66 trans_p.m_itransl[i] = p_camera->getDouble(iykey, i);
67 }
68
69 m_transparms.push_back(trans_p);
70 return;
71 }
72
73
87 if ( (vband <= 0) || (vband > m_transparms.size()) ) {
88 QString mess = "Invalid band (" + QString::number(vband) + " requested " +
89 " Must be <= " + QString::number(m_transparms.size());
90 throw IException(IException::Programmer, mess, _FILEINFO_);
91 }
92
93 // Install new parameters
94 int iband = vband - 1;
95 for ( int i = 0 ; i < 3 ; i++) {
96 p_transx[i] = m_transparms[iband].m_transx[i];
97 p_transy[i] = m_transparms[iband].m_transy[i];
98 p_itranss[i] = m_transparms[iband].m_itranss[i];
99 p_itransl[i] = m_transparms[iband].m_itransl[i];
100 }
101
102 return;
103 }
104} // namespace Isis
Convert between distorted focal plane and detector coordinates.
Camera * p_camera
Camera of the image.
double p_itranss[3]
The x transition from distorted to detector.
double p_transx[3]
The x transition from detector to distorted.
double p_itransl[3]
The y transition from distorted to detector.
double p_transy[3]
The y transition from detector to distorted.
Isis exception class.
Definition IException.h:91
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
LroWideAngleCameraFocalPlaneMap(Camera *parent, int naifIkCode)
Camera distortion map constructor.
void addFilter(int naifIkCode)
Add an additional set of parameters for a given LROC/WAC filter.
void setBand(int vband)
Implements band-dependant focal plane parameters.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
Definition Spice.cpp:1046
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.