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 
18 using namespace std;
19 
20 namespace Isis {
33  LroWideAngleCameraFocalPlaneMap::LroWideAngleCameraFocalPlaneMap(Camera *parent,
34  int naifIkCode) :
35  CameraFocalPlaneMap(parent,
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";
61  TranslationParameters trans_p;
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
Isis::LroWideAngleCameraFocalPlaneMap::TranslationParameters
Definition: LroWideAngleCameraFocalPlaneMap.h:44
Isis::CameraFocalPlaneMap::p_camera
Camera * p_camera
Camera of the image.
Definition: CameraFocalPlaneMap.h:137
Isis::CameraFocalPlaneMap::p_itransl
double p_itransl[3]
The y transition from distorted to detector.
Definition: CameraFocalPlaneMap.h:155
Isis::Camera
Definition: Camera.h:236
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::LroWideAngleCameraFocalPlaneMap::setBand
void setBand(int vband)
Implements band-dependant focal plane parameters.
Definition: LroWideAngleCameraFocalPlaneMap.cpp:86
Isis::CameraFocalPlaneMap::p_transx
double p_transx[3]
The x transition from detector to distorted.
Definition: CameraFocalPlaneMap.h:152
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::CameraFocalPlaneMap::p_transy
double p_transy[3]
The y transition from detector to distorted.
Definition: CameraFocalPlaneMap.h:153
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
std
Namespace for the standard library.
Isis::CameraFocalPlaneMap
Convert between distorted focal plane and detector coordinates.
Definition: CameraFocalPlaneMap.h:85
Isis::LroWideAngleCameraFocalPlaneMap::addFilter
void addFilter(int naifIkCode)
Add an additional set of parameters for a given LROC/WAC filter.
Definition: LroWideAngleCameraFocalPlaneMap.cpp:55
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
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::CameraFocalPlaneMap::p_itranss
double p_itranss[3]
The x transition from distorted to detector.
Definition: CameraFocalPlaneMap.h:154