Isis 3 Developer Reference
BundleSettings.h
Go to the documentation of this file.
1 #ifndef BundleSettings_h
2 #define BundleSettings_h
3 
25 // Qt library
26 #include <QList>
27 #include <QPair>
28 #include <QSharedPointer>
29 #include <QString>
30 
31 
32 
33 // ISIS library
34 #include "BundleTargetBody.h"
37 #include "SpecialPixel.h"
38 #include "SurfacePoint.h"
39 #include "XmlStackedHandler.h"
40 
41 class QDataStream;
42 class QUuid;
43 class QXmlStreamWriter;
44 
45 
46 using namespace Isis;
47 
48 namespace Isis {
49  class FileName;
50  class Project;
51  class PvlObject;
53 
139  public:
140 
141  //=====================================================================//
142  //================ constructors, destructor, operators ================//
143  //=====================================================================//
144  BundleSettings();
145  BundleSettings(const BundleSettings &other);
146  BundleSettings(Project *project,
147  XmlStackedHandlerReader *xmlReader);
148 #if 0
149  BundleSettings(FileName xmlFile,
150  Project *project,
151  XmlStackedHandlerReader *xmlReader,
152  QObject *parent = NULL);
154  QObject *parent = NULL);
155 #endif
156  ~BundleSettings();
157  BundleSettings &operator=(const BundleSettings &other);
158 
159  void setValidateNetwork(bool validate);
160  bool validateNetwork() const;
161 
162 
163  //=====================================================================//
164  //============================ Solve options ==========================//
165  //=====================================================================//
166 
167  // mutators
168  void setSolveOptions(bool solveObservationMode = false,
169  bool updateCubeLabel = false,
170  bool errorPropagation = false,
171  bool solveRadius = false,
178  double multiplier = 1.0);
180  void setCreateInverseMatrix(bool createMatrix);
181 
182  // accessors
185  bool createInverseMatrix() const;
186  bool solveObservationMode() const;
187  bool solveRadius() const;
188  bool updateCubeLabel() const;
189  bool errorPropagation() const;
190  bool outlierRejection() const;
191  double outlierRejectionMultiplier() const;
192 // These sigmas are either for planetocentric lat/lon/radius or body-fixed x/y/z
193  double globalPointCoord1AprioriSigma() const;
194  double globalPointCoord2AprioriSigma() const;
195  double globalPointCoord3AprioriSigma() const;
196 
197  int numberSolveSettings() const;
198  BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const;
201 
202 
203  //=====================================================================//
204  //======================- Convergence Criteria ========================//
205  //=====================================================================//
206 
215  };
216 
217 
218  static ConvergenceCriteria stringToConvergenceCriteria(QString criteria);
219  static QString convergenceCriteriaToString(ConvergenceCriteria criteria);
221  double threshold,
222  int maximumIterations);
224  double convergenceCriteriaThreshold() const;
226 
227  //=====================================================================//
228  //================ Parameter Uncertainties (Weighting) ================//
229  //=====================================================================//
230  // mutators
231 // void setGlobalLatitudeAprioriSigma(double sigma);
232 // void setGlobalLongitudeAprioriSigma(double sigma);
233 // void setGlobalRadiiAprioriSigma(double sigma);
234 
235 
236  //=====================================================================//
237  //=============== Maximum Likelihood Estimation Options ===============//
238  //=====================================================================//
239 
257  };
258 
259 
261  double cQuantile);
264 
265  //=====================================================================//
266  //========================= Self Calibration ==========================//
267  //=====================================================================//
268 
269 
270  //=====================================================================//
271  //============================== Target Body ==========================//
272  //=====================================================================//
273  // Note targeBody information is not currently serialized.
276 // bool solveTargetBodyPolePosition() const;
277 // static TargetRadiiSolveMethod stringToTargetRadiiOption(QString option);
278 // static QString targetRadiiOptionToString(TargetRadiiSolveMethod targetRadiiSolveMethod);
279  int numberTargetBodyParameters() const;
280  bool solveTargetBody() const;
281  bool solvePoleRA() const;
282  bool solvePoleRAVelocity() const;
283  bool solvePoleDec() const;
284  bool solvePoleDecVelocity() const;
285  bool solvePM() const;
286  bool solvePMVelocity() const;
287  bool solvePMAcceleration() const;
288  bool solveTriaxialRadii() const;
289  bool solveMeanRadius() const;
290 // void BundleSettings::setTargetBodySolveOptions(bool solveTargetBodyPolePosition,
291 
292 
293  //=====================================================================//
294  //================== Output Options ??? (from Jigsaw only)=============//
295  //=====================================================================//
297  void setSCPVLFilename(QString SCParamFilename);
298  QString outputFilePrefix() const;
299  void setCubeList(QString fileName);
300  QString cubeList() const;
301  QString SCPVLFilename() const;
302 
303  void save(QXmlStreamWriter &stream, const Project *project) const;
304 
305  private:
306  void init();
307 
308  //=====================================================================//
309  //============= Saving/Restoring a BundleSettings object ==============//
310  //=====================================================================//
311 
321  class XmlHandler : public XmlStackedHandler {
322  public:
323  XmlHandler(BundleSettings *bundleSettings,
324  Project *project);
325  XmlHandler(BundleSettings *bundleSettings);
326  ~XmlHandler();
327 
328  virtual bool startElement(const QString &namespaceURI,
329  const QString &localName,
330  const QString &qName,
331  const QXmlAttributes &atts);
332  virtual bool characters(const QString &ch);
333  virtual bool endElement(const QString &namespaceURI,
334  const QString &localName,
335  const QString &qName);
336  bool fatalError(const QXmlParseException &exception);
337 
338  private:
339  Q_DISABLE_COPY(XmlHandler);
340 
341  BundleSettings *m_xmlHandlerBundleSettings ;
342  Project *m_xmlHandlerProject; // TODO: does xml stuff need project???
343  QString m_xmlHandlerCharacters;
344  QList<BundleObservationSolveSettings *> m_xmlHandlerObservationSettings;
345  };
346 
347 
353  struct MaximumLikelihoodModelTableRecord {
354  unsigned int indexFieldValue;
355  QString nameFieldValue;
356  double quantileFieldValue;
357  };
358 
359  bool m_validateNetwork;
360  QString m_cubeList;
361  bool m_solveObservationMode;
362  bool m_solveRadius;
363  bool m_updateCubeLabel;
364  bool m_errorPropagation;
365  bool m_createInverseMatrix;
366  bool m_outlierRejection;
368  double m_outlierRejectionMultiplier;
371  // Parameter Uncertainties (Weighting)
372  double m_globalPointCoord1AprioriSigma;
373  double m_globalPointCoord2AprioriSigma;
374  double m_globalPointCoord3AprioriSigma;
375 
376  // QList of observation solve settings
377  QList<BundleObservationSolveSettings> m_observationSolveSettings;
378 
379  // Convergence Criteria
380  ConvergenceCriteria m_convergenceCriteria;
383  double m_convergenceCriteriaThreshold;
385  int m_convergenceCriteriaMaximumIterations;
389  // Maximum Likelihood Estimation Options
398 
399  // Self Calibration
400 
401  // Target Body
402  bool m_solveTargetBody;
403  BundleTargetBodyQsp m_bundleTargetBody;
405  // Control Points
406  SurfacePoint::CoordinateType m_cpCoordTypeReports;
408  SurfacePoint::CoordinateType m_cpCoordTypeBundle;
410  // Output Options
411  QString m_outputFilePrefix;
414  };
415  // typedefs
418 
419 
420 };
421 
423 
424 #endif
Q_DECLARE_METATYPE(Isis::BundleSettingsQsp)
bool solveMeanRadius() const
This method is used to determine whether the bundle adjustment will solve for target body mean radius...
Definition: BundleSettings.cpp:956
Use a Huber maximum likelihood model.
Definition: BundleSettings.h:245
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
The value of sigma0 will be used to determine that the bundle adjustment has converged.
Definition: BundleSettings.h:211
The main project for ipce.
Definition: Project.h:289
void setObservationSolveOptions(QList< BundleObservationSolveSettings > obsSolveSettingsList)
Add the list of solve options for each observation.
Definition: BundleSettings.cpp:339
File name manipulation and expansion.
Definition: FileName.h:116
static QString convergenceCriteriaToString(ConvergenceCriteria criteria)
Converts the given BundleSettings::ConvergenceCriteria enumeration to a string.
Definition: BundleSettings.cpp:620
double convergenceCriteriaThreshold() const
Retrieves the convergence threshold to be used to solve the bundle adjustment.
Definition: BundleSettings.cpp:666
bool errorPropagation() const
This method is used to determine whether this bundle adjustment will perform error propagation...
Definition: BundleSettings.cpp:440
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > maximumLikelihoodEstimatorModels() const
Retrieves the list of maximum likelihood estimator (MLE) models with their corresponding C-Quantiles...
Definition: BundleSettings.cpp:744
void setOutputFilePrefix(QString outputFilePrefix)
Set the output file prefix for the bundle adjustment.
Definition: BundleSettings.cpp:1017
void setConvergenceCriteria(ConvergenceCriteria criteria, double threshold, int maximumIterations)
Set the convergence criteria options for the bundle adjustment.
Definition: BundleSettings.cpp:640
SurfacePoint::CoordinateType controlPointCoordTypeBundle() const
Indicates the control point coordinate type for the actual bundle adjust.
Definition: BundleSettings.cpp:367
int numberTargetBodyParameters() const
This method is used to determine whether the bundle adjustment will solve for target body pole positi...
Definition: BundleSettings.cpp:796
QString SCPVLFilename() const
bool validateNetwork() const
This method is used to determine whether to validate the network before the bundle adjustment...
Definition: BundleSettings.cpp:215
QString outputFilePrefix() const
Retrieve the output file prefix.
Definition: BundleSettings.cpp:1031
bool solvePMAcceleration() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:924
bool updateCubeLabel() const
This method is used to determine whether this bundle adjustment will update the cube labels...
Definition: BundleSettings.cpp:429
bool solvePoleDecVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
Definition: BundleSettings.cpp:876
int numberSolveSettings() const
Retrieves the number of observation solve settings.
Definition: BundleSettings.cpp:509
void setCubeList(QString fileName)
BundleSettings::setCubeList.
Definition: BundleSettings.cpp:226
bool solvePoleDec() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
Definition: BundleSettings.cpp:860
void save(QXmlStreamWriter &stream, const Project *project) const
This method is used to write a BundleSettings object in an XML format.
Definition: BundleSettings.cpp:1045
Model
The supported maximum likelihood estimation models.
Definition: MaximumLikelihoodWFunctions.h:71
ConvergenceCriteria convergenceCriteria() const
Retrieves the convergence criteria to be used to solve the bundle adjustment.
Definition: BundleSettings.cpp:655
Use a modified Huber maximum likelihood model.
Definition: BundleSettings.h:248
double globalPointCoord2AprioriSigma() const
Retrieves the global a priori sigma for 2nd coordinate of points for this bundle. ...
Definition: BundleSettings.cpp:488
void setCreateInverseMatrix(bool createMatrix)
Turn the creation of the inverse correlation matrix file on or off.
Definition: BundleSettings.cpp:458
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:156
~BundleSettings()
Destroys the BundleSettings object.
Definition: BundleSettings.cpp:145
bool outlierRejection() const
This method is used to determine whether outlier rejection will be performed on this bundle adjustmen...
Definition: BundleSettings.cpp:395
Do not use a maximum likelihood model.
Definition: BundleSettings.h:244
void setBundleTargetBody(BundleTargetBodyQsp bundleTargetBody)
Sets the target body for the bundle adjustment.
Definition: BundleSettings.cpp:763
void addMaximumLikelihoodEstimatorModel(MaximumLikelihoodWFunctions::Model model, double cQuantile)
Add a maximum likelihood estimator (MLE) model to the bundle adjustment.
Definition: BundleSettings.cpp:722
void setSCPVLFilename(QString SCParamFilename)
BundleSettings()
Constructs a BundleSettings object.
Definition: BundleSettings.cpp:31
All parameter corrections will be used to determine that the bundle adjustment has converged...
Definition: BundleSettings.h:213
SurfacePoint::CoordinateType controlPointCoordTypeReports() const
Indicates the control point coordinate type for reports.
Definition: BundleSettings.cpp:353
int convergenceCriteriaMaximumIterations() const
Retrieves the maximum number of iterations allowed to solve the bundle adjustment.
Definition: BundleSettings.cpp:679
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
Definition: BundleSettings.h:417
Container class for BundleAdjustment settings.
Definition: BundleSettings.h:138
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:112
QList< BundleObservationSolveSettings > observationSolveSettings() const
Retrieves solve settings for the observation corresponding to the given index.
Definition: BundleSettings.cpp:571
void setValidateNetwork(bool validate)
Sets the internal flag to indicate whether to validate the network before the bundle adjustment...
Definition: BundleSettings.cpp:200
Use a Chen maximum likelihood model.
Definition: BundleSettings.h:254
BundleSettings & operator=(const BundleSettings &other)
Assignment operator to allow proper copying of the &#39;other&#39; BundleSettings object to this one...
Definition: BundleSettings.cpp:161
Use a Welsch maximum likelihood model.
Definition: BundleSettings.h:251
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Definition: BundleObservationSolveSettings.h:91
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
Definition: NaifDskApi.cpp:45
bool solveRadius() const
This method is used to determine whether this bundle adjustment will solve for radius.
Definition: BundleSettings.cpp:417
bool solvePMVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:908
bool solveTriaxialRadii() const
This method is used to determine whether the bundle adjustment will solve for target body triaxial ra...
Definition: BundleSettings.cpp:940
MaximumLikelihoodModel
This enum defines the options for maximum likelihood estimation.
Definition: BundleSettings.h:243
static ConvergenceCriteria stringToConvergenceCriteria(QString criteria)
Converts the given string value to a BundleSettings::ConvergenceCriteria enumeration.
Definition: BundleSettings.cpp:596
bool solveTargetBody() const
This method is used to determine whether the bundle adjustment will solve for target body...
Definition: BundleSettings.cpp:810
Definition: BoxcarCachingAlgorithm.h:29
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
double outlierRejectionMultiplier() const
Retrieves the outlier rejection multiplier for the bundle adjustment.
Definition: BundleSettings.cpp:468
bool solvePM() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:892
bool solvePoleRAVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
Definition: BundleSettings.cpp:844
double globalPointCoord3AprioriSigma() const
Retrieves the global a priori sigma 3rd coordinate of points for this bundle.
Definition: BundleSettings.cpp:498
bool createInverseMatrix() const
Indicates if the settings will allow the inverse correlation matrix to be created.
Definition: BundleSettings.cpp:383
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
void setOutlierRejection(bool outlierRejection, double multiplier=1.0)
Set the outlier rejection options for the bundle adjustment.
Definition: BundleSettings.cpp:321
double globalPointCoord1AprioriSigma() const
Retrieves global a priori sigma for 1st coordinate of points for this bundle.
Definition: BundleSettings.cpp:478
bool solveObservationMode() const
This method is used to determine whether this bundle adjustment will solve for observation mode...
Definition: BundleSettings.cpp:406
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:25
void setSolveOptions(bool solveObservationMode=false, bool updateCubeLabel=false, bool errorPropagation=false, bool solveRadius=false, SurfacePoint::CoordinateType coordTypeBundle=SurfacePoint::Latitudinal, SurfacePoint::CoordinateType coordTypeReports=SurfacePoint::Latitudinal, double globalPointCoord1AprioriSigma=Isis::Null, double globalPointCoord2AprioriSigma=Isis::Null, double globalPointCoord3AprioriSigma=Isis::Null)
Set the solve options for the bundle adjustment.
Definition: BundleSettings.cpp:261
BundleTargetBodyQsp bundleTargetBody() const
Retrieves a pointer to target body information for the bundle adjustment.
Definition: BundleSettings.cpp:774
QString cubeList() const
BundleSettings::cubeList.
Definition: BundleSettings.cpp:236
bool solvePoleRA() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
Definition: BundleSettings.cpp:828
ConvergenceCriteria
This enum defines the options for the bundle adjustment&#39;s convergence.
Definition: BundleSettings.h:210