Unverified Commit 89acdef5 authored by dcookastro's avatar dcookastro Committed by GitHub
Browse files

Merge pull request #622 from kledmundson/LroLidar_Infrastructure

Lro lidar infrastructure
parents 2a5afe5b 1386f6e5
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -444,7 +444,6 @@ namespace Isis {
  int LeastSquares::SolveSparse() {

    // form "normal equations" matrix by multiplying ATA
    std::cout << p_sparseA.n_rows << ", " << p_sparseA.n_cols << std::endl;
    p_normals = p_sparseA.t()*p_sparseA;

    // Create the right-hand-side column vector 'b'
+2 −1
Original line number Diff line number Diff line
@@ -108,8 +108,9 @@ namespace Isis {
   *                            to reset all solution methods
   *   @history  2010-11-22 Debbie A. Cook - Merged with Ken Edmundson version
   *   @history  2013-12-29 Jeannie Backer - Improved error messages. Fixes #962.
   *   @history  2019-09-05 Makayla Shepherd & Jesse Mapel - Changed sparse solution to use
   *   @history  2018-09-05 Makayla Shepherd & Jesse Mapel - Changed sparse solution to use
   *                            Armadillo library's SuperLU interface instead of GMM.
   *   @history  2018-11-29 Ken Edmundson - Removed output line in SolveSparse method.
   *
   */
  class LeastSquares {
+6 −43
Original line number Diff line number Diff line
@@ -455,22 +455,17 @@ namespace Isis {
    m_cholmodNormal = NULL;
    m_cholmodTriplet = NULL;

    // should we initialize objects m_xResiduals, m_yResiduals, m_xyResiduals
    // should we initialize objects m_xResiduals, m_yResiduals, m_xyResiduals?

    // TESTING
    // TODO: code below should go into a separate method???
    // set up BundleObservations and assign solve settings for each from BundleSettings class
    int normalsMatrixStartBlock = 0;
    for (int i = 0; i < numImages; i++) {

      Camera *camera = m_controlNet->Camera(i);
      QString observationNumber = m_serialNumberList->observationNumber(i);
      QString instrumentId = m_serialNumberList->spacecraftInstrumentId(i);
      QString serialNumber = m_serialNumberList->serialNumber(i);
      QString fileName = m_serialNumberList->fileName(i);

      // create a new BundleImage and add to new (or existing if observation mode is on)
      // BundleObservation
      // create a new BundleImage and add to new (or existing if observation mode) BundleObservation
      BundleImageQsp image = BundleImageQsp(new BundleImage(camera, serialNumber, fileName));

      if (!image) {
@@ -486,34 +481,6 @@ namespace Isis {
                      + observationNumber + "is null." + "\n";
        throw IException(IException::Programmer, msg, _FILEINFO_);
      }

      // the observation stores the index to its associated SparseBlockColumnMatrix in
      // m_sparseNormals
      // TODO: I (Ken E.) think the individual segments should somehow be storing the index to
      // their associated SparseBlockColumnMatrix
      observation->setNormalsMatrixStartBlock(normalsMatrixStartBlock);
      normalsMatrixStartBlock += observation->numberPolynomialSegments();

      // initialize piecewise polynomial continuity constraints for time-dependent sensors if
      // necessary
      // TODO: can we let BundleObservation handle this?
      if (observation->numberPolynomialPositionSegments() > 1
          || observation->numberPolynomialPointingSegments() > 1) {

        BundlePolynomialContinuityConstraintQsp polyConstraint =
            BundlePolynomialContinuityConstraintQsp(
              new BundlePolynomialContinuityConstraint(observation));
        observation->setContinuityConstraints(polyConstraint);
      }
    }

    // initialize exterior orientation (spice) for all BundleImages in all BundleObservations
    // TODO!!! - should these initializations just be done when we add the new observation above?
    m_bundleObservations.initializeExteriorOrientation();


    if (m_bundleSettings->solveTargetBody()) {
      m_bundleObservations.setBodyRotation();
    }

    // set up vector of BundleControlPoints
@@ -550,8 +517,7 @@ namespace Isis {
    if (m_lidarDataSet) {
      numLidarPoints = m_lidarDataSet->points().size();
    }
    for (int i =
         0; i < numLidarPoints; i++) {
    for (int i = 0; i < numLidarPoints; i++) {
      LidarControlPointQsp lidarPoint = m_lidarDataSet->points().at(i);
      if (lidarPoint->IsIgnored()) {
        continue;
@@ -770,6 +736,8 @@ namespace Isis {
    }

    for (int i = 0; i < m_bundleObservations.size(); i++) {
      m_bundleObservations.at(i)->setNormalsMatrixStartBlock(blockColumn);

      int positionParameters =
          m_bundleObservations.at(i)->numberPositionParametersPerSegment();

@@ -2433,13 +2401,8 @@ namespace Isis {
    // time dependent sensors.
    if (m_iteration == 1) {
      measure.setPolySegmentIndices();
      if (m_bundleSettings->solveTargetBody()) {
        measure.setNormalsBlockIndices(1);
      }
      else {
      measure.setNormalsBlockIndices();
    }
    }

    // Compute the look vector in instrument coordinates based on time of observation and apriori
    // lat/lon/radius
+2 −0
Original line number Diff line number Diff line
@@ -349,6 +349,8 @@ namespace Isis {
   *                            which have been replaced with the local radius of a control
   *                            point for converting point sigmas to/from radians from/to meters.
   *                            References #4649 and #501.
   *   @history 2018-11-29 Ken Edmundson - Modifed init, initializeNormalEquationsMatrix, and
   *                           computePartials methods.
   */
  class BundleAdjust : public QObject {
      Q_OBJECT
+8 −8
Original line number Diff line number Diff line
@@ -153,7 +153,7 @@ namespace Isis {
   * @throws IException::Programmer "In BundleMeasure::setNormalsBlockIndices:
   *                                 parent observation has not been set."
   */
  void BundleMeasure::setNormalsBlockIndices(int solveTargetBody) {
  void BundleMeasure::setNormalsBlockIndices() {
    if (!m_parentObservation) {
      QString msg = "In BundleMeasure::setNormalsBlockIndices: "
                    "parent observation has not been set.\n";
@@ -171,18 +171,18 @@ namespace Isis {
         BundleObservationSolveSettings::AnglesOnly) ? true : false;

    if (solveForPosition) {
      setNormalsPositionBlockIndex(normalsStartBlock + m_polyPositionSegmentIndex +
                                   solveTargetBody);
      int normalsPositionBlockIndex = normalsStartBlock + m_polyPositionSegmentIndex;
      setNormalsPositionBlockIndex(normalsPositionBlockIndex);

      if (solveForPointing) {
        setNormalsPointingBlockIndex(normalsStartBlock +
        int normalsPointingBlockIndex = normalsStartBlock +
                                        m_parentObservation->numberPolynomialPositionSegments() +
                                     m_polyPointingSegmentIndex + solveTargetBody);
                                        m_polyPointingSegmentIndex;
        setNormalsPointingBlockIndex(normalsPointingBlockIndex);
      }
    }
    else if (solveForPointing) {
      setNormalsPointingBlockIndex(normalsStartBlock + m_polyPointingSegmentIndex +
                                   solveTargetBody);
      setNormalsPointingBlockIndex(normalsStartBlock + m_polyPointingSegmentIndex);
    }
  }

Loading