Commit f8be5695 authored by Adam Goins's avatar Adam Goins Committed by Makayla Shepherd
Browse files

Added AprioriCovar() and AdjustedCovar() accessors to ControlPoint.

parent a668a15b
Loading
Loading
Loading
Loading
+80 −25
Original line number Diff line number Diff line
@@ -2464,4 +2464,59 @@ namespace Isis {

    return fileEntry;
  }
  double ControlPoint::AprioriCovar(int position) const {
    SurfacePoint apriori = GetAprioriSurfacePoint();
    symmetric_matrix< double, upper > covar = apriori.GetRectangularMatrix();
    switch (position) {
      case 0:
        return covar(0, 0);
        break;
      case 1:
        return covar(0, 1);
        break;
      case 2:
        return covar(0, 2);
        break;
      case 3:
        return covar(1, 1);
        break;
      case 4:
        return covar(1, 2);
        break;
      case 5:
        return covar(2, 2);
        break;
      default:
        QString msg = "Invalid position given";
        throw IException(IException::Io, msg, _FILEINFO_);
    }
  }

  double ControlPoint::AdjustedCovar(int position) const {
    SurfacePoint adjusted = GetAdjustedSurfacePoint();
    symmetric_matrix< double, upper > covar = adjusted.GetRectangularMatrix();
    switch (position) {
      case 0:
        return covar(0, 0);
        break;
      case 1:
        return covar(0, 1);
        break;
      case 2:
        return covar(0, 2);
        break;
      case 3:
        return covar(1, 1);
        break;
      case 4:
        return covar(1, 2);
        break;
      case 5:
        return covar(2, 2);
        break;
      default:
        QString msg = "Invalid position given";
        throw IException(IException::Io, msg, _FILEINFO_);
    }
  }
}
+13 −10
Original line number Diff line number Diff line
@@ -340,6 +340,7 @@ namespace Isis {
   *                            GetAprioriX(), GetAprioriY(), GetAprioriZ(), HasAdjustedCoordinates(),
   *                            GetAdjustedX(), GetAdjustedY(), GetAdjustedZ(), HasRefMeasure().
   *   @history 2017-12-19 Kristin Berry - Added IsJigsawRejected().
   *   @history 2017-12-20 Adam Goins - Added AprioriCovar() and AdjustedCovar() accessors.
   */
  class ControlPoint : public QObject {

@@ -577,6 +578,8 @@ namespace Isis {
      double GetSampleResidualRms() const;
      double GetLineResidualRms() const;
      double GetResidualRms() const;
      double AprioriCovar(int) const;
      double AdjustedCovar(int) const;
      void ClearJigsawRejected();

      ControlPointFileEntryV0002 ToFileEntry() const;