42 Init(parent, naifIkCode);
66 p_detectorSampleOrigin = 0.0;
67 p_detectorLineOrigin = 0.0;
68 p_detectorSampleOffset = 0.0;
69 p_detectorLineOffset = 0.0;
109 p_detectorSampleOrigin = 0.0;
110 p_detectorLineOrigin = 0.0;
111 p_detectorSampleOffset = 0.0;
112 p_detectorLineOffset = 0.0;
115 if (naifIkCode != 0) {
116 QString xkey =
"INS" +
toString(naifIkCode) +
"_TRANSX";
117 QString ykey =
"INS" +
toString(naifIkCode) +
"_TRANSY";
118 QString ixkey =
"INS" +
toString(naifIkCode) +
"_ITRANSS";
119 QString iykey =
"INS" +
toString(naifIkCode) +
"_ITRANSL";
120 for (
int i = 0; i < 3; ++i) {
121 p_transx[i] = parent->
getDouble(xkey, i);
122 p_transy[i] = parent->
getDouble(ykey, i);
123 p_itranss[i] = parent->
getDouble(ixkey, i);
124 p_itransl[i] = parent->
getDouble(iykey, i);
128 QString xkey =
"IDEAL_TRANSX";
129 QString ykey =
"IDEAL_TRANSY";
130 QString ixkey =
"IDEAL_TRANSS";
131 QString iykey =
"IDEAL_TRANSL";
132 for (
int i = 0; i < 3; ++i) {
133 p_transx[i] = parent->
getDouble(xkey, i);
134 p_transy[i] = parent->
getDouble(ykey, i);
135 p_itranss[i] = parent->
getDouble(ixkey, i);
136 p_itransl[i] = parent->
getDouble(iykey, i);
163 p_centeredDetectorSample = p_itranss[0] + (p_itranss[1] * dx) + (p_itranss[2] * dy);
164 p_centeredDetectorLine = p_itransl[0] + (p_itransl[1] * dx) + (p_itransl[2] * dy);
184 p_focalPlaneX = p_transx[0] + (p_transx[1] * p_centeredDetectorSample) + (p_transx[2] * p_centeredDetectorLine) ;
185 p_focalPlaneY = p_transy[0] + (p_transy[1] * p_centeredDetectorSample) + (p_transy[2] * p_centeredDetectorLine) ;
199 if (p_transx[1] > p_transx[2]) {
218 double magCoef1 = fabs(p_transx[1]);
219 double magCoef2 = fabs(p_transx[2]);
221 if (magCoef1 > magCoef2) {
222 return (magCoef1 / p_transx[1]);
225 return (magCoef2 / p_transx[2]);
240 double magCoef1 = fabs(p_transy[1]);
241 double magCoef2 = fabs(p_transy[2]);
243 if (magCoef1 > magCoef2) {
244 return (magCoef1 / p_transy[1]);
247 return (magCoef2 / p_transy[2]);
278 return p_centeredDetectorSample;
284 return p_centeredDetectorLine;
298 p_detectorSampleOrigin = sample;
299 p_detectorLineOrigin = line;
305 return p_detectorLineOrigin;
311 return p_detectorSampleOrigin;
325 const double lineOffset) {
326 p_detectorSampleOffset = sampleOffset;
327 p_detectorLineOffset = lineOffset;
333 return p_detectorLineOffset;
339 return p_detectorSampleOffset;
345 for (
int i=0; i<3; ++i) {
346 p_itransl[i] = transL[i];
353 for (
int i=0; i<3; ++i) {
354 p_itranss[i] = transS[i];
361 for (
int i=0; i<3; ++i) {
362 p_transx[i] = transX[i];
369 for (
int i=0; i<3; ++i) {
370 p_transy[i] = transY[i];
double p_detectorLine
line value of the detector
const double * TransY() const
Return the affine coefficients for converting detector (sample,line) to distorted Y...
void SetTransY(const QVector< double > transY)
Set the affine coefficients for converting detector (sample,line) to a distorted Y.
void SetDetectorOffset(const double sampleOffset, const double lineOffset)
Set the detector offset.
virtual bool SetFocalPlane(const double dx, const double dy)
Compute detector position (sample,line) from focal plane coordinates.
virtual ~CameraFocalPlaneMap()
Destructor.
const double * TransS() const
Return the affine coefficients for converting distorted (x,y) to a detector Sample.
void ComputeCentered()
Convenience method to center detector origin (use when inheriting)
void SetTransL(const QVector< double > transL)
Set the affine coefficients for converting destorted (x,y) to a detector Line.
double p_focalPlaneX
x value of focal plane coordinate
The x value of the focal plane maps to a sample.
double DetectorLineOffset() const
Return detector line offset.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void SetDetectorOrigin(const double sample, const double line)
Set the detector origin.
virtual bool SetDetector(const double sample, const double line)
Compute distorted focal plane coordinate from detector position (sampel,line)
double p_focalPlaneY
y value of focal plane coordinate
double DetectorLine() const
Return detector line.
double DetectorSample() const
Return detector sample.
double SignMostSigX()
Return the sign of the p_transx coefficient with the greatest magnitude.
double DetectorSampleOrigin() const
Return detector sample origin.
double SignMostSigY()
Return the sign of the p_transy coefficient with the greatest magnitude.
std::vector< double > Coefficients(int var)
Return the affine coeffients for the entered variable (1 or 2).
void SetTransX(const QVector< double > transX)
Set the affine coefficients for converting detector (sample,line) to a distorted X.
void SetTransS(const QVector< double > transS)
Set the affine coefficients for converting destorted (x,y) to a detector Sample.
void SetFocalPlaneMap(CameraFocalPlaneMap *map)
Sets the Focal Plane Map.
void ComputeUncentered()
Convenience method to center detector origin (use when inheriting)
const double * TransL() const
Return the affine coefficients for converting distorted (x,y) to a detector Line. ...
void Init(Camera *parent, const int naifIkCode)
Initialize the focal plane map to its default state.
double CenteredDetectorLine() const
Return centered detector line.
CameraFocalPlaneMap(Camera *parent, const int naifIkCode)
Construct mapping between detectors and focal plane x/y.
double DetectorSampleOffset() const
Return detector sample offset.
double CenteredDetectorSample() const
Return centered detector sample.
const double * TransX() const
Return the affine coefficients for converting detector (sample,line) to a distorted X...
double FocalPlaneY() const
Return distorted focal plane y.
double DetectorLineOrigin() const
Return detector line origin.
std::vector< double > InverseCoefficients(int var)
Return the inverse affine coeffients for the entered variable (1 or 2).
double FocalPlaneX() const
Return distorted focal plane x.
double p_detectorSample
sample value of the detector
The x value of the focal plane maps to a line.
SpiceDouble getDouble(const QString &key, int index=0)
This returns a value from the NAIF text pool.
int FocalPlaneXDependency()
Return the focal plane x dependency variable.