Isis 3 Programmer Reference
ThemisIrDistortionMap.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include <cmath>
10#include "ThemisIrDistortionMap.h"
11
12using namespace std;
13
14namespace Isis {
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
68}
Distort/undistort focal plane coordinates.
double p_focalPlaneX
Distorted focal plane x.
double p_undistortedFocalPlaneX
Undistorted focal plane x.
double p_undistortedFocalPlaneY
Undistorted focal plane y.
double p_focalPlaneY
Distorted focal plane y.
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
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
Namespace for the standard library.