Commit 1e3dbc8d authored by Kim Oyama's avatar Kim Oyama
Browse files

The correlation matrix now comes from the bundle run. I also initialized some...

The correlation matrix now comes from the bundle run. I also initialized some bundleStats and bundleResults members that were not handled properly.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@5956 41f8697f-d340-4b68-9986-7bafba869bb8
parent f8abde8b
Loading
Loading
Loading
Loading
+12 −9
Original line number Diff line number Diff line
@@ -662,7 +662,6 @@ namespace Isis {
            m_bLastIteration = true;
            m_bundleStatistics.setConverged(true);
            emit statusUpdate("\n Bundle has converged");
            emit bundleConvergence(true);
            break;
          }
        }
@@ -682,7 +681,6 @@ namespace Isis {
          m_bundleStatistics.setConverged(true);
          m_bLastIteration = true;
          emit statusUpdate("Bundle has converged");
          emit bundleConvergence(true);
          break;
        }
      }
@@ -3309,7 +3307,6 @@ namespace Isis {

    SparseBlockColumnMatrix sbcMatrix;

      //////////////////////////////////////////////////////////////////// This is where I add stuff
    // Create unique file name
    FileName matrixFile;
    matrixFile = FileName::createTempFile("inverseMatrix.dat");
@@ -3318,7 +3315,6 @@ namespace Isis {
    // Open file to write to
    matrixOutput.open(QIODevice::WriteOnly);
    QDataStream outStream(&matrixOutput);
      //////////////////////////////////////////////////////////////////// This is where I add stuff

    int i, j, k;
    int nCurrentColumn = 0;
@@ -3396,9 +3392,8 @@ namespace Isis {
        adjustedSigmas[z] = sqrt((*imageCovMatrix)(z,z))*m_bundleStatistics.sigma0();
      }

      //////////////////////////////////////////////////////////////////// This is where I add stuff
      // Output inverse matrix to the open file.
      outStream << sbcMatrix;
      //////////////////////////////////////////////////////////////////// This is where I add stuff

      // now loop over all object points to sum contributions into 3x3 point covariance matrix
      int nPointIndex = 0;
@@ -3462,12 +3457,10 @@ namespace Isis {
        nPointIndex++;
      }
    }
    ////////////////////////////////////////////////////////////////////// This is where I add stuff
    // After the for loop, close the file.
    // Close the file.
    matrixOutput.close();
    // Save the location of the "covariance" matrix
    m_bundleStatistics.setCorrMatCovFileName(matrixFile);
    ////////////////////////////////////////////////////////////////////// This is where I add stuff

    // can free sparse normals now
    m_SparseNormals.wipe();
@@ -4134,6 +4127,8 @@ namespace Isis {
    sprintf(buf, "\nIMAGE EXTERIOR ORIENTATION\n==========================\n");
    fp_out << buf;

    QMap<QString, QStringList> imagesAndParameters;
    
    for (int i = 0; i < nObservations; i++) {

      //if ( m_bundleStatistics.numberHeldImages() > 0 && m_pHeldSnList->HasSerialNumber(m_pSnList->SerialNumber(i)) )
@@ -4159,7 +4154,15 @@ namespace Isis {
      QString observationString =
          observation->formatBundleOutputString(berrorProp);
      fp_out << (const char*)observationString.toAscii().data();

      // Build list of images and parameters for correlation matrix.
      foreach ( QString image, observation->imageNames() ) {
        imagesAndParameters.insert( image, observation->parameterList() );
      }
    }
        
    // Save list of images and their associated parameters for CorrelationMatrix to use in ice.
    m_bundleStatistics.setCorrMatImgsAndParams(imagesAndParameters);

    // output point uncertainty statistics if error propagation is on
    if (berrorProp) {
+5 −1
Original line number Diff line number Diff line
@@ -19,7 +19,9 @@

namespace Isis {

  BundleResults::BundleResults(BundleSettings inputSettings, FileName controlNetworkFileName, QObject *parent) : QObject(parent) {
  BundleResults::BundleResults(BundleSettings inputSettings,
                               FileName controlNetworkFileName,
                               QObject *parent) : QObject(parent) {
    m_id = NULL;
    m_id = new QUuid(QUuid::createUuid());

@@ -32,8 +34,10 @@ namespace Isis {
    m_settings = new BundleSettings(inputSettings);

    m_statisticsResults = NULL;
    m_statisticsResults = new BundleStatistics;

    m_images = NULL;
    m_images = new QList<ImageList *>;
  }


+3 −3
Original line number Diff line number Diff line
<?xml version="1.0" encoding="UTF-8"?>
<bundleSettings>
    <globalSettings>
        <id>{5de1e0bc-fa14-4d5f-aada-1cc44d4a3ea0}</id>
        <id>{2c061cb7-4d6c-4cc4-a2de-fd1c1fb0b6c5}</id>
        <validateNetwork>Yes</validateNetwork>
        <solveOptions solveMethod="Sparse" solveObservationMode="Yes" solveRadius="No" updateCubeLabel="Yes" errorPropagation="Yes"/>
        <aprioriSigmas latitude="-1.0" longitude="-1.0" radius="N/A"/>
@@ -17,7 +17,7 @@
    </globalSettings>
    <observationSolveSettingsList>
        <bundleObservationSolveSettings>
            <id>{69568a42-fa20-4c4d-a2ba-e91a21199de8}</id>
            <id>{d032748a-7f65-475b-b11b-099eed78f2fb}</id>
            <instrumentId>Instrument1</instrumentId>
            <instrumentPointingOptions solveOption="None" solveTwist="Yes" degree="11" solveDegree="-1" numberCoefSolved="0" solveOverExisting="Yes" interpolationType="4">
                <aprioriPointingSigmas angles="N/A" angularVelocity="N/A" angularAcceleration="N/A"/>
@@ -27,7 +27,7 @@
            </instrumentPositionOptions>
        </bundleObservationSolveSettings>
        <bundleObservationSolveSettings>
            <id>{69568a42-fa20-4c4d-a2ba-e91a21199de8}</id>
            <id>{d032748a-7f65-475b-b11b-099eed78f2fb}</id>
            <instrumentId>Instrument2</instrumentId>
            <instrumentPointingOptions solveOption="AllPolynomialCoefficients" solveTwist="Yes" degree="21" solveDegree="1" numberCoefSolved="2" solveOverExisting="Yes" interpolationType="4">
                <aprioriPointingSigmas angles="22.0" angularVelocity="23.0" angularAcceleration="N/A"/>
+3 −1
Original line number Diff line number Diff line
@@ -115,10 +115,12 @@ namespace Isis {
    // m_wFunc, m_cumPro, m_maxLikelihoodIndex, m_maxLikelihoodQuan,
    // m_maxLikelihoodMedianR2Residuals
    m_cumPro = NULL;
    m_cumPro = new StatCumProbDistDynCalc;
    m_numberMaximumLikelihoodModels = 0;
    m_maximumLikelihoodIndex = 0;
    m_maximumLikelihoodMedianR2Residuals = 0.0;
    m_wFunc[0] = m_wFunc[1] = m_wFunc[2] = NULL;
    m_wFunc[0] = m_wFunc[1] = m_wFunc[2] = new MaximumLikelihoodWFunctions;
    m_maximumLikelihoodQuan[0] = m_maximumLikelihoodQuan[1] = m_maximumLikelihoodQuan[2] = 0.5; // better init value ???


@@ -1102,7 +1104,7 @@ namespace Isis {


  /**
   * Set the images and their associated parameters.
   * Set the images and their associated parameters of the correlation matrix.
   *
   * @param imgsAndParams The qmap with all the images and parameters used for this bundle.
   */
+1 −0
Original line number Diff line number Diff line
@@ -190,6 +190,7 @@ namespace Isis {

      PvlObject pvlObject(QString name = "BundleStatistics") const;

      // Correlation Matrix accessors for cnetsuite and mutators for bundle adjust.
      CorrelationMatrix correlationMatrix();
      void setCorrMatCovFileName(FileName name);
      void setCorrMatImgsAndParams(QMap<QString, QStringList> imgsAndParams);
Loading