Isis Developer Reference
BundleObservationSolveSettings.h
Go to the documentation of this file.
1 #ifndef BundleObservationSolveSettings_h
2 #define BundleObservationSolveSettings_h
3 
10 /* SPDX-License-Identifier: CC0-1.0 */
11 
12 #include <QList>
13 #include <QSet>
14 #include <QString>
15 #include <QStringList>
16 
17 #include <csm.h>
18 
19 #include "SpicePosition.h"
20 #include "SpiceRotation.h"
21 #include "XmlStackedHandler.h"
22 
23 class QDataStream;
24 class QUuid;
25 class QXmlStreamWriter;
26 
27 namespace Isis {
28  class FileName;
29  class Project; // TODO: does xml stuff need project???
30  class PvlObject;
31  class XmlStackedHandlerReader;
83 
84  public:
87  XmlStackedHandlerReader *xmlReader); // TODO: does xml stuff need project???
89  Project *project,
90  XmlStackedHandlerReader *xmlReader); // TODO: does xml stuff need project???
92  BundleObservationSolveSettings(const PvlGroup &scParameterGroup);
95  void initialize();
96 
97  void setInstrumentId(QString instrumentId);
98  QString instrumentId() const;
99  void addObservationNumber(QString observationNumber);
100  bool removeObservationNumber(QString observationNumber);
102 
106  Set = 1,
107  Type = 2,
108  List = 3
109  };
110 
111  static CSMSolveOption stringToCSMSolveOption(QString option);
112  static QString csmSolveOptionToString(CSMSolveOption option);
113  static csm::param::Set stringToCSMSolveSet(QString set);
114  static QString csmSolveSetToString(csm::param::Set set);
115  static csm::param::Type stringToCSMSolveType(QString type);
116  static QString csmSolveTypeToString(csm::param::Type type);
117  void setCSMSolveSet(csm::param::Set set);
118  void setCSMSolveType(csm::param::Type type);
121  csm::param::Set csmParameterSet() const;
122  csm::param::Type csmParameterType() const;
124 
128  AnglesOnly = 1,
135  };
136 
140  bool solveTwist,
141  int ckDegree = 2,
142  int ckSolveDegree = 2,
143  bool solvePolynomialOverExisting = false,
144  double anglesAprioriSigma = -1.0,
145  double angularVelocityAprioriSigma = -1.0,
146  double angularAccelerationAprioriSigma = -1.0,
147  QList<double> * additionalPointingSigmas=nullptr);
149  bool solveTwist() const;
150  int ckDegree() const;
151  int ckSolveDegree() const;
153  bool solvePolyOverPointing() const;
156 
157 
158 
168  };
169 
173  int spkDegree = 2,
174  int spkSolveDegree = 2,
175  bool positionOverHermite = false,
176  double positionAprioriSigma = -1.0,
177  double velocityAprioriSigma = -1.0,
178  double accelerationAprioriSigma = -1.0,
179  QList<double> * additionalPositionSigmas=nullptr);
181  int spkDegree() const;
182  int spkSolveDegree() const;
184  bool solvePositionOverHermite() const;
187 
188  // TODO: does xml stuff need project???
189  void save(QXmlStreamWriter &stream, const Project *project) const;
190 
191 
192  private:
200  class XmlHandler : public XmlStackedHandler {
201  public:
202  // TODO: does xml stuff need project???
203  XmlHandler(BundleObservationSolveSettings *settings, Project *project);
204  ~XmlHandler();
205 
206  virtual bool startElement(const QString &namespaceURI, const QString &localName,
207  const QString &qName, const QXmlAttributes &atts);
208  virtual bool characters(const QString &ch);
209  virtual bool endElement(const QString &namespaceURI, const QString &localName,
210  const QString &qName);
211 
212  private:
213  Q_DISABLE_COPY(XmlHandler);
214 
215  BundleObservationSolveSettings *m_xmlHandlerObservationSettings;
216  Project *m_xmlHandlerProject; // TODO: does xml stuff need project???
217  QString m_xmlHandlerCharacters;
218  QStringList m_xmlHandlerAprioriSigmas;
219  };
220 
225  QUuid *m_id;
226  QString m_instrumentId;
227  QSet<QString> m_observationNumbers;
228 
229  // CSM related parameters
230  CSMSolveOption m_csmSolveOption;
231  csm::param::Set m_csmSolveSet;
233  csm::param::Type m_csmSolveType;
235  QStringList m_csmSolveList;
238  // pointing related parameters
240  InstrumentPointingSolveOption m_instrumentPointingSolveOption;
241  int m_numberCamAngleCoefSolved;
243  int m_ckDegree;
245  int m_ckSolveDegree;
247  bool m_solveTwist;
248  bool m_solvePointingPolynomialOverExisting;
250  QList<double> m_anglesAprioriSigma;
255  m_pointingInterpolationType;
264  // position related parameters
266  InstrumentPositionSolveOption m_instrumentPositionSolveOption;
267  int m_numberCamPosCoefSolved;
269  int m_spkDegree;
271  int m_spkSolveDegree;
273  bool m_solvePositionOverHermiteSpline;
275  QList<double> m_positionAprioriSigma;
280  m_positionInterpolationType;
290  };
294 };
295 
296 #endif // BundleObservationSolveSettings_h
BundleObservationSolveSettings.h
Isis::BundleObservationSolveSettings::csmSolveSetToString
static QString csmSolveSetToString(csm::param::Set set)
Convert a CSM parameter set enumeration value to a string.
Definition: BundleObservationSolveSettings.cpp:551
Isis::BundleObservationSolveSettings::Type
@ Type
Solve for all CSM parameters of a specific type.
Definition: BundleObservationSolveSettings.h:107
FileName.h
Isis::BundleObservationSolveSettings::instrumentPositionSolveOptionToString
static QString instrumentPositionSolveOptionToString(InstrumentPositionSolveOption option)
Translates an enumerated InstrumentPositionSolveOption to its string representation.
Definition: BundleObservationSolveSettings.cpp:1025
Isis::BundleObservationSolveSettings::PositionVelocityAcceleration
@ PositionVelocityAcceleration
Solve for instrument positions, velocities, and accelerations.
Definition: BundleObservationSolveSettings.h:164
BundleImage.h
Isis::BundleObservationSolveSettings::instrumentPositionSolveOption
InstrumentPositionSolveOption instrumentPositionSolveOption() const
Accesses the instrument position solve option.
Definition: BundleObservationSolveSettings.cpp:1133
Isis::BundleObservationSolveSettings::removeObservationNumber
bool removeObservationNumber(QString observationNumber)
Removes an observation number from this solve settings.
Definition: BundleObservationSolveSettings.cpp:442
Isis::BundleObservationSolveSettings::spkDegree
int spkDegree() const
Accesses the degree of the polynomial fit to the original camera position (spkDegree).
Definition: BundleObservationSolveSettings.cpp:1143
Isis::BundleObservationSolveSettings::NoPositionFactors
@ NoPositionFactors
Solve for none of the position factors.
Definition: BundleObservationSolveSettings.h:161
Isis::PvlKeyword
A single keyword-value pair.
Definition: PvlKeyword.h:82
Isis::BundleObservationSolveSettings::aprioriPointingSigmas
QList< double > aprioriPointingSigmas() const
Accesses the a priori pointing sigmas.
Definition: BundleObservationSolveSettings.cpp:945
QList< double >
Isis::BundleObservationSolveSettings::Set
@ Set
Solve for all CSM parameters belonging to a specific set.
Definition: BundleObservationSolveSettings.h:106
Project.h
Isis::BundleObservationSolveSettings::setCSMSolveSet
void setCSMSolveSet(csm::param::Set set)
Set the set of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:631
Isis::BundleObservationSolveSettings::stringToCSMSolveSet
static csm::param::Set stringToCSMSolveSet(QString set)
Convert a string to its CSM parameter set enumeration value.
Definition: BundleObservationSolveSettings.cpp:526
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
QSet< QString >
Isis::SpiceRotation::Source
Source
The rotation can come from one of 3 places for an Isis cube.
Definition: SpiceRotation.h:245
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::BundleObservationSolveSettings::AllPointingCoefficients
@ AllPointingCoefficients
Solve for all coefficients in the polynomials fit to the pointing angles.
Definition: BundleObservationSolveSettings.h:133
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
SpicePosition.h
Isis::BundleObservationSolveSettings::csmParameterList
QStringList csmParameterList() const
Get the list of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:695
Isis::BundleObservationSolveSettings::stringToCSMSolveOption
static CSMSolveOption stringToCSMSolveOption(QString option)
Convert a string to a CSM solve option enumeration value.
Definition: BundleObservationSolveSettings.cpp:470
Isis::BundleObservationSolveSettings::setCSMSolveParameterList
void setCSMSolveParameterList(QStringList list)
Set an explicit list of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:653
Isis::BundleObservationSolveSettings::csmParameterType
csm::param::Type csmParameterType() const
Get the type of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:685
Isis::PvlContainer::hasKeyword
bool hasKeyword(const QString &name) const
Check to see if a keyword exists.
Definition: PvlContainer.cpp:159
Isis::XmlStackedHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Definition: XmlStackedHandler.cpp:44
Isis::BundleObservationSolveSettings::ckDegree
int ckDegree() const
Accesses the degree of polynomial fit to original camera angles (ckDegree).
Definition: BundleObservationSolveSettings.cpp:903
Isis::BundleObservationSolveSettings::setInstrumentId
void setInstrumentId(QString instrumentId)
Sets the instrument id for this observation.
Definition: BundleObservationSolveSettings.cpp:407
Isis::BundleObservationSolveSettings::AnglesOnly
@ AnglesOnly
Solve for pointing angles: right ascension, declination and, optionally, twist.
Definition: BundleObservationSolveSettings.h:128
Isis::PvlContainer::nameKeyword
PvlKeyword & nameKeyword()
Definition: PvlContainer.h:273
QSharedPointer< BundleObservationSolveSettings >
Isis::BundleObservationSolveSettings::csmParameterSet
csm::param::Set csmParameterSet() const
Get the set of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:675
Isis::BundleObservationSolveSettings::positionInterpolationType
SpicePosition::Source positionInterpolationType() const
Accesses the SpicePosition interpolation type for the spacecraft position.
Definition: BundleObservationSolveSettings.cpp:1195
Isis::BundleObservationSolveSettings::addObservationNumber
void addObservationNumber(QString observationNumber)
Associates an observation number with these solve settings.
Definition: BundleObservationSolveSettings.cpp:429
QStringList
Isis::BundleObservationSolveSettings::AnglesVelocity
@ AnglesVelocity
Solve for pointing angles and their angular velocities.
Definition: BundleObservationSolveSettings.h:130
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::IsSpecial
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:197
IString.h
SpiceRotation.h
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::BundleObservationSolveSettingsQsp
QSharedPointer< BundleObservationSolveSettings > BundleObservationSolveSettingsQsp
Definition for BundleObservationSolveSettingsQsp, a QSharedPointer to a BundleObservationSolveSetting...
Definition: BundleObservationSolveSettings.h:293
Isis::SpicePosition::PolyFunctionOverHermiteConstant
@ PolyFunctionOverHermiteConstant
Object is reading from splined.
Definition: SpicePosition.h:184
Isis::BundleObservationSolveSettings::instrumentPointingSolveOptionToString
static QString instrumentPointingSolveOptionToString(InstrumentPointingSolveOption option)
Tranlsates an enumerated InstrumentPointingSolveOption value to its string representation.
Definition: BundleObservationSolveSettings.cpp:765
Isis::BundleObservationSolveSettings::initialize
void initialize()
Initializes the default state of this BundleObservationSolveSettings.
Definition: BundleObservationSolveSettings.cpp:359
Isis::BundleObservationSolveSettings::observationNumbers
QSet< QString > observationNumbers() const
Returns a list of observation numbers associated with these solve settings.
Definition: BundleObservationSolveSettings.cpp:452
Isis::BundleObservationSolveSettings::instrumentPointingSolveOption
InstrumentPointingSolveOption instrumentPointingSolveOption() const
Accesses the instrument pointing solve option.
Definition: BundleObservationSolveSettings.cpp:883
Isis::SpicePosition::PolyFunction
@ PolyFunction
Object is calculated from nth degree polynomial.
Definition: SpicePosition.h:183
Isis::PvlGroup
Contains multiple PvlContainers.
Definition: PvlGroup.h:41
_FILEINFO_
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:24
Isis::BundleObservationSolveSettings::aprioriPositionSigmas
QList< double > aprioriPositionSigmas() const
Accesses the a priori position sigmas.
Definition: BundleObservationSolveSettings.cpp:1185
Isis::BundleObservationSolveSettings::InstrumentPointingSolveOption
InstrumentPointingSolveOption
Options for how to solve for instrument pointing.
Definition: BundleObservationSolveSettings.h:126
Isis::BundleObservationSolveSettings::PositionOnly
@ PositionOnly
Solve for instrument positions only.
Definition: BundleObservationSolveSettings.h:162
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::BundleObservationSolveSettings::BundleObservationSolveSettings
BundleObservationSolveSettings()
Constructor with default parameter initializations.
Definition: BundleObservationSolveSettings.cpp:37
Isis::BundleObservationSolveSettings::AnglesVelocityAcceleration
@ AnglesVelocityAcceleration
Solve for pointing angles, their velocities and their accelerations.
Definition: BundleObservationSolveSettings.h:131
Isis::BundleObservationSolveSettings::NoPointingFactors
@ NoPointingFactors
Solve for none of the pointing factors.
Definition: BundleObservationSolveSettings.h:127
Isis::BundleObservationSolveSettings::solvePositionOverHermite
bool solvePositionOverHermite() const
Whether or not the polynomial for solving will be fit over an existing Hermite spline.
Definition: BundleObservationSolveSettings.cpp:1175
Isis::SpiceRotation::PolyFunction
@ PolyFunction
From nth degree polynomial.
Definition: SpiceRotation.h:249
Isis::BundleObservationSolveSettings::~BundleObservationSolveSettings
~BundleObservationSolveSettings()
Destructor.
Definition: BundleObservationSolveSettings.cpp:298
Isis::BundleObservationSolveSettings::spkSolveDegree
int spkSolveDegree() const
Accesses the degree of thecamera position polynomial being fit to in the bundle adjustment (spkSolveD...
Definition: BundleObservationSolveSettings.cpp:1154
Isis::SpicePosition::Source
Source
This enum indicates the status of the object.
Definition: SpicePosition.h:180
Isis::XmlStackedHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Definition: XmlStackedHandler.cpp:55
Isis::BundleObservationSolveSettings::numberCameraAngleCoefficientsSolved
int numberCameraAngleCoefficientsSolved() const
Accesses the number of camera angle coefficients in the solution.
Definition: BundleObservationSolveSettings.cpp:924
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::BundleObservationSolveSettings::csmSolveOption
CSMSolveOption csmSolveOption() const
Get how the CSM parameters to solve for are specified for this observation.
Definition: BundleObservationSolveSettings.cpp:665
Isis::BundleObservationSolveSettings::stringToInstrumentPositionSolveOption
static InstrumentPositionSolveOption stringToInstrumentPositionSolveOption(QString option)
Translates a QString InstrumentPositionSolveOption to its enumerated value.
Definition: BundleObservationSolveSettings.cpp:976
Isis::BundleObservationSolveSettings::operator=
BundleObservationSolveSettings & operator=(const BundleObservationSolveSettings &src)
Assigns the state of another BundleObservationSolveSettings to this one.
Definition: BundleObservationSolveSettings.cpp:315
Isis::BundleObservationSolveSettings::setInstrumentPositionSettings
void setInstrumentPositionSettings(InstrumentPositionSolveOption option, int spkDegree=2, int spkSolveDegree=2, bool positionOverHermite=false, double positionAprioriSigma=-1.0, double velocityAprioriSigma=-1.0, double accelerationAprioriSigma=-1.0, QList< double > *additionalPositionSigmas=nullptr)
Sets the instrument pointing settings.
Definition: BundleObservationSolveSettings.cpp:1050
Isis::BundleObservationSolveSettings::BundleObservationSolveSettings
BundleObservationSolveSettings(FileName xmlFile, Project *project, XmlStackedHandlerReader *xmlReader)
Camera.h
Isis::BundleObservationSolveSettings::AllPositionCoefficients
@ AllPositionCoefficients
Solve for all coefficients in the polynomials fit to the instrument positions.
Definition: BundleObservationSolveSettings.h:166
Isis::Null
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:95
Isis::BundleObservationSolveSettings::stringToInstrumentPointingSolveOption
static InstrumentPointingSolveOption stringToInstrumentPointingSolveOption(QString option)
Translates a QString InstrumentPointingSolveOption to its enumerated value.
Definition: BundleObservationSolveSettings.cpp:716
Isis::BundleObservationSolveSettings::save
void save(QXmlStreamWriter &stream, const Project *project) const
Saves this BundleObservationSolveSettings to an xml stream.
Definition: BundleObservationSolveSettings.cpp:1214
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::BundleObservationSolveSettings::csmSolveOptionToString
static QString csmSolveOptionToString(CSMSolveOption option)
Convert a CSM solve option enumeration value to a string.
Definition: BundleObservationSolveSettings.cpp:498
Isis::BundleObservationSolveSettings::stringToCSMSolveType
static csm::param::Type stringToCSMSolveType(QString type)
Convert a string to its CSM parameter type enumeration value.
Definition: BundleObservationSolveSettings.cpp:576
Isis::BundleObservationSolveSettings::PositionVelocity
@ PositionVelocity
Solve for instrument positions and velocities.
Definition: BundleObservationSolveSettings.h:163
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
PvlKeyword.h
Isis::BundleObservationSolveSettings::ckSolveDegree
int ckSolveDegree() const
Accesses the degree of the camera angles polynomial being fit to in the bundle adjustment (ckSolveDeg...
Definition: BundleObservationSolveSettings.cpp:914
Isis::BundleObservationSolveSettings::setCSMSolveType
void setCSMSolveType(csm::param::Type type)
Set the type of CSM parameters to solve for.
Definition: BundleObservationSolveSettings.cpp:642
Isis::PvlKeyword::size
int size() const
Returns the number of values stored in this keyword.
Definition: PvlKeyword.h:125
Isis::XmlStackedHandler
XML Handler that parses XMLs in a stack-oriented way.
Definition: XmlStackedHandler.h:118
Isis::BundleObservationSolveSettings::List
@ List
Solve for an explicit list of CSM parameters.
Definition: BundleObservationSolveSettings.h:108
Isis::BundleObservationSolveSettings::NoCSMParameters
@ NoCSMParameters
Do not solve for CSM parameters.
Definition: BundleObservationSolveSettings.h:105
PvlObject.h
Isis::BundleObservationSolveSettings::csmSolveTypeToString
static QString csmSolveTypeToString(csm::param::Type type)
Convert a CSM parameter type enumeration value to a string.
Definition: BundleObservationSolveSettings.cpp:604
Isis::BundleObservationSolveSettings
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Definition: BundleObservationSolveSettings.h:82
Isis::SpiceRotation::PolyFunctionOverSpice
@ PolyFunctionOverSpice
Kernels plus nth degree polynomial.
Definition: SpiceRotation.h:250
Isis::BundleObservationSolveSettings::pointingInterpolationType
SpiceRotation::Source pointingInterpolationType() const
Accesses the SpiceRotation interpolation type for the instrument pointing.
Definition: BundleObservationSolveSettings.cpp:955
Isis::PvlContainer::findKeyword
PvlKeyword & findKeyword(const QString &name)
Find a keyword with a specified name.
Definition: PvlContainer.cpp:62
Isis::BundleObservationSolveSettings::setInstrumentPointingSettings
void setInstrumentPointingSettings(InstrumentPointingSolveOption option, bool solveTwist, int ckDegree=2, int ckSolveDegree=2, bool solvePolynomialOverExisting=false, double anglesAprioriSigma=-1.0, double angularVelocityAprioriSigma=-1.0, double angularAccelerationAprioriSigma=-1.0, QList< double > *additionalPointingSigmas=nullptr)
Sets the instrument pointing settings.
Definition: BundleObservationSolveSettings.cpp:791
Isis::BundleObservationSolveSettings::solveTwist
bool solveTwist() const
Accesses the flag for solving for twist.
Definition: BundleObservationSolveSettings.cpp:893
Isis::BundleObservationSolveSettings::instrumentId
QString instrumentId() const
Accesses the instrument id for this observation.
Definition: BundleObservationSolveSettings.cpp:417
Isis::BundleObservationSolveSettings::solvePolyOverPointing
bool solvePolyOverPointing() const
Whether or not the solve polynomial will be fit over the existing pointing polynomial.
Definition: BundleObservationSolveSettings.cpp:935
XmlStackedHandlerReader.h
XmlStackedHandler.h
Isis::BundleObservationSolveSettings::InstrumentPositionSolveOption
InstrumentPositionSolveOption
Options for how to solve for instrument position.
Definition: BundleObservationSolveSettings.h:160
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::IException::User
@ User
A type of error that could only have occurred due to a mistake on the user's part (e....
Definition: IException.h:126
Isis::BundleObservationSolveSettings::CSMSolveOption
CSMSolveOption
Options for how to solve for CSM parameters.
Definition: BundleObservationSolveSettings.h:104
Isis::BundleObservationSolveSettings::numberCameraPositionCoefficientsSolved
int numberCameraPositionCoefficientsSolved() const
Accesses the number of camera position coefficients in the solution.
Definition: BundleObservationSolveSettings.cpp:1164