Commit 179a6ad1 authored by Jeannie Backer's avatar Jeannie Backer
Browse files

Updated documentation and tests for BundleSettings. Modified to bring...

Updated documentation and tests for BundleSettings. Modified to bring BundleSettings to ISIS coding standards.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/branches/ipce@6930 41f8697f-d340-4b68-9986-7bafba869bb8
parent 58a456f0
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -84,7 +84,7 @@ namespace Isis {
    m_pSnList = new Isis::SerialNumberList(cubeList);
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;
    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    init(&progress);
  }
@@ -107,7 +107,7 @@ namespace Isis {
    m_pSnList = new Isis::SerialNumberList(cubeList);
    m_pHeldSnList = new Isis::SerialNumberList(heldList);
    m_bundleSettings = bundleSettings;
    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    init(&progress);
  }
@@ -133,7 +133,7 @@ namespace Isis {
    m_pSnList = &snlist;
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;
    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    init();
  }
@@ -159,7 +159,7 @@ namespace Isis {
    m_pSnList = &snlist;
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;
    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    init();
  }
@@ -184,7 +184,7 @@ namespace Isis {
    m_pSnList = &snlist;
    m_pHeldSnList = NULL;
    m_bundleSettings = bundleSettings;
    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    init();
  }
@@ -214,7 +214,7 @@ namespace Isis {
      }
    }

    m_bundleTargetBody = bundleSettings->getBundleTargetBody();
    m_bundleTargetBody = bundleSettings->bundleTargetBody();

    m_bPrintSummary = bPrintSummary;

@@ -378,7 +378,7 @@ namespace Isis {
          QString cubeSerialNumber = measure->cubeSerialNumber();

          BundleObservation *observation =
              m_bundleObservations.getObservationByCubeSerialNumber(cubeSerialNumber);
              m_bundleObservations.observationByCubeSerialNumber(cubeSerialNumber);

          measure->setParentObservation(observation);
        }
+163 −661

File changed.

Preview size limit exceeded, changes collapsed.

+28 −45
Original line number Diff line number Diff line
@@ -25,8 +25,8 @@
 */

#include <QList>
#include <QObject>
#include <QPair>
#include <QObject>
#include <QString>
#include <QVector>

