Isis 3.0 Programmer Reference
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 
344  unsigned int indexFieldValue;
345  QString nameFieldValue;
347  };
348 
349  QUuid *m_id;
362  // Parameter Uncertainties (Weighting)
366 
367  // QList of observation solve settings
368  QList<BundleObservationSolveSettings> m_observationSolveSettings;
369 
370  // Convergence Criteria
380  // Maximum Likelihood Estimation Options
389 
390  // Self Calibration
391 
392  // Target Body
397  // Output Options
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 
unsigned int indexFieldValue
The index of the TableRecord.???
double m_globalLongitudeAprioriSigma
The global a priori sigma for longitude.
bool m_createInverseMatrix
Indicates whether to create the inverse matrix file.
BundleTargetBodyQsp m_bundleTargetBody
A pointer to the target body settings and information.
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.
The main project for cnetsuite.
Definition: Project.h:105
File name manipulation and expansion.
Definition: FileName.h:111
bool m_solveObservationMode
Indicates whether to solve for observation mode.
ConvergenceCriteria m_convergenceCriteria
Enumeration used to indicate what criteria to use to determine bundle adjustment convergence.
QSharedPointer< BundleTargetBody > BundleTargetBodyQsp
Definition for BundleTargetBodyQsp, a QSharedPointer to a BundleTargetBody.
double m_outlierRejectionMultiplier
The multiplier value for outlier rejection.
Q_DECLARE_METATYPE(Isis::Cube *)
This allows Cube *&#39;s to be stored in a QVariant.
QString m_outputFilePrefix
The prefix for all output files.
Model
The supported maximum likelihood estimation models.
bool m_validateNetwork
Indicates whether the network should be validated.
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.
bool m_updateCubeLabel
Indicates whether to update cubes.
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > m_maximumLikelihood
Model and C-Quantile for each of the three maximum likelihood estimations.
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
Definition: CSVReader.cpp:463
Container class for BundleAdjustment settings.
XML Handler that parses XMLs in a stack-oriented way.
This class is needed to read/write BundleSettings from/to an XML formateed file.
double m_convergenceCriteriaThreshold
Tolerance value corresponding to the selected convergence criteria.
This class is used to modify and manage solve settings for 1 to many BundleObservations.
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
Definition: NaifDskApi.cpp:54
double m_globalLatitudeAprioriSigma
The global a priori sigma for latitude.
MaximumLikelihoodModel
This enum defines the options for maximum likelihood estimation.
bool m_outlierRejection
Indicates whether to perform automatic outlier detection/rejection.
bool m_solveRadius
Indicates whether to solve for point radii.
int m_convergenceCriteriaMaximumIterations
Maximum number of iterations before quitting the bundle adjustment if it has not yet converged to the...
QString nameFieldValue
The model name of the TableRecord.???
double quantileFieldValue
The quantile of the TableRecord.???
double m_globalRadiusAprioriSigma
The global a priori sigma for radius.
This struct is needed to write the m_maximumLikelihood variable as an HDF5 table. ...
bool m_solveTargetBody
Indicates whether to solve for target body.
Contains Pvl Groups and Pvl Objects.
Definition: PvlObject.h:74
bool m_errorPropagation
Indicates whether to perform error propagation.
his enables stack-based XML parsing of XML files.
QUuid * m_id
A unique ID for this BundleSettings object.
ConvergenceCriteria
This enum defines the options for the bundle adjustment&#39;s convergence.

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:14