Isis 3 Programmer Reference
ThemisIrDistortionMap.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include <cmath>
10 #include "ThemisIrDistortionMap.h"
11 
12 using namespace std;
13 
14 namespace Isis {
18  ThemisIrDistortionMap::ThemisIrDistortionMap(Camera *parent) :
19  CameraDistortionMap(parent, 1.0) {
20  SetBand(1);
21  p_alpha1 = 0.00447623; // Currently not used
22  p_alpha2 = 0.00107556; // Disabled Y portion of optical distortion
23  }
24 
25  void ThemisIrDistortionMap::SetBand(const int band) {
26  if(band < 1 || band > 10) {
27  string msg = "Band number out of array bounds in ThemisIRDistortionMap";
28  throw IException(IException::Programmer, msg, _FILEINFO_);
29  }
30  double k[] = { 0.996005, 0.995358, 0.994260, 0.993290, 0.992389,
31  0.991474, 0.990505, 0.989611, 0.988653, 0.9877
32  };
33 
34  p_k = k[band-1];
35  }
36 
37 
39  const double dy) {
40  p_focalPlaneX = dx;
41  p_focalPlaneY = dy;
42 
44 
45  double radical = (1.0 + p_alpha1) * (1.0 + p_alpha1) + 4.0 * p_alpha2 * dy;
46  if(radical < 0.0) return false;
47  radical = sqrt(radical);
48  double denom = 1.0 + p_alpha1 + radical;
49  if(denom == 0.0) return false;
50  p_undistortedFocalPlaneY = 2.0 * dy / denom;
51 
52  return true;
53  }
54 
56  const double uy) {
59 
61 
63  p_alpha1 * p_undistortedFocalPlaneY +
65 
66  return true;
67  }
68 }
Isis::ThemisIrDistortionMap::SetUndistortedFocalPlane
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
Definition: ThemisIrDistortionMap.cpp:55
Isis::CameraDistortionMap::p_focalPlaneX
double p_focalPlaneX
Distorted focal plane x.
Definition: CameraDistortionMap.h:65
Isis::CameraDistortionMap::p_undistortedFocalPlaneY
double p_undistortedFocalPlaneY
Undistorted focal plane y.
Definition: CameraDistortionMap.h:68
Isis::CameraDistortionMap::p_undistortedFocalPlaneX
double p_undistortedFocalPlaneX
Undistorted focal plane x.
Definition: CameraDistortionMap.h:67
Isis::Camera
Definition: Camera.h:236
Isis::ThemisIrDistortionMap::SetFocalPlane
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
Definition: ThemisIrDistortionMap.cpp:38
Isis::CameraDistortionMap
Distort/undistort focal plane coordinates.
Definition: CameraDistortionMap.h:41
Isis::IException
Isis exception class.
Definition: IException.h:91
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::CameraDistortionMap::p_focalPlaneY
double p_focalPlaneY
Distorted focal plane y.
Definition: CameraDistortionMap.h:66
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16