Isis 3.0
Back | Home
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 // hdf5 library
32 #include <H5Cpp.h>
33 #include <hdf5_hl.h>
34 #include <hdf5.h>
35 
36 // ISIS library
37 #include "BundleTargetBody.h"
40 #include "SpecialPixel.h"
41 #include "XmlStackedHandler.h"
42 
43 class QDataStream;
44 class QUuid;
45 class QXmlStreamWriter;
46 
47 using namespace H5;
48 using namespace Isis;
49 
50 namespace Isis {
51  class FileName;
52  class Project;
53  class PvlObject;
55 
120  public:
121 
122  //=====================================================================//
123  //================ constructors, destructor, operators ================//
124  //=====================================================================//
125  BundleSettings();
126  BundleSettings(const BundleSettings &other);
127  BundleSettings(Project *project,
128  XmlStackedHandlerReader *xmlReader);
129 #if 0
130  BundleSettings(FileName xmlFile,
131  Project *project,
132  XmlStackedHandlerReader *xmlReader,
133  QObject *parent = NULL);
135  QObject *parent = NULL);
136 #endif
137  ~BundleSettings();
138  BundleSettings &operator=(const BundleSettings &other);
139 
140  void setValidateNetwork(bool validate);
141  bool validateNetwork() const;
142 
143 
144  //=====================================================================//
145  //============================ Solve options ==========================//
146  //=====================================================================//
147 
148  // mutators
149  void setSolveOptions(bool solveObservationMode = false,
150  bool updateCubeLabel = false,
151  bool errorPropagation = false,
152  bool solveRadius = false,
153  double globalLatitudeAprioriSigma = Isis::Null,
154  double globalLongitudeAprioriSigma = Isis::Null,
155  double globalRadiusAprioriSigma = Isis::Null);
156  void setOutlierRejection(bool outlierRejection,
157  double multiplier = 1.0);
158  void setObservationSolveOptions(QList<BundleObservationSolveSettings> obsSolveSettingsList);
159  void setCreateInverseMatrix(bool createMatrix);
160 
161  // accessors
162  bool createInverseMatrix() const;
163  bool solveObservationMode() const;
164  bool solveRadius() const;
165  bool updateCubeLabel() const;
166  bool errorPropagation() const;
167  bool outlierRejection() const;
168  double outlierRejectionMultiplier() const;
169  double globalLatitudeAprioriSigma() const;
170  double globalLongitudeAprioriSigma() const;
171  double globalRadiusAprioriSigma() const;
172 
173  int numberSolveSettings() const;
174  BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const;
175  BundleObservationSolveSettings observationSolveSettings(int n) const;
176 
177 
178  //=====================================================================//
179  //======================- Convergence Criteria ========================//
180  //=====================================================================//
181 
186  Sigma0,
188  ParameterCorrections
190  };
191 
192 
193  static ConvergenceCriteria stringToConvergenceCriteria(QString criteria);
194  static QString convergenceCriteriaToString(ConvergenceCriteria criteria);
195  void setConvergenceCriteria(ConvergenceCriteria criteria,
196  double threshold,
197  int maximumIterations);
198  ConvergenceCriteria convergenceCriteria() const;
199  double convergenceCriteriaThreshold() const;
200  int convergenceCriteriaMaximumIterations() const;
201 
202  //=====================================================================//
203  //================ Parameter Uncertainties (Weighting) ================//
204  //=====================================================================//
205  // mutators
206 // void setGlobalLatitudeAprioriSigma(double sigma);
207 // void setGlobalLongitudeAprioriSigma(double sigma);
208 // void setGlobalRadiiAprioriSigma(double sigma);
209 
210 
211  //=====================================================================//
212  //=============== Maximum Likelihood Estimation Options ===============//
213  //=====================================================================//
214 
220  Huber,
223  ModifiedHuber,
226  Welsch,
229  Chen
232  };
233 
234 
235  void addMaximumLikelihoodEstimatorModel(MaximumLikelihoodWFunctions::Model model,
236  double cQuantile);
238  maximumLikelihoodEstimatorModels() const;
239 
240  //=====================================================================//
241  //========================= Self Calibration ==========================//
242  //=====================================================================//
243 
244 
245  //=====================================================================//
246  //============================== Target Body ==========================//
247  //=====================================================================//
248  void setBundleTargetBody(BundleTargetBodyQsp bundleTargetBody);
249  BundleTargetBodyQsp bundleTargetBody() const;
250 // bool solveTargetBodyPolePosition() const;
251 // static TargetRadiiSolveMethod stringToTargetRadiiOption(QString option);
252 // static QString targetRadiiOptionToString(TargetRadiiSolveMethod targetRadiiSolveMethod);
253  int numberTargetBodyParameters() const;
254  bool solveTargetBody() const;
255  bool solvePoleRA() const;
256  bool solvePoleRAVelocity() const;
257  bool solvePoleDec() const;
258  bool solvePoleDecVelocity() const;
259  bool solvePM() const;
260  bool solvePMVelocity() const;
261  bool solvePMAcceleration() const;
262  bool solveTriaxialRadii() const;
263  bool solveMeanRadius() const;
264 // void BundleSettings::setTargetBodySolveOptions(bool solveTargetBodyPolePosition,
265 
266 
267  //=====================================================================//
268  //================== Output Options ??? (from Jigsaw only)=============//
269  //=====================================================================//
270  void setOutputFilePrefix(QString outputFilePrefix);
271  void setSCPVLFilename(QString SCParamFilename);
272  QString outputFilePrefix() const;
273  QString SCPVLFilename() const;
274 
275  PvlObject pvlObject(QString name = "BundleSettings") const;
276 
277  void save(QXmlStreamWriter &stream, const Project *project) const;
278 
279  QDataStream &write(QDataStream &stream) const;
280  QDataStream &read(QDataStream &stream);
281 
282  void createH5Group(hid_t locationId,
283  QString locationName) const; //delete
284  void parseH5Group(hid_t locationId,
285  QString locationName); //delete
286 
287  void createH5Group(H5::CommonFG &locationObject,
288  QString locationName) const;
289  H5::Group createH5Group2(H5::Group locationGroup,
290  QString locationName);
291  void openH5Group(H5::CommonFG &locationObject,
292  QString locationName);
293  BundleSettings(H5::CommonFG &locationObject,
294  QString locationName);
295 
296  private:
297 
298  //=====================================================================//
299  //============= Saving/Restoring a BundleSettings object ==============//
300  //=====================================================================//
301 
311  class XmlHandler : public XmlStackedHandler {
312  public:
313  XmlHandler(BundleSettings *bundleSettings,
314  Project *project);
315  XmlHandler(BundleSettings *bundleSettings);
316  ~XmlHandler();
317 
318  virtual bool startElement(const QString &namespaceURI,
319  const QString &localName,
320  const QString &qName,
321  const QXmlAttributes &atts);
322  virtual bool characters(const QString &ch);
323  virtual bool endElement(const QString &namespaceURI,
324  const QString &localName,
325  const QString &qName);
326  bool fatalError(const QXmlParseException &exception);
327 
328  private:
329  Q_DISABLE_COPY(XmlHandler);
330 
331  BundleSettings *m_xmlHandlerBundleSettings ;
332  Project *m_xmlHandlerProject; // TODO: does xml stuff need project???
333  QString m_xmlHandlerCharacters;
334  QList<BundleObservationSolveSettings *> m_xmlHandlerObservationSettings;
335  };
336 
337 
343  struct MaximumLikelihoodModelTableRecord {
344  unsigned int indexFieldValue;
345  QString nameFieldValue;
346  double quantileFieldValue;
347  };
348 
349  QUuid *m_id;
351  bool m_validateNetwork;
352  bool m_solveObservationMode;
353  bool m_solveRadius;
354  bool m_updateCubeLabel;
355  bool m_errorPropagation;
356  bool m_createInverseMatrix;
357  bool m_outlierRejection;
359  double m_outlierRejectionMultiplier;
362  // Parameter Uncertainties (Weighting)
363  double m_globalLatitudeAprioriSigma;
364  double m_globalLongitudeAprioriSigma;
365  double m_globalRadiusAprioriSigma;
366 
367  // QList of observation solve settings
368  QList<BundleObservationSolveSettings> m_observationSolveSettings;
369 
370  // Convergence Criteria
371  ConvergenceCriteria m_convergenceCriteria;
374  double m_convergenceCriteriaThreshold;
376  int m_convergenceCriteriaMaximumIterations;
380  // Maximum Likelihood Estimation Options
389 
390  // Self Calibration
391 
392  // Target Body
393  bool m_solveTargetBody;
394  BundleTargetBodyQsp m_bundleTargetBody;
397  // Output Options
398  QString m_outputFilePrefix;
401  };
402  // typedefs
404  typedef QSharedPointer<BundleSettings> BundleSettingsQsp;
405 
406  // operators to read/write BundleResults to/from binary data
407  QDataStream &operator<<(QDataStream &stream, const BundleSettings &settings);
408  QDataStream &operator>>(QDataStream &stream, BundleSettings &settings);
409 };
410 
412 
413 #endif
414 
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:109
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
Definition: BundleSettings.h:404
The main project for cnetsuite.
Definition: Project.h:105
File name manipulation and expansion.
Definition: FileName.h:111
QSharedPointer< BundleTargetBody > BundleTargetBodyQsp
Definition for BundleTargetBodyQsp, a QSharedPointer to a BundleTargetBody.
Definition: BundleTargetBody.h:198
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
Model
The supported maximum likelihood estimation models.
Definition: MaximumLikelihoodWFunctions.h:69
QDebug operator<<(QDebug dbg, const Isis::Angle &angleToPrint)
Display an Angle for a debugging statement.
Definition: Angle.cpp:379
Do not use a maximum likelihood model.
Definition: BundleSettings.h:219
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:463
Container class for BundleAdjustment settings.
Definition: BundleSettings.h:119
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:47
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Definition: BundleObservationSolveSettings.h:84
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
Definition: NaifDskApi.cpp:54
MaximumLikelihoodModel
This enum defines the options for maximum likelihood estimation.
Definition: BundleSettings.h:218
Definition: BoxcarCachingAlgorithm.h:29
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
his enables stack-based XML parsing of XML files.
Definition: XmlStackedHandlerReader.h:26
ConvergenceCriteria
This enum defines the options for the bundle adjustment&#39;s convergence.
Definition: BundleSettings.h:185

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:15:19