47 LoMediumDistortionMap::LoMediumDistortionMap(
Camera *parent) :
94 QString centkey =
"INS" +
toString(naifIkCode) +
"_POINT_OF_SYMMETRY";
95 p_sample0 = boreS - p_camera->Spice::getDouble(centkey, 0);
96 p_line0 = boreL + p_camera->Spice::getDouble(centkey, 1);
132 if(fabs(dx) > 45.79142767 || fabs(dy) > 35.09)
return false;
145 double origr2 = dists * dists + distl * distl;
146 double sp = sqrt(origr2);
148 p_undistortedFocalPlaneX = dx;
149 p_undistortedFocalPlaneY = dy;
155 double nS = sp / sRef;
156 double dS = p_odk[0] * nS + p_odk[1] * pow(nS, 3) + p_odk[2] * pow(nS, 5);
157 double prevdS = 2 * dS;
158 double pixtol = .000001;
163 while(fabs(dS - prevdS) > pixtol) {
165 if(numit > 14 || fabs(dS) > 1E9) {
175 dS = p_odk[0] * nS + p_odk[1] * pow(nS, 3) + p_odk[2] * pow(nS, 5);
180 double ratio = s / sp;
181 double undistortedSample = dists * ratio +
p_sample0;
182 double undistortedLine = distl * ratio +
p_line0;
211 p_undistortedFocalPlaneX = ux;
212 p_undistortedFocalPlaneY = uy;
215 if(fabs(ux) > 45.79142767 || fabs(uy) > 35.09)
return false;
216 if(fabs(ux) > 41.85 || fabs(uy) > 35.09)
return false;
233 double rp2 = (distus * distus + distul * distul);
236 p_focalPlaneX = p_undistortedFocalPlaneX;
237 p_focalPlaneY = p_undistortedFocalPlaneY;
242 rp2 = rp2 / sRef / sRef;
243 double drOverR = (p_odk[0] + rp2 * p_odk[1] + rp2 * rp2 * p_odk[2]) / sRef;
246 double ds = p_sample0 + (distus * (1. + drOverR));
247 double dl = p_line0 + (distul * (1. + drOverR));
const double E(2.7182818284590452354)
Sets some basic constants for use in ISIS programming.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute undistorted focal plane x/y for Lo Medium Resolution Camera.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void SetDistortion(int naifIkCode)
Load distortion coefficients.
virtual bool SetDetector(const double sample, const double line)
Compute distorted focal plane coordinate from detector position (sampel,line)
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double DetectorLine() const
Return detector line.
double DetectorSample() const
Return detector sample.
Distort/undistort focal plane coordinates.
double p_sample0
Center of distortion on sample axis.
CameraFocalPlaneMap * FocalPlaneMap()
Returns a pointer to the CameraFocalPlaneMap object.
double FocalPlaneY() const
Return distorted focal plane y.
virtual bool SetUndistortedFocalPlane(const double ux, const double uy)
Compute distorted focal plane x/y for Lo Medium Resolution Camera.
void SetDistortion(const int naifIkCode)
Load LO Medium Resolution Camera perspective & distortion coefficients.
double FocalPlaneX() const
Return distorted focal plane x.
double p_line0
Center of distortion on line axis.