Commit ca2ed208 authored by Jeannie Backer's avatar Jeannie Backer
Browse files

Removed bug in JigsawDiaglog.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@5927 41f8697f-d340-4b68-9986-7bafba869bb8
parent 736f8e64
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -108,14 +108,13 @@ void IsisMain() {
    }
    Application::Log(gp);
  }

  catch(IException &e) {
    bundleAdjustment->controlNet()->Write(ui.GetFileName("ONET"));
    QString msg = "Unable to bundle adjust network [" + cnetFile + "]";
    throw IException(e, IException::User, msg, _FILEINFO_);
  }

  delete bundleAdjustment;
//TODO - WHY DOES THIS MAKE VALGRIND ANGRY???  delete bundleAdjustment;
}

BundleSettings bundleSettings(UserInterface &ui) {
+26 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@
#include "SurfacePoint.h"

using namespace boost::numeric::ublas;
using namespace Isis;

namespace Isis {

@@ -99,6 +100,30 @@ namespace Isis {
  }


  BundleAdjust::BundleAdjust(BundleSettings bundleSettings,
                             QString &cnet, 
                             SerialNumberList &snlist,
                             bool bPrintSummary) {
    // initialize m_dConvergenceThreshold ???
    // ??? deleted keyword ??? m_dConvergenceThreshold = 0.0;    // This is needed for deltack???
    // ???                                   //JWB - this gets overwritten in Init... move to constructor ???????????????????????????????????????????????????????????????????????
    // ??? 
    // initialize constructor dependent settings...
    // m_bPrintSummary, m_bCleanUp, m_strCnetFileName, m_pCnet, m_pSnList, m_pHeldSnList,
    // m_bundleSettings
    Progress progress;
    m_bPrintSummary = bPrintSummary;
    m_bCleanUp = false;
    m_strCnetFileName = cnet;
    m_pCnet = new Isis::ControlNet(cnet, &progress);
    m_pSnList = &snlist;
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;

    init();
  }


  BundleAdjust::BundleAdjust(BundleSettings bundleSettings,
                             Isis::ControlNet &cnet, 
                             Isis::SerialNumberList &snlist,
@@ -480,6 +505,7 @@ namespace Isis {
  bool BundleAdjust::solveCholesky() {

    // TODO what are the next two lines doing?
    cout << "cnet = " << m_strCnetFileName << endl;
    PvlObject forTesting = m_bundleSettings.pvlObject();
    cout << forTesting << endl;

+10 −6
Original line number Diff line number Diff line
@@ -195,6 +195,10 @@ namespace Isis {
                   const QString &cubeList,
                   const QString &heldList, 
                   bool printSummary = true);
      BundleAdjust(BundleSettings bundleSettings, 
                   QString &cnet, 
                   SerialNumberList &snlist, 
                   bool printSummary = true);
      BundleAdjust(BundleSettings bundleSettings, 
                   ControlNet &cnet, 
                   SerialNumberList &snlist, 
@@ -211,18 +215,18 @@ namespace Isis {
      bool             solveCholesky();

      // accessors
      ControlNet       *controlNet() { return m_pCnet; }
      SerialNumberList *serialNumberList() { return m_pSnList; }
      int              images() const { return m_pSnList->Size(); }
      ControlNet       *controlNet() { return m_pCnet; } // TODO: change from pointer to const ref???
      SerialNumberList *serialNumberList() { return m_pSnList; } // TODO: move implementation to cpp per ISIS standards
      int              images() const { return m_pSnList->Size(); }// TODO: move implementation to cpp per ISIS standards
//      int              observations() const;
      QString          fileName(int index);
      bool             isHeld(int index);
      Table            cMatrix(int index);
      Table            spVector(int index);
      double error() const { // move code to cpp ???
      double error() const { // TODO: move implementation to cpp per ISIS standards
        return m_dError;
      }
      double iteration() const { // move code to cpp ???
      double iteration() const { // TODO: move implementation to cpp per ISIS standards
        return m_nIteration;
      }
      //      int HeldPoints() const { return m_nHeldPoints; }
@@ -235,7 +239,7 @@ namespace Isis {
      bool isConverged();
      QString iterationSummaryGroup() const {
        return m_iterationSummary;
      } // move code to cpp ???
      } // TODO: move implementation to cpp per ISIS standards

    private:

+32 −53
Original line number Diff line number Diff line
@@ -321,7 +321,7 @@ namespace Isis {
  BundleObservationSolveSettings 
      BundleSettings::observationSolveSettings(int n) const { 

    if (n < numberSolveSettings()) {
    if (n < numberSolveSettings() && n >= 0) {
      return m_observationSolveSettings[n]; 
    }
    QString msg = "Unable to find BundleObservationSolveSettings with index = ["
@@ -546,13 +546,9 @@ namespace Isis {
    pvl += PvlKeyword("NumberObservationSolveSettings", toString(numberSolveSettings()));

    for (int i = 0; i < numberSolveSettings(); i++) {
// TODO: make this work... ASSERT failure in QList<T>::operator[]: "index out of range"
// TODO:       BundleObservationSolveSettings boss = m_observationSolveSettings[i];
// TODO:       BundleObservationSolveSettings boss = observationSolveSettings(i);
// TODO:      PvlObject bundleObsSolveSettingsPvl = boss.pvlObject();
// TODO:      pvl += bundleObsSolveSettingsPvl;
      pvl += PvlKeyword("ObservationSolveSettingsInstrumentId", 
                        m_observationSolveSettings[i].instrumentId());
      BundleObservationSolveSettings boss = observationSolveSettings(i);
      PvlObject bundleObsSolveSettingsPvl = boss.pvlObject();
      pvl += bundleObsSolveSettingsPvl;
    }

    return pvl;
@@ -576,51 +572,32 @@ namespace Isis {

    stream.writeAttribute("id", m_id->toString());

    m_validateNetwork ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("validateNetwork", boolStr);

    stream.writeAttribute("solveMethod", solveMethodToString(m_solveMethod));

    m_solveObservationMode ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("solveObservationMode", boolStr);

    m_solveRadius ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("solveRadius", boolStr);

    m_updateCubeLabel ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("updateCubeLabel", boolStr);

    m_errorPropagation ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("errorPropagation", boolStr);

    m_outlierRejection ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("outlierRejection", boolStr);

    stream.writeAttribute("outlierRejectionMultiplier",
                          IString(m_outlierRejectionMultiplier).ToQt());
    stream.writeAttribute("globalLatitudeAprioriSigma", IString(m_globalLatitudeAprioriSigma).ToQt());
    stream.writeAttribute("globalLongitudeAprioriSigma", IString(m_globalLongitudeAprioriSigma).ToQt());
    stream.writeAttribute("globalRadiusAprioriSigma", IString(m_globalRadiusAprioriSigma).ToQt());

    stream.writeAttribute("convergenceCriteria",
                          convergenceCriteriaToString(m_convergenceCriteria));
    stream.writeAttribute("convergenceCriteriaThreshold",
                          IString(m_convergenceCriteriaThreshold).ToQt());
    stream.writeAttribute("convergenceCriteriaMaximumIterations",
                          IString(m_convergenceCriteriaMaximumIterations).ToQt());

//    QList< QPair< MaximumLikelihoodWFunctions::Model, double > > m_maximumLikelihood;

    stream.writeAttribute("m_outputFilePrefix", m_outputFilePrefix);

    m_createBundleOutputFile ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("createBundleOutputFile", boolStr);

    m_createCSVFiles ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("createCSVFiles", boolStr);

    m_createResidualsFile ? boolStr = "true" : boolStr = "false";
    stream.writeAttribute("createResidualsFile", boolStr);
//     stream.writeAttribute("validateNetwork", toString(boolStr));
// 
//     stream.writeAttribute("solveMethod", solveMethodToString(m_solveMethod));
//     stream.writeAttribute("solveObservationMode", toString(boolStr));
//     stream.writeAttribute("solveRadius", toString(boolStr));
//     stream.writeAttribute("updateCubeLabel", toString(boolStr));
//     stream.writeAttribute("errorPropagation", toString(boolStr));
//     stream.writeAttribute("outlierRejection", toString(boolStr));
//     stream.writeAttribute("outlierRejectionMultiplier", toString(m_outlierRejectionMultiplier));
//     stream.writeAttribute("globalLatitudeAprioriSigma", toString(m_globalLatitudeAprioriSigma));
//     stream.writeAttribute("globalLongitudeAprioriSigma", toString(m_globalLongitudeAprioriSigma));
//     stream.writeAttribute("globalRadiusAprioriSigma", toString(m_globalRadiusAprioriSigma));
// 
//     stream.writeAttribute("convergenceCriteria",
//                           convergenceCriteriaToString(m_convergenceCriteria));
//     stream.writeAttribute("convergenceCriteriaThreshold",
//                           toString(m_convergenceCriteriaThreshold));
//     stream.writeAttribute("convergenceCriteriaMaximumIterations",
//                           toString(m_convergenceCriteriaMaximumIterations));
// 
// //    QList< QPair< MaximumLikelihoodWFunctions::Model, double > > m_maximumLikelihood;
// 
//     stream.writeAttribute("m_outputFilePrefix", m_outputFilePrefix);
//     stream.writeAttribute("createBundleOutputFile", toString(boolStr));
//     stream.writeAttribute("createCSVFiles", toString(boolStr));
//     stream.writeAttribute("createResidualsFile", toString(boolStr));

    stream.writeEndElement();
  }
@@ -802,6 +779,8 @@ namespace Isis {
    return XmlStackedHandler::endElement(namespaceURI, localName, qName);
  }



  QDataStream &BundleSettings::write(QDataStream &stream) const {

    stream << m_validateNetwork
+3 −2
Original line number Diff line number Diff line
@@ -189,9 +189,11 @@ namespace Isis {

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

      void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;

      QDataStream &write(QDataStream &stream) const;
      QDataStream &read(QDataStream &stream);
      void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const;


    private:
      /**
@@ -219,7 +221,6 @@ namespace Isis {
          QString m_characters;
      };

    private:
      bool m_validateNetwork;
      SolveMethod m_solveMethod; //!< Solution method for matrix decomposition.
      bool m_solveObservationMode; //!< for observation mode (explain this somewhere)
Loading