Skip to content

Commit

Permalink
add warning for inaccurate MeanRadiusValue #4111 (#4230)
Browse files Browse the repository at this point in the history
* add warning for inaccurate MeanRadiusValue

* Give a stronger warning
  • Loading branch information
tgiroux authored Apr 1, 2021
1 parent 9820ba9 commit 6b7fff4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions isis/src/control/objs/BundleAdjust/BundleAdjust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,36 @@ namespace Isis {

if (m_bundleSettings->solveTargetBody()) {
m_rank += m_bundleSettings->numberTargetBodyParameters();

if (m_bundleTargetBody->solveMeanRadius() || m_bundleTargetBody->solveTriaxialRadii()) {
outputBundleStatus("Warning: Solving for the target body radii (triaxial or mean) "
"is NOT possible and likely increases error in the solve.\n");
}

if (m_bundleTargetBody->solveMeanRadius()){
// Check if MeanRadiusValue is abnormal compared to observation
bool isMeanRadiusValid = true;
double localRadius, aprioriRadius;

// Arbitrary control point containing an observed localRadius
BundleControlPointQsp point = m_bundleControlPoints.at(0);
SurfacePoint surfacepoint = point->adjustedSurfacePoint();

localRadius = surfacepoint.GetLocalRadius().meters();
aprioriRadius = m_bundleTargetBody->meanRadius().meters();

// Ensure aprioriRadius is within some threshold
// Considered potentially inaccurate if it's off by atleast a factor of two
if (aprioriRadius >= 2 * localRadius || aprioriRadius <= localRadius / 2) {
isMeanRadiusValid = false;
}

// Warn user for abnormal MeanRadiusValue
if (!isMeanRadiusValid) {
outputBundleStatus("Warning: User-entered MeanRadiusValue appears to be inaccurate. "
"This can cause a bundle failure.\n");
}
}
}

int num3DPoints = m_bundleControlPoints.size();
Expand Down

0 comments on commit 6b7fff4

Please sign in to comment.