@@ -74,15 +74,12 @@ namespace Isis {
   *                           member variables to make names more descriptive.
   *   @history 2015-10-14 Jeffrey Covington - Declared BundleResults as a Qt
   *                           metatype for use with QVariant.
   *   @history 2016-07-01 Jesse Mapel - Updated documentation and testing in preparation for
   *                           merging from IPCE into ISIS. Fixes #3975.
   */
  class BundleResults : public QObject {
    Q_OBJECT
    public:
      BundleResults(QObject *parent = 0);
      // TODO: does xml stuff need project???
      BundleResults(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);
      BundleResults(Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent = 0);   // TODO: does xml stuff need project???
      BundleResults(const BundleResults &src);
      ~BundleResults();
      BundleResults &operator=(const BundleResults &src);
@@ -128,8 +125,7 @@ namespace Isis {
#endif
      void setRejectionLimit(double rejectionLimit);
#if 0
      double computeResiduals(
               ControlNet *pCnet,
      double computeResiduals(ControlNet *pCnet,
                              std::vector< boost::numeric::ublas::bounded_vector< double, 3 > > pointWeights,
                              std::vector< boost::numeric::ublas::bounded_vector< double, 3 > > pointCorrections,
                              boost::numeric::ublas::vector< double > image_Corrections,
@@ -222,8 +218,7 @@ namespace Isis {
      void setCorrMatCovFileName(FileName name);
      void setCorrMatImgsAndParams(QMap<QString, QStringList> imgsAndParams);

      // TODO: does xml stuff need project???
      void save(QXmlStreamWriter &stream, const Project *project) const;
      void save(QXmlStreamWriter &stream, const Project *project) const;   // TODO: does xml stuff need project???
      
      QDataStream &write(QDataStream &stream) const;
      QDataStream &read(QDataStream &stream);
@@ -237,9 +232,6 @@ namespace Isis {

    private:
      /**
       * This class is an XmlHandler used to read and write BundleResults objects
       * from and to XML files.  Documentation will be updated when it is decided
       * if XML support will remain.
       *
       * @author 2014-07-28 Jeannie Backer
       *
@@ -247,8 +239,7 @@ namespace Isis {
       */
      class XmlHandler : public XmlStackedHandler {
        public:
          // TODO: does xml stuff need project???
          XmlHandler(BundleResults *statistics, Project *project);
          XmlHandler(BundleResults *statistics, Project *project);   // TODO: does xml stuff need project???
          ~XmlHandler();
   
          virtual bool startElement(const QString &namespaceURI, const QString &localName,
@@ -286,7 +277,7 @@ namespace Isis {
       */
      QUuid *m_id;
//???      QString m_instrumentId;               //!< The spacecraft instrument id for this observation.
      CorrelationMatrix *m_correlationMatrix; //!< The correlation matrix from the BundleAdjust.
      CorrelationMatrix *m_correlationMatrix;

// ???       Statistics m_statsx;                       //!<  x errors
// ???       Statistics m_statsy;                       //!<  y errors
@@ -329,32 +320,26 @@ namespace Isis {
      QList<Statistics> m_rmsImageResiduals;      /**< RMS image sample and line residual statistics 
                                                       for each image in the bundle  */

      //!< The root mean square image x sigmas.
      QVector<Statistics> m_rmsImageXSigmas;     // unset and unused ???
      //!< The root mean square image y sigmas.
      QVector<Statistics> m_rmsImageYSigmas;     // unset and unused ???
      //!< The root mean square image z sigmas.
      QVector<Statistics> m_rmsImageZSigmas;     // unset and unused ???
      //!< The root mean square image right ascension sigmas.
      QVector<Statistics> m_rmsImageRASigmas;    // unset and unused ???
      //!< The root mean square image declination sigmas.
      QVector<Statistics> m_rmsImageDECSigmas;   // unset and unused ???
      //!< The root mean square image twist sigmas.
      QVector<Statistics> m_rmsImageTWISTSigmas; // unset and unused ???

      Distance m_minSigmaLatitudeDistance; //!< The minimum sigma latitude distance.
      Distance m_maxSigmaLatitudeDistance; //!< The maximum sigma latitude distance.
      Distance m_minSigmaLongitudeDistance; //!< The minimum sigma longitude distance.
      Distance m_maxSigmaLongitudeDistance; //!< The maximum sigma longitude distance.
      Distance m_minSigmaRadiusDistance; //!< The minimum sigma radius distance.
      Distance m_maxSigmaRadiusDistance; //!< The maximum sigma radius distance.
      Distance m_minSigmaLatitudeDistance;
      Distance m_maxSigmaLatitudeDistance;
      Distance m_minSigmaLongitudeDistance;
      Distance m_maxSigmaLongitudeDistance;
      Distance m_minSigmaRadiusDistance;
      Distance m_maxSigmaRadiusDistance;

      QString m_minSigmaLatitudePointId; //!< The minimum sigma latitude point id.
      QString m_maxSigmaLatitudePointId; //!< The maximum sigma latitude point id.
      QString m_minSigmaLongitudePointId; //!< The minimum sigma longitude point id.
      QString m_maxSigmaLongitudePointId; //!< The maximum sigma longitude point id.
      QString m_minSigmaRadiusPointId; //!< The minimum sigma radius point id.
      QString m_maxSigmaRadiusPointId; //!< The maximum sigma radius point id.
      QString m_minSigmaLatitudePointId;
      QString m_maxSigmaLatitudePointId;
      QString m_minSigmaLongitudePointId;
      QString m_maxSigmaLongitudePointId;
      QString m_minSigmaRadiusPointId;
      QString m_maxSigmaRadiusPointId;

      double m_rmsSigmaLatitudeStats;               //!< rms of adjusted Latitude sigmas
      double m_rmsSigmaLongitudeStats;               //!< rms of adjusted Longitude sigmas
@@ -363,8 +348,6 @@ namespace Isis {
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      // variables for maximum likelihood estimation
      //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      //!< The maximum likelihood models and their quantiles.
      QList< QPair< MaximumLikelihoodWFunctions, double > > m_maximumLikelihoodFunctions;

      /**< The number of maximum likelihood estimation 
@@ -378,7 +361,7 @@ namespace Isis {
      /**< Quantiles of the |residual| distribution to be
           used for tweaking constants of the maximum 
           probability models.*/
      int m_maximumLikelihoodIndex;            /**< This count keeps track of which stage of the
      int m_maximumLikelihoodIndex;            /**< This count keeps track of which stadge of the
                                                    maximum likelihood adjustment the bundle is
                                                    currently on.*/
      StatCumProbDistDynCalc *m_cumPro;        /**< This class will be used to calculate the
+6 −6
Original line number Diff line number Diff line
@@ -215,8 +215,8 @@ Object = MutatedResultsObject
  NumberObservations                 = 9
  NumberImageParameters              = 10
  NumberConstrainedPointParameters   = 11
  NumberConstrainedImageParameters   = 10
  NumberConstrainedTargetParameters  = 2
  NumberConstrainedImageParameters   = 12
  NumberConstrainedTargetParameters  = 0
  NumberUnknownParameters            = 13
  DegreesOfFreedom                   = 14
  Sigma0                             = 15.0
@@ -277,8 +277,8 @@ Object = BundleResults
  NumberObservations                 = 9
  NumberImageParameters              = 10
  NumberConstrainedPointParameters   = 11
  NumberConstrainedImageParameters   = 10
  NumberConstrainedTargetParameters  = 2
  NumberConstrainedImageParameters   = 12
  NumberConstrainedTargetParameters  = 0
  NumberUnknownParameters            = 32
  DegreesOfFreedom                   = 0
  Sigma0                             = 0.0
@@ -329,8 +329,8 @@ Object = BundleResultsFromXml
  NumberObservations                 = 9
  NumberImageParameters              = 10
  NumberConstrainedPointParameters   = 11
  NumberConstrainedImageParameters   = 10
  NumberConstrainedTargetParameters  = 2
  NumberConstrainedImageParameters   = 12
  NumberConstrainedTargetParameters  = 0
  NumberUnknownParameters            = 32
  DegreesOfFreedom                   = 0
  Sigma0                             = 0.0
+10 −32
Original line number Diff line number Diff line
@@ -21,22 +21,8 @@ using namespace std;
using namespace Isis;

namespace Isis {
  /**
   * This class is used to test BundleResults' XmlHandler class.
   * 
   * @author 2014-07-28 Jeannie Backer
   * 
   * @internal
   */
  class BundleResultsXmlHandlerTester : public BundleResults {
    public:
      /**
       * Constructs the tester object from an xml file.
       *
       * @param project The project object the tester belongs to.
       * @param reader The XmlStackedHandlerReader that reads the xml file.
       * @param xmlFile The xml file to construct the tester from.
       */
      BundleResultsXmlHandlerTester(Project *project, XmlStackedHandlerReader *reader, 
                                     FileName xmlFile) : BundleResults(project, reader) {

@@ -59,9 +45,6 @@ namespace Isis {

      }

      /**
       * Destroys the tester object
       */
      ~BundleResultsXmlHandlerTester() {
      }

@@ -159,9 +142,7 @@ int main(int argc, char *argv[]) {
    results.resetNumberConstrainedPointParameters();
    results.incrementNumberConstrainedPointParameters(11);
    results.resetNumberConstrainedImageParameters();
    results.incrementNumberConstrainedImageParameters(10);
    results.resetNumberConstrainedTargetParameters();
    results.incrementNumberConstrainedTargetParameters(2);
    results.incrementNumberConstrainedImageParameters(12);
    results.setNumberUnknownParameters(13);
    results.setDegreesOfFreedom(14.0);
    results.setSigma0(15.0);
@@ -194,8 +175,7 @@ int main(int argc, char *argv[]) {

    qDebug() << "Testing accessor methods...";
    qDebug() << "maximum likelihood index = " << toString(results.maximumLikelihoodModelIndex());
    qDebug() << "maximum likelihood median r2 residuals = "
             << toString(results.maximumLikelihoodMedianR2Residuals());
    qDebug() << "maximum likelihood median r2 residuals = " << toString(results.maximumLikelihoodMedianR2Residuals());

    for (int i = 0; i < results.numberMaximumLikelihoodModels(); i++) {
      qDebug() << "maximum likelihood index,model,quantile = [" << toString(i)
@@ -254,7 +234,6 @@ int main(int argc, char *argv[]) {
      results.setNumberObservations(0);
      results.resetNumberConstrainedPointParameters();
      results.resetNumberConstrainedImageParameters();
      results.resetNumberConstrainedTargetParameters();
      results.setNumberUnknownParameters(1);
      results.computeSigma0(1.0, BundleSettings::Sigma0);
    } 
@@ -265,7 +244,6 @@ int main(int argc, char *argv[]) {
      results.setNumberObservations(1);
      results.resetNumberConstrainedPointParameters();
      results.resetNumberConstrainedImageParameters();
      results.resetNumberConstrainedTargetParameters();
      results.setNumberUnknownParameters(1);
      results.computeSigma0(1.0, BundleSettings::Sigma0);
    } 
Loading