Isis Developer Reference
BundleSettings.h
Go to the documentation of this file.
1 #ifndef BundleSettings_h
2 #define BundleSettings_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 // Qt library
13 #include <QList>
14 #include <QPair>
15 #include <QSharedPointer>
16 #include <QString>
17 
18 
19 
20 // ISIS library
21 #include "BundleTargetBody.h"
24 #include "SpecialPixel.h"
25 #include "SurfacePoint.h"
26 #include "XmlStackedHandler.h"
27 
28 class QDataStream;
29 class QUuid;
30 class QXmlStreamWriter;
31 
32 
33 using namespace Isis;
34 
35 namespace Isis {
36  class FileName;
37  class Project;
38  class PvlObject;
40 
126  public:
127 
128  //=====================================================================//
129  //================ constructors, destructor, operators ================//
130  //=====================================================================//
131  BundleSettings();
132  BundleSettings(const BundleSettings &other);
133  BundleSettings(Project *project,
134  XmlStackedHandlerReader *xmlReader);
135 #if 0
136  BundleSettings(FileName xmlFile,
137  Project *project,
138  XmlStackedHandlerReader *xmlReader,
139  QObject *parent = NULL);
141  QObject *parent = NULL);
142 #endif
143  ~BundleSettings();
144  BundleSettings &operator=(const BundleSettings &other);
145 
146  void setValidateNetwork(bool validate);
147  bool validateNetwork() const;
148 
149 
150  //=====================================================================//
151  //============================ Solve options ==========================//
152  //=====================================================================//
153 
154  // mutators
155  void setSolveOptions(bool solveObservationMode = false,
156  bool updateCubeLabel = false,
157  bool errorPropagation = false,
158  bool solveRadius = false,
165  double multiplier = 1.0);
167  void setCreateInverseMatrix(bool createMatrix);
168 
169  // accessors
172  bool createInverseMatrix() const;
173  bool solveObservationMode() const;
174  bool solveRadius() const;
175  bool updateCubeLabel() const;
176  bool errorPropagation() const;
177  bool outlierRejection() const;
178  double outlierRejectionMultiplier() const;
179 // These sigmas are either for planetocentric lat/lon/radius or body-fixed x/y/z
180  double globalPointCoord1AprioriSigma() const;
181  double globalPointCoord2AprioriSigma() const;
182  double globalPointCoord3AprioriSigma() const;
183 
184  int numberSolveSettings() const;
185  BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const;
188 
189 
190  //=====================================================================//
191  //======================- Convergence Criteria ========================//
192  //=====================================================================//
193 
198  Sigma0,
202  };
203 
204 
205  static ConvergenceCriteria stringToConvergenceCriteria(QString criteria);
206  static QString convergenceCriteriaToString(ConvergenceCriteria criteria);
208  double threshold,
209  int maximumIterations);
211  double convergenceCriteriaThreshold() const;
213 
214  //=====================================================================//
215  //================ Parameter Uncertainties (Weighting) ================//
216  //=====================================================================//
217  // mutators
218 // void setGlobalLatitudeAprioriSigma(double sigma);
219 // void setGlobalLongitudeAprioriSigma(double sigma);
220 // void setGlobalRadiiAprioriSigma(double sigma);
221 
222 
223  //=====================================================================//
224  //=============== Maximum Likelihood Estimation Options ===============//
225  //=====================================================================//
226 
232  Huber,
235  ModifiedHuber,
238  Welsch,
241  Chen
244  };
245 
246 
248  double cQuantile);
251 
252  //=====================================================================//
253  //========================= Self Calibration ==========================//
254  //=====================================================================//
255 
256 
257  //=====================================================================//
258  //============================== Target Body ==========================//
259  //=====================================================================//
260  // Note targeBody information is not currently serialized.
263 // bool solveTargetBodyPolePosition() const;
264 // static TargetRadiiSolveMethod stringToTargetRadiiOption(QString option);
265 // static QString targetRadiiOptionToString(TargetRadiiSolveMethod targetRadiiSolveMethod);
266  int numberTargetBodyParameters() const;
267  bool solveTargetBody() const;
268  bool solvePoleRA() const;
269  bool solvePoleRAVelocity() const;
270  bool solvePoleDec() const;
271  bool solvePoleDecVelocity() const;
272  bool solvePM() const;
273  bool solvePMVelocity() const;
274  bool solvePMAcceleration() const;
275  bool solveTriaxialRadii() const;
276  bool solveMeanRadius() const;
277 // void BundleSettings::setTargetBodySolveOptions(bool solveTargetBodyPolePosition,
278 
279 
280  //=====================================================================//
281  //================== Output Options ??? (from Jigsaw only)=============//
282  //=====================================================================//
284  void setSCPVLFilename(QString SCParamFilename);
285  QString outputFilePrefix() const;
286  void setCubeList(QString fileName);
287  QString cubeList() const;
288  QString SCPVLFilename() const;
289 
290  void save(QXmlStreamWriter &stream, const Project *project) const;
291 
292  private:
293  void init();
294 
295  //=====================================================================//
296  //============= Saving/Restoring a BundleSettings object ==============//
297  //=====================================================================//
298 
308  class XmlHandler : public XmlStackedHandler {
309  public:
310  XmlHandler(BundleSettings *bundleSettings,
311  Project *project);
312  XmlHandler(BundleSettings *bundleSettings);
313  ~XmlHandler();
314 
315  virtual bool startElement(const QString &namespaceURI,
316  const QString &localName,
317  const QString &qName,
318  const QXmlAttributes &atts);
319  virtual bool characters(const QString &ch);
320  virtual bool endElement(const QString &namespaceURI,
321  const QString &localName,
322  const QString &qName);
323  bool fatalError(const QXmlParseException &exception);
324 
325  private:
326  Q_DISABLE_COPY(XmlHandler);
327 
328  BundleSettings *m_xmlHandlerBundleSettings ;
329  Project *m_xmlHandlerProject; // TODO: does xml stuff need project???
330  QString m_xmlHandlerCharacters;
331  QList<BundleObservationSolveSettings *> m_xmlHandlerObservationSettings;
332  };
333 
334 
340  struct MaximumLikelihoodModelTableRecord {
341  unsigned int indexFieldValue;
342  QString nameFieldValue;
343  double quantileFieldValue;
344  };
345 
346  bool m_validateNetwork;
347  QString m_cubeList;
348  bool m_solveObservationMode;
349  bool m_solveRadius;
350  bool m_updateCubeLabel;
351  bool m_errorPropagation;
352  bool m_createInverseMatrix;
353  bool m_outlierRejection;
355  double m_outlierRejectionMultiplier;
358  // Parameter Uncertainties (Weighting)
359  double m_globalPointCoord1AprioriSigma;
360  double m_globalPointCoord2AprioriSigma;
361  double m_globalPointCoord3AprioriSigma;
362 
363  // QList of observation solve settings
364  QList<BundleObservationSolveSettings> m_observationSolveSettings;
365 
366  // Convergence Criteria
367  ConvergenceCriteria m_convergenceCriteria;
370  double m_convergenceCriteriaThreshold;
372  int m_convergenceCriteriaMaximumIterations;
376  // Maximum Likelihood Estimation Options
385 
386  // Self Calibration
387 
388  // Target Body
389  bool m_solveTargetBody;
390  BundleTargetBodyQsp m_bundleTargetBody;
392  // Control Points
393  SurfacePoint::CoordinateType m_cpCoordTypeReports;
395  SurfacePoint::CoordinateType m_cpCoordTypeBundle;
397  // Output Options
398  QString m_outputFilePrefix;
401  };
402  // typedefs
405 
406 
407 };
408 
410 
411 #endif
BundleObservationSolveSettings.h
Isis::BundleSettings::globalPointCoord1AprioriSigma
double globalPointCoord1AprioriSigma() const
Retrieves global a priori sigma for 1st coordinate of points for this bundle.
Definition: BundleSettings.cpp:486
Isis::BundleSettings::save
void save(QXmlStreamWriter &stream, const Project *project) const
This method is used to write a BundleSettings object in an XML format.
Definition: BundleSettings.cpp:1050
Isis::BundleSettings::setObservationSolveOptions
void setObservationSolveOptions(QList< BundleObservationSolveSettings > obsSolveSettingsList)
Add the list of solve options for each observation.
Definition: BundleSettings.cpp:347
Isis::BundleSettings::ParameterCorrections
@ ParameterCorrections
All parameter corrections will be used to determine that the bundle adjustment has converged.
Definition: BundleSettings.h:200
Isis::BundleSettings::solveTargetBody
bool solveTargetBody() const
This method is used to determine whether the bundle adjustment will solve for target body.
Definition: BundleSettings.cpp:815
Isis::BundleSettings::Welsch
@ Welsch
Use a Welsch maximum likelihood model.
Definition: BundleSettings.h:238
Isis::PvlObject
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:61
Isis::BundleSettings::maximumLikelihoodEstimatorModels
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > maximumLikelihoodEstimatorModels() const
Retrieves the list of maximum likelihood estimator (MLE) models with their corresponding C-Quantiles.
Definition: BundleSettings.cpp:749
Isis::BundleSettings::errorPropagation
bool errorPropagation() const
This method is used to determine whether this bundle adjustment will perform error propagation.
Definition: BundleSettings.cpp:448
MaximumLikelihoodWFunctions.h
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::BundleSettings::solveMeanRadius
bool solveMeanRadius() const
This method is used to determine whether the bundle adjustment will solve for target body mean radius...
Definition: BundleSettings.cpp:961
Project.h
Isis::BundleSettings::globalPointCoord3AprioriSigma
double globalPointCoord3AprioriSigma() const
Retrieves the global a priori sigma 3rd coordinate of points for this bundle.
Definition: BundleSettings.cpp:506
Isis::BundleSettings::solveRadius
bool solveRadius() const
This method is used to determine whether this bundle adjustment will solve for radius.
Definition: BundleSettings.cpp:425
Q_DECLARE_METATYPE
Q_DECLARE_METATYPE(Isis::BundleSettingsQsp)
SpecialPixel.h
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::BundleSettings::setBundleTargetBody
void setBundleTargetBody(BundleTargetBodyQsp bundleTargetBody)
Sets the target body for the bundle adjustment.
Definition: BundleSettings.cpp:768
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::MaximumLikelihoodWFunctions::Model
Model
The supported maximum likelihood estimation models.
Definition: MaximumLikelihoodWFunctions.h:56
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::BundleSettings::convergenceCriteriaThreshold
double convergenceCriteriaThreshold() const
Retrieves the convergence threshold to be used to solve the bundle adjustment.
Definition: BundleSettings.cpp:671
Isis::BundleSettings::setCubeList
void setCubeList(QString fileName)
BundleSettings::setCubeList.
Definition: BundleSettings.cpp:234
Isis::BundleSettings::convergenceCriteria
ConvergenceCriteria convergenceCriteria() const
Retrieves the convergence criteria to be used to solve the bundle adjustment.
Definition: BundleSettings.cpp:660
Isis::BundleSettings::bundleTargetBody
BundleTargetBodyQsp bundleTargetBody() const
Retrieves a pointer to target body information for the bundle adjustment.
Definition: BundleSettings.cpp:779
Isis::BundleSettings::solvePoleRA
bool solvePoleRA() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
Definition: BundleSettings.cpp:833
BundleSettings.h
Isis::Project::clear
void clear()
Function to clear out all values in a project essentially making it a new project object.
Definition: Project.cpp:459
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
Isis::BundleSettings::operator=
BundleSettings & operator=(const BundleSettings &other)
Assignment operator to allow proper copying of the 'other' BundleSettings object to this one.
Definition: BundleSettings.cpp:169
Isis::BundleSettings::setCreateInverseMatrix
void setCreateInverseMatrix(bool createMatrix)
Turn the creation of the inverse correlation matrix file on or off.
Definition: BundleSettings.cpp:466
Isis::BundleSettings::numberTargetBodyParameters
int numberTargetBodyParameters() const
This method is used to determine whether the bundle adjustment will solve for target body pole positi...
Definition: BundleSettings.cpp:801
BundleTargetBody.h
QSharedPointer< BundleTargetBody >
Isis::BundleSettings::setConvergenceCriteria
void setConvergenceCriteria(ConvergenceCriteria criteria, double threshold, int maximumIterations)
Set the convergence criteria options for the bundle adjustment.
Definition: BundleSettings.cpp:645
Isis::BundleSettings::addMaximumLikelihoodEstimatorModel
void addMaximumLikelihoodEstimatorModel(MaximumLikelihoodWFunctions::Model model, double cQuantile)
Add a maximum likelihood estimator (MLE) model to the bundle adjustment.
Definition: BundleSettings.cpp:727
Isis::toString
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:211
Isis::XmlStackedHandlerReader
Manage a stack of content handlers for reading XML files.
Definition: XmlStackedHandlerReader.h:30
Isis::BundleSettings::validateNetwork
bool validateNetwork() const
This method is used to determine whether to validate the network before the bundle adjustment.
Definition: BundleSettings.cpp:223
Isis::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
IString.h
Isis::BundleSettings::Huber
@ Huber
Use a Huber maximum likelihood model.
Definition: BundleSettings.h:232
Isis::BundleSettings::solvePoleDec
bool solvePoleDec() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
Definition: BundleSettings.cpp:865
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::BundleSettings::Sigma0
@ Sigma0
The value of sigma0 will be used to determine that the bundle adjustment has converged.
Definition: BundleSettings.h:198
Isis::BundleSettings::MaximumLikelihoodModel
MaximumLikelihoodModel
This enum defines the options for maximum likelihood estimation.
Definition: BundleSettings.h:230
Isis::BundleSettings::setSolveOptions
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:269
Isis::BundleSettings::stringToConvergenceCriteria
static ConvergenceCriteria stringToConvergenceCriteria(QString criteria)
Converts the given string value to a BundleSettings::ConvergenceCriteria enumeration.
Definition: BundleSettings.cpp:601
Isis::SurfacePoint::Rectangular
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
Definition: SurfacePoint.h:141
Isis::MaximumLikelihoodWFunctions::modelToString
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
Definition: MaximumLikelihoodWFunctions.cpp:355
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::SurfacePoint::CoordinateType
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:139
Isis::BundleSettings::ConvergenceCriteria
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
Definition: BundleSettings.h:197
Isis::MaximumLikelihoodWFunctions::stringToModel
static MaximumLikelihoodWFunctions::Model stringToModel(QString modelName)
Definition: MaximumLikelihoodWFunctions.cpp:367
Isis::BundleSettings::~BundleSettings
~BundleSettings()
Destroys the BundleSettings object.
Definition: BundleSettings.cpp:153
Isis::BundleSettings::SCPVLFilename
QString SCPVLFilename() const
Isis::BundleSettings::solvePMAcceleration
bool solvePMAcceleration() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:929
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::MaximumLikelihoodWFunctions::HuberModified
@ HuberModified
A modification to Huber's method propsed by William J.J.
Definition: MaximumLikelihoodWFunctions.h:73
Isis::BundleSettings::outputFilePrefix
QString outputFilePrefix() const
Retrieve the output file prefix.
Definition: BundleSettings.cpp:1036
Isis::BundleSettings::outlierRejectionMultiplier
double outlierRejectionMultiplier() const
Retrieves the outlier rejection multiplier for the bundle adjustment.
Definition: BundleSettings.cpp:476
SurfacePoint.h
Isis::BundleSettingsQsp
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
Definition: BundleSettings.h:404
Isis::BundleSettings::controlPointCoordTypeReports
SurfacePoint::CoordinateType controlPointCoordTypeReports() const
Indicates the control point coordinate type for reports.
Definition: BundleSettings.cpp:361
Isis::BundleSettings::solvePoleDecVelocity
bool solvePoleDecVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
Definition: BundleSettings.cpp:881
Isis::BundleSettings::BundleSettings
BundleSettings()
Constructs a BundleSettings object.
Definition: BundleSettings.cpp:39
Isis::BundleSettings::numberSolveSettings
int numberSolveSettings() const
Retrieves the number of observation solve settings.
Definition: BundleSettings.cpp:517
Isis::BundleSettings::setOutlierRejection
void setOutlierRejection(bool outlierRejection, double multiplier=1.0)
Set the outlier rejection options for the bundle adjustment.
Definition: BundleSettings.cpp:329
Isis::BundleSettings
Container class for BundleAdjustment settings.
Definition: BundleSettings.h:125
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::BundleSettings::convergenceCriteriaMaximumIterations
int convergenceCriteriaMaximumIterations() const
Retrieves the maximum number of iterations allowed to solve the bundle adjustment.
Definition: BundleSettings.cpp:684
Isis::SurfacePoint::stringToCoordinateType
static CoordinateType stringToCoordinateType(QString type)
This method converts the given string value to a SurfacePoint::CoordinateType enumeration.
Definition: SurfacePoint.cpp:1363
Isis::BundleSettings::globalPointCoord2AprioriSigma
double globalPointCoord2AprioriSigma() const
Retrieves the global a priori sigma for 2nd coordinate of points for this bundle.
Definition: BundleSettings.cpp:496
Isis::BundleSettings::setValidateNetwork
void setValidateNetwork(bool validate)
Sets the internal flag to indicate whether to validate the network before the bundle adjustment.
Definition: BundleSettings.cpp:208
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::BundleSettings::ModifiedHuber
@ ModifiedHuber
Use a modified Huber maximum likelihood model.
Definition: BundleSettings.h:235
Isis::BundleSettings::setSCPVLFilename
void setSCPVLFilename(QString SCParamFilename)
IException.h
Isis::toDouble
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:149
Isis::IException::Programmer
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:146
Isis::BundleSettings::createInverseMatrix
bool createInverseMatrix() const
Indicates if the settings will allow the inverse correlation matrix to be created.
Definition: BundleSettings.cpp:391
Isis::BundleSettings::updateCubeLabel
bool updateCubeLabel() const
This method is used to determine whether this bundle adjustment will update the cube labels.
Definition: BundleSettings.cpp:437
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
PvlKeyword.h
Isis::BundleSettings::NoMaximumLikelihoodEstimator
@ NoMaximumLikelihoodEstimator
Do not use a maximum likelihood model.
Definition: BundleSettings.h:231
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::BundleSettings::solvePMVelocity
bool solvePMVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:913
PvlObject.h
Isis::BundleSettings::solveTriaxialRadii
bool solveTriaxialRadii() const
This method is used to determine whether the bundle adjustment will solve for target body triaxial ra...
Definition: BundleSettings.cpp:945
Isis::BundleObservationSolveSettings
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Definition: BundleObservationSolveSettings.h:82
Isis::SurfacePoint::Latitudinal
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:140
Isis::BundleSettings::solveObservationMode
bool solveObservationMode() const
This method is used to determine whether this bundle adjustment will solve for observation mode.
Definition: BundleSettings.cpp:414
Isis::BundleSettings::observationSolveSettings
QList< BundleObservationSolveSettings > observationSolveSettings() const
Retrieves solve settings for the observation corresponding to the given index.
Definition: BundleSettings.cpp:576
Isis::BundleSettings::cubeList
QString cubeList() const
BundleSettings::cubeList.
Definition: BundleSettings.cpp:244
Isis::BundleSettings::convergenceCriteriaToString
static QString convergenceCriteriaToString(ConvergenceCriteria criteria)
Converts the given BundleSettings::ConvergenceCriteria enumeration to a string.
Definition: BundleSettings.cpp:625
QObject
Isis::validate
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
Definition: NaifDskApi.cpp:28
XmlStackedHandlerReader.h
XmlStackedHandler.h
Isis::BundleSettings::outlierRejection
bool outlierRejection() const
This method is used to determine whether outlier rejection will be performed on this bundle adjustmen...
Definition: BundleSettings.cpp:403
Isis::BundleSettings::solvePoleRAVelocity
bool solvePoleRAVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
Definition: BundleSettings.cpp:849
Isis::BundleSettings::Chen
@ Chen
Use a Chen maximum likelihood model.
Definition: BundleSettings.h:241
Isis::BundleSettings::solvePM
bool solvePM() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Definition: BundleSettings.cpp:897
Isis::BundleSettings::setOutputFilePrefix
void setOutputFilePrefix(QString outputFilePrefix)
Set the output file prefix for the bundle adjustment.
Definition: BundleSettings.cpp:1022
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::BundleSettings::controlPointCoordTypeBundle
SurfacePoint::CoordinateType controlPointCoordTypeBundle() const
Indicates the control point coordinate type for the actual bundle adjust.
Definition: BundleSettings.cpp:375