Isis 3 Programmer Reference
BundleMeasure.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "BundleMeasure.h"
10#include "BundleObservation.h"
11#include "BundleObservationSolveSettings.h"
12#include "Camera.h"
13#include "IException.h"
14
15#include "ControlMeasure.h"
16
17namespace Isis {
18
30 BundleControlPoint *bundleControlPoint) {
31 m_controlMeasure = controlMeasure;
32 m_parentControlPoint = bundleControlPoint;
35 }
36
37
43
44
53 m_controlMeasure = src.m_controlMeasure;
54 m_parentControlPoint = src.m_parentControlPoint;
55 m_parentBundleImage = src.m_parentBundleImage;
56 m_parentObservation = src.m_parentObservation;
57 m_normalsPositionBlockIndex = src.m_normalsPositionBlockIndex;
58 m_normalsPointingBlockIndex = src.m_normalsPointingBlockIndex;
59 }
60
61
72 // Prevent self assignment
73 if (this != &src) {
74 m_controlMeasure = src.m_controlMeasure;
75 m_parentControlPoint = src.m_parentControlPoint;
76 m_parentBundleImage = src.m_parentBundleImage;
77 m_parentObservation = src.m_parentObservation;
78 m_normalsPositionBlockIndex = src.m_normalsPositionBlockIndex;
79 m_normalsPointingBlockIndex = src.m_normalsPointingBlockIndex;
80 }
81
82 return *this;
83 }
84
85
91 void BundleMeasure::setParentObservation(QSharedPointer<BundleObservation> observation) {
92 m_parentObservation = observation;
93 }
94
95
101 void BundleMeasure::setParentImage(QSharedPointer<BundleImage> image) {
102 m_parentBundleImage = image;
103 }
104
105
113 void BundleMeasure::setRejected(bool reject) {
115 }
116
117
126 m_controlMeasure->Camera()->SetImage(m_controlMeasure->GetSample(),
127 m_controlMeasure->GetLine());
128 }
129
130
140
141
151
152
162
163
173
174
181 return m_controlMeasure->IsRejected();
182 }
183
184
193 return m_controlMeasure->Camera();
194 }
195
196
205
206
212 QSharedPointer<BundleImage> BundleMeasure::parentBundleImage() {
213 return m_parentBundleImage;
214 }
215
216
222 QSharedPointer<BundleObservation> BundleMeasure::parentBundleObservation() {
223 return m_parentObservation;
224 }
225
226
238 const QSharedPointer<BundleObservationSolveSettings> BundleMeasure::observationSolveSettings() {
239 if (!m_parentObservation) {
240 QString msg = "In BundleMeasure::observationSolveSettings: "
241 "parent observation has not been set.\n";
242 throw IException(IException::Programmer, msg, _FILEINFO_);
243 }
244 return m_parentObservation->solveSettings();
245 }
246
247
255 double BundleMeasure::sample() const {
256 return m_controlMeasure->GetSample();
257 }
258
259
267 double BundleMeasure::line() const {
268 return m_controlMeasure->GetLine();
269 }
270
271
280 return m_controlMeasure->GetSampleResidual();
281 }
282
283
292 return m_controlMeasure->GetLineResidual();
293 }
294
295
304
305
314
315
321 double BundleMeasure::sigma() const {
322 return m_sigma;
323 }
324
325
332 return m_weightSqrt;
333 }
334
335
341 double BundleMeasure::weight() const {
343 }
344
345
356
357
368
369
378 return m_controlMeasure->GetFocalPlaneComputedX();
379 }
380
381
390 return m_controlMeasure->GetFocalPlaneComputedY();
391 }
392
393
402 return m_controlMeasure->GetFocalPlaneMeasuredX();
403 }
404
405
414 return m_controlMeasure->GetFocalPlaneMeasuredY();
415 }
416
417
423 m_xFocalPlaneResidual = m_controlMeasure->GetFocalPlaneMeasuredX() -
424 m_controlMeasure->GetFocalPlaneComputedX();
425
426 m_yFocalPlaneResidual = m_controlMeasure->GetFocalPlaneMeasuredY() -
427 m_controlMeasure->GetFocalPlaneComputedY();
428 }
429
430
439 void BundleMeasure::setSigma(double sigmaMultiplier) {
440 // TODO fix for CSM
441 m_sigma = sigmaMultiplier * m_controlMeasure->Camera()->PixelPitch();
442
443 if (m_sigma <= 0.0) {
444 QString msg = "In BundleMeasure::setMeasureSigma(): m_measureSigma must be positive\n";
445 throw IException(IException::Programmer, msg, _FILEINFO_);
446 }
447
448 m_weightSqrt = 1.0/m_sigma;
449 }
450
451
463 if (!m_parentObservation) {
464 QString msg = "In BundleMeasure::observationIndex: "
465 "parent observation has not been set.\n";
466 throw IException(IException::Programmer, msg, _FILEINFO_);
467 }
468 return m_parentObservation->index();
469 }
470
471}
This class holds information about a control point that BundleAdjust needs to run correctly.
A container class for a ControlMeasure.
const QSharedPointer< BundleObservationSolveSettings > observationSolveSettings()
Accesses the parent observation's solve settings.
double residualMagnitude() const
Accesses the residual magnitude for this control measure.
QSharedPointer< BundleObservation > m_parentObservation
Parent bundle observation.
void setSigma(double sigma)
Sets sigma (i.e.
int pointingNormalsBlockIndex() const
Accesses block index into normal equations matrix of pointing piecewise polynomial segment.
double sigma() const
Accesses the measure sigma.
int positionNormalsBlockIndex() const
Accesses block index into normal equations matrix of position piecewise polynomial segment.
void setRejected(bool reject)
Sets the BundleMeasure's status to rejected or not rejected.
int m_normalsPointingBlockIndex
block index into normal equations
double m_xFocalPlaneResidual
x focal plane residual in mm
ControlMeasure * m_controlMeasure
Contained control measure.
double focalPlaneMeasuredX() const
Accesses the measured focal plane x value for this control measure //TODO verify?
QSharedPointer< BundleImage > parentBundleImage()
Access the parent BundleImage for this bundle measure.
void setNormalsPositionBlockIndex(int index)
Sets block index into normal equations for position piecewise polynomial segment.
void setParentImage(QSharedPointer< BundleImage > image)
Sets the parent bundle image.
double m_yFocalPlaneResidual
y focal plane residual in mm
double weight() const
Accesses measure weight for bundle.
BundleMeasure & operator=(const BundleMeasure &src)
Assignment operator.
double sampleResidual() const
Accesses the sample residual for this control measure.
double xFocalPlaneResidual() const
Accesses the focal plane x-coordinate residual in millimeters.
void setFocalPlaneResidualsMillimeters()
Computes and sets measure focal plane residuals in millimeters.
QSharedPointer< BundleObservation > parentBundleObservation()
Accesses the parent BundleObservation for this bundle measure.
void setParentObservation(QSharedPointer< BundleObservation > observation)
Sets the parent bundle observation.
double sample() const
Accesses the current sample measurement for this control measure.
double focalPlaneComputedY() const
Accesses the computed focal plane y value for this control measure.
double line() const
Accesses the current line measurement for this control measure.
double yFocalPlaneResidual() const
Accesses the focal plane y-coordinate residual in millimeters.
int observationIndex() const
Accesses the observation index for the parent observation.
void setImage()
Sets the BundleMeasure's status to rejected or not rejected.
int m_normalsPositionBlockIndex
block index into normal equations
bool isRejected() const
Determines whether or not this BundleMeasure is rejected.
double m_sigma
measure uncertainty in mm
BundleControlPoint * m_parentControlPoint
Parent bundle control point that contains this bundle control measure.
QString cubeSerialNumber() const
Accesses the serial number of the cube containing this control measure.
BundleControlPoint * parentControlPoint()
Accesses the parent BundleControlPoint for this bundle measure.
void setNormalsPointingBlockIndex(int index)
Sets block index into normal equations for pointing piecewise polynomial segment.
double lineResidual() const
Accesses the line residual for this control measure.
Camera * camera() const
Accesses the associated camera for this bundle measure.
QSharedPointer< BundleImage > m_parentBundleImage
Parent image of this bundle control measure.
~BundleMeasure()
Destructor.
double focalPlaneComputedX() const
Accesses the computed focal plane x value for this control measure.
double m_weightSqrt
sqrt of measure weight
double focalPlaneMeasuredY() const
Accesses the measured focal plane y value for this control measure //TODO verify?
BundleMeasure(ControlMeasure *controlMeasure, BundleControlPoint *bundleControlPoint)
Constructor.
double weightSqrt() const
Accesses sqrt of measure weight for bundle.
double PixelPitch() const
Returns the pixel pitch.
Definition Camera.cpp:2772
virtual bool SetImage(const double sample, const double line)
Sets the sample/line values of the image to get the lat/lon values.
Definition Camera.cpp:156
a control measurement
QString GetCubeSerialNumber() const
Return the serial number of the cube containing the coordinate.
Status SetRejected(bool rejected)
Set "jigsaw" rejected flag for a measure.
double GetResidualMagnitude() const
Return Residual magnitude.
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
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16