Isis 3.0 Programmer Reference
Back | Home
ThemisIrDistortionMap.cpp
Go to the documentation of this file.
1 
21 #include <cmath>
22 #include "ThemisIrDistortionMap.h"
23 
24 using namespace std;
25 
26 namespace Isis {
30  ThemisIrDistortionMap::ThemisIrDistortionMap(Camera *parent) :
31  CameraDistortionMap(parent, 1.0) {
32  SetBand(1);
33  p_alpha1 = 0.00447623; // Currently not used
34  p_alpha2 = 0.00107556; // Disabled Y portion of optical distortion
35  }
36 
37  void ThemisIrDistortionMap::SetBand(const int band) {
38  if(band < 1 || band > 10) {
39  string msg = "Band number out of array bounds in ThemisIRDistortionMap";
41  }
42  double k[] = { 0.996005, 0.995358, 0.994260, 0.993290, 0.992389,
43  0.991474, 0.990505, 0.989611, 0.988653, 0.9877
44  };
45 
46  p_k = k[band-1];
47  }
48 
49 
51  const double dy) {
52  p_focalPlaneX = dx;
53  p_focalPlaneY = dy;
54 
55  p_undistortedFocalPlaneX = p_focalPlaneX / p_k;
56 
57  double radical = (1.0 + p_alpha1) * (1.0 + p_alpha1) + 4.0 * p_alpha2 * dy;
58  if(radical < 0.0) return false;
59  radical = sqrt(radical);
60  double denom = 1.0 + p_alpha1 + radical;
61  if(denom == 0.0) return false;
62  p_undistortedFocalPlaneY = 2.0 * dy / denom;
63 
64  return true;
65  }
66 
68  const double uy) {
69  p_undistortedFocalPlaneX = ux;
70  p_undistortedFocalPlaneY = uy;
71 
72  p_focalPlaneX = p_undistortedFocalPlaneX * p_k;
73 
74  p_focalPlaneY = p_undistortedFocalPlaneY +
75  p_alpha1 * p_undistortedFocalPlaneY +
76  p_alpha2 * p_undistortedFocalPlaneY * p_undistortedFocalPlaneY;
77 
78  return true;
79  }
80 }
81 
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:154
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:38
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
Distort/undistort focal plane coordinates.
Isis exception class.
Definition: IException.h:99

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:30:46