Isis 3 Programmer Reference
BundleObservationSolveSettings.cpp
2 
3 #include <QDataStream>
4 #include <QDebug>
5 #include <QFile>
6 #include <QList>
7 #include <QSet>
8 #include <QString>
9 #include <QUuid>
10 #include <QXmlInputSource>
11 #include <QXmlStreamWriter>
12 
13 #include "BundleImage.h"
14 #include "Camera.h"
15 #include "FileName.h"
16 #include "IException.h"
17 #include "IString.h"
18 #include "Project.h"
19 #include "PvlKeyword.h"
20 #include "PvlObject.h"
21 #include "XmlStackedHandlerReader.h"
22 
23 
24 namespace Isis {
25 
30  initialize();
31  }
32 
33 
42  Project *project,
43  XmlStackedHandlerReader *xmlReader) {
44  initialize();
45  xmlReader->pushContentHandler(new XmlHandler(this, project));
46  xmlReader->setErrorHandler(new XmlHandler(this, project));
47  }
48 
49 
50 #if 0
51 
58  FileName xmlFile,
59  Project *project,
60  XmlStackedHandlerReader *xmlReader) {
61 
62  initialize();
63  QString xmlPath = xmlFile.expanded();
64  QFile qXmlFile(xmlPath);
65  if (!qXmlFile.open(QFile::ReadOnly) ) {
67  QString("Unable to open xml file, [%1], with read access").arg(xmlPath),
68  _FILEINFO_);
69  }
70 
71  QXmlInputSource xmlInputSource(&qXmlFile);
72  xmlReader->pushContentHandler(new XmlHandler(this, project));
73  xmlReader->setErrorHandler(new XmlHandler(this, project));
74  bool success = xmlReader->parse(xmlInputSource);
75  if (!success) {
76  throw IException(IException::Unknown,
77  QString("Failed to parse xml file, [%1]").arg(xmlPath),
78  _FILEINFO_);
79  }
80  }
81 #endif
82 
83 
84 // BundleObservationSolveSettings::BundleObservationSolveSettings(const BundleObservationSolveSettings &other)
85 // : m_id(new QUuid(other.m_id->toString())),
86 // m_instrumentId(other.m_instrumentId),
87 // m_instrumentPointingSolveOption(other.m_instrumentPointingSolveOption),
88 // m_numberCamAngleCoefSolved(other.m_numberCamAngleCoefSolved),
89 // m_ckDegree(other.m_ckDegree),
90 // m_ckSolveDegree(other.m_ckSolveDegree),
91 // m_solveTwist(other.m_solveTwist),
92 // m_solvePointingPolynomialOverExisting(other.m_solvePointingPolynomialOverExisting),
93 // m_anglesAprioriSigma(other.m_anglesAprioriSigma),
94 // m_pointingInterpolationType(other.m_pointingInterpolationType),
95 // m_instrumentPositionSolveOption(other.m_instrumentPositionSolveOption),
96 // m_numberCamPosCoefSolved(other.m_numberCamPosCoefSolved),
97 // m_spkDegree(other.m_spkDegree),
98 // m_spkSolveDegree(other.m_spkSolveDegree),
99 // m_solvePositionOverHermiteSpline(other.m_solvePositionOverHermiteSpline),
100 // m_positionAprioriSigma(other.m_positionAprioriSigma),
101 // m_positionInterpolationType(other.m_positionInterpolationType) {
102 // }
109 
110  m_id = NULL;
111  m_id = new QUuid(other.m_id->toString());
112  // TODO: add check to all copy constructors (verify other.xxx is not null) and operator= ???
113  // or intit all variables in all constructors
114 
119  m_ckDegree = other.m_ckDegree;
121  m_solveTwist = other.m_solveTwist;
127  m_spkDegree = other.m_spkDegree;
132  }
133 
134 
139 
140  delete m_id;
141  m_id = NULL;
142 
143  }
144 
145 
156  if (&other != this) {
157  delete m_id;
158  m_id = NULL;
159  m_id = new QUuid(other.m_id->toString());
160 
163 
164  // pointing related
167  m_ckDegree = other.m_ckDegree;
169  m_solveTwist = other.m_solveTwist;
173 
174  // position related
177  m_spkDegree = other.m_spkDegree;
182 
183  }
184 
185  return *this;
186 
187  }
188 
189 
194  m_id = NULL;
195  m_id = new QUuid(QUuid::createUuid());
196 
197  m_instrumentId = "";
198 
199  // Camera Pointing Options
200  // Defaults:
201  // m_instrumentPointingSolveOption = AnglesOnly;
202  // m_numberCamAngleCoefSolved = 1; // AnglesOnly;
203  // m_ckDegree = 2;
204  // m_ckSolveDegree = 2;
205  // m_solveTwist = true;
206  // m_solvePointingPolynomialOverExisting = false;
207  // m_pointingInterpolationType = SpiceRotation::PolyFunction;
208  // m_anglesAprioriSigma.append(Isis::Null); // num cam angle
209  // coef = 1
210  setInstrumentPointingSettings(AnglesOnly, true, 2, 2, false);
211 
212  // Spacecraft Position Options
213  // Defaults:
214  // m_instrumentPositionSolveOption = NoPositionFactors;
215  // m_numberCamPosCoefSolved = 0; // NoPositionFactors;
216  // m_spkDegree = 2;
217  // m_spkSolveDegree = 2;
218  // m_solvePositionOverHermiteSpline = false;
219  // m_positionInterpolationType = SpicePosition::PolyFunction;
220  // m_positionAprioriSigma.clear();
222 
223  }
224 
225 
226  // =============================================================================================//
227  // =============================================================================================//
228  // =============================================================================================//
229 
237  }
238 
239 
246  return m_instrumentId;
247  }
248 
249 
258  m_observationNumbers.insert(observationNumber);
259  }
260 
261 
271  return m_observationNumbers.remove(observationNumber);
272  }
273 
274 
281  return m_observationNumbers;
282  }
283 
284 
285  // =============================================================================================//
286  // ======================== Camera Pointing Options ============================================//
287  // =============================================================================================//
288 
289 
302  if (option.compare("NONE", Qt::CaseInsensitive) == 0) {
304  }
305  else if (option.compare("NoPointingFactors", Qt::CaseInsensitive) == 0) {
307  }
308  else if (option.compare("ANGLES", Qt::CaseInsensitive) == 0) {
310  }
311  else if (option.compare("AnglesOnly", Qt::CaseInsensitive) == 0) {
313  }
314  else if (option.compare("VELOCITIES", Qt::CaseInsensitive) == 0) {
316  }
317  else if (option.compare("AnglesAndVelocity", Qt::CaseInsensitive) == 0) {
319  }
320  else if (option.compare("ACCELERATIONS", Qt::CaseInsensitive) == 0) {
322  }
323  else if (option.compare("AnglesVelocityAndAcceleration", Qt::CaseInsensitive) == 0) {
325  }
326  else if (option.compare("ALL", Qt::CaseInsensitive) == 0) {
328  }
329  else if (option.compare("AllPolynomialCoefficients", Qt::CaseInsensitive) == 0) {
331  }
332  else {
334  "Unknown bundle instrument pointing solve option " + option + ".",
335  _FILEINFO_);
336  }
337  }
338 
339 
352  if (option == NoPointingFactors) return "None";
353  else if (option == AnglesOnly) return "AnglesOnly";
354  else if (option == AnglesVelocity) return "AnglesAndVelocity";
355  else if (option == AnglesVelocityAcceleration) return "AnglesVelocityAndAcceleration";
356  else if (option == AllPointingCoefficients) return "AllPolynomialCoefficients";
358  "Unknown pointing solve option enum [" + toString(option) + "].",
359  _FILEINFO_);
360  }
361 
362 
378  bool solveTwist,
379  int ckDegree,
380  int ckSolveDegree,
381  bool solvePolynomialOverExisting,
382  double anglesAprioriSigma,
383  double angularVelocityAprioriSigma,
384  double angularAccelerationAprioriSigma,QList<double> * additionalPointingSigmas) {
385 
386  // automatically set the solve option and ck degree to the user entered values
388 
389  // the ck solve degree entered is only used if we are solving for all coefficients
390  // otherwise it defaults to 2.
391  if (option == AllPointingCoefficients) {
392  // update spkDegree and spkSolveDegree
395 
396  // we are solving for (solve degree + 1) coefficients
397  // this is the maximum number of apriori sigmas allowed
399  }
400  else {
401  // let spkDegree and spkSolveDegree default to 2, 2
402  m_ckDegree = 2;
403  m_ckSolveDegree = 2;
404 
405  // solve for the appropriate number of coefficients, based on solve option enum
406  m_numberCamAngleCoefSolved = ((int) option);
407  }
408 
409  m_anglesAprioriSigma.clear();
410  if (m_numberCamAngleCoefSolved > 0) {
411  if (anglesAprioriSigma > 0.0) {
412  m_anglesAprioriSigma.append(anglesAprioriSigma);
413  }
414  else {
416  }
417 
418  if (m_numberCamAngleCoefSolved > 1) {
419  if (angularVelocityAprioriSigma > 0.0) {
420  m_anglesAprioriSigma.append(angularVelocityAprioriSigma);
421  }
422  else {
424  }
425 
426  if (m_numberCamAngleCoefSolved > 2) {
427  if (angularAccelerationAprioriSigma > 0.0) {
428  m_anglesAprioriSigma.append(angularAccelerationAprioriSigma);
429  }
430  else {
432  }
433  }
434  }
435  }
436 
437  if (additionalPointingSigmas) {
438  for (int i=0;i < additionalPointingSigmas->count();i++) {
439  m_anglesAprioriSigma.append(additionalPointingSigmas->value(i));
440  }
441  }
442 
443 
444 
445 
446 
447  m_solveTwist = solveTwist; // dependent on solve option???
448 
449  // Set the SpiceRotation interpolation type enum appropriately
450  m_solvePointingPolynomialOverExisting = solvePolynomialOverExisting;
453  }
454  else {
456  }
457 
458  }
459 
460 
470  }
471 
472 
479  return m_solveTwist;
480  }
481 
482 
489  return m_ckDegree;
490  }
491 
492 
500  return m_ckSolveDegree;
501  }
502 
503 
511  }
512 
513 
522  }
523 
524 
531  return m_anglesAprioriSigma;
532  }
533 
534 
542  }
543 
544 
545  // =============================================================================================//
546  // ======================== Spacecraft Position Options ========================================//
547  // =============================================================================================//
548 
549 
562  if (option.compare("NONE", Qt::CaseInsensitive) == 0) {
564  }
565  else if (option.compare("NoPositionFactors", Qt::CaseInsensitive) == 0) {
567  }
568  else if (option.compare("POSITIONS", Qt::CaseInsensitive) == 0) {
570  }
571  else if (option.compare("PositionOnly", Qt::CaseInsensitive) == 0) {
573  }
574  else if (option.compare("VELOCITIES", Qt::CaseInsensitive) == 0) {
576  }
577  else if (option.compare("PositionAndVelocity", Qt::CaseInsensitive) == 0) {
579  }
580  else if (option.compare("ACCELERATIONS", Qt::CaseInsensitive) == 0) {
582  }
583  else if (option.compare("PositionVelocityAndAcceleration", Qt::CaseInsensitive) == 0) {
585  }
586  else if (option.compare("ALL", Qt::CaseInsensitive) == 0) {
588  }
589  else if (option.compare("AllPolynomialCoefficients", Qt::CaseInsensitive) == 0) {
591  }
592  else {
594  "Unknown bundle instrument position solve option " + option + ".",
595  _FILEINFO_);
596  }
597  }
598 
599 
612  if (option == NoPositionFactors) return "None";
613  else if (option == PositionOnly) return "PositionOnly";
614  else if (option == PositionVelocity) return "PositionAndVelocity";
615  else if (option == PositionVelocityAcceleration) return "PositionVelocityAndAcceleration";
616  else if (option == AllPositionCoefficients) return "AllPolynomialCoefficients";
618  "Unknown position solve option enum [" + toString(option) + "].",
619  _FILEINFO_);
620  }
621 
622 
636  int spkDegree,
637  int spkSolveDegree,
638  bool positionOverHermite,
639  double positionAprioriSigma,
640  double velocityAprioriSigma,
641  double accelerationAprioriSigma,
642  QList<double> *additionalPositionSigmas) {
643  // automatically set the solve option and spk degree to the user entered values
645 
646  // the spk solve degree entered is only used if we are solving for all coefficients
647  // otherwise it defaults to 2.
648  if (option == AllPositionCoefficients) {
649  // update spkDegree and spkSolveDegree
652  // we are solving for (solve degree + 1) coefficients
653  // this is the maximum number of apriori sigmas allowed
655  }
656  else {
657  // let spkDegree and spkSolveDegree default to 2, 2
658  m_spkDegree = 2;
659  m_spkSolveDegree = 2;
660 
661  // solve for the appropriate number of coefficients, based on solve option enum
662  m_numberCamPosCoefSolved = ((int) option);
663  }
664 
665  m_positionAprioriSigma.clear();
666  if (m_numberCamPosCoefSolved > 0) {
667  if (positionAprioriSigma > 0.0) {
668  m_positionAprioriSigma.append(positionAprioriSigma);
669  }
670  else {
672  }
673 
674  if (m_numberCamPosCoefSolved > 1) {
675  if (velocityAprioriSigma > 0.0) {
676  m_positionAprioriSigma.append(velocityAprioriSigma);
677  }
678  else {
680  }
681 
682  if (m_numberCamPosCoefSolved > 2) {
683  if (accelerationAprioriSigma > 0.0) {
684  m_positionAprioriSigma.append(accelerationAprioriSigma);
685  }
686  else {
688  }
689  }
690  }
691  }
692 
693  if (additionalPositionSigmas) {
694  for (int i=0;i < additionalPositionSigmas->count();i++) {
695  m_positionAprioriSigma.append(additionalPositionSigmas->value(i));
696  }
697  }
698 
699  // Set the SpicePosition interpolation type enum appropriately
700  m_solvePositionOverHermiteSpline = positionOverHermite;
703  }
704  else {
706  }
707 
708  }
709 
710 
720  }
721 
722 
729  return m_spkDegree;
730  }
731 
732 
740  return m_spkSolveDegree;
741  }
742 
743 
751  }
752 
753 
762  }
763 
764 
771  return m_positionAprioriSigma;
772  }
773 
774 
782  }
783 
784 
785  // =============================================================================================//
786  // =============================================================================================//
787  // =============================================================================================//
788 
789 
799  void BundleObservationSolveSettings::save(QXmlStreamWriter &stream,
800  const Project *project) const {
801 
802  stream.writeStartElement("bundleObservationSolveSettings");
803  stream.writeTextElement("id", m_id->toString());
804  stream.writeTextElement("instrumentId", instrumentId());
805 
806  // pointing related
807  stream.writeStartElement("instrumentPointingOptions");
808  stream.writeAttribute("solveOption",
810  stream.writeAttribute("numberCoefSolved", toString(m_numberCamAngleCoefSolved));
811  stream.writeAttribute("degree", toString(m_ckDegree));
812  stream.writeAttribute("solveDegree", toString(m_ckSolveDegree));
813  stream.writeAttribute("solveTwist", toString(m_solveTwist));
814  stream.writeAttribute("solveOverExisting", toString(m_solvePointingPolynomialOverExisting));
815  stream.writeAttribute("interpolationType", toString(m_pointingInterpolationType));
816 
817  stream.writeStartElement("aprioriPointingSigmas");
818  for (int i = 0; i < m_anglesAprioriSigma.size(); i++) {
820  stream.writeTextElement("sigma", "N/A");
821  }
822  else {
823  stream.writeTextElement("sigma", toString(m_anglesAprioriSigma[i]));
824  }
825  }
826  stream.writeEndElement();// end aprioriPointingSigmas
827  stream.writeEndElement();// end instrumentPointingOptions
828 
829  // position related
830  stream.writeStartElement("instrumentPositionOptions");
831  stream.writeAttribute("solveOption",
833  stream.writeAttribute("numberCoefSolved", toString(m_numberCamPosCoefSolved));
834  stream.writeAttribute("degree", toString(m_spkDegree));
835  stream.writeAttribute("solveDegree", toString(m_spkSolveDegree));
836  stream.writeAttribute("solveOverHermiteSpline", toString(m_solvePositionOverHermiteSpline));
837  stream.writeAttribute("interpolationType", toString(m_positionInterpolationType));
838 
839  stream.writeStartElement("aprioriPositionSigmas");
840  for (int i = 0; i < m_positionAprioriSigma.size(); i++) {
842  stream.writeTextElement("sigma", "N/A");
843  }
844  else {
845  stream.writeTextElement("sigma", toString(m_positionAprioriSigma[i]));
846  }
847  }
848  stream.writeEndElement();// end aprioriPositionSigmas
849  stream.writeEndElement(); // end instrumentPositionOptions
850 
851  stream.writeEndElement(); // end bundleObservationSolveSettings
852 
853  }
854 
855 
866  Project *project) {
867  m_xmlHandlerObservationSettings = settings;
868  m_xmlHandlerProject = project; // TODO: does xml stuff need project???
869  m_xmlHandlerCharacters = "";
870  }
871 
872 
877  // do not delete this pointer... we don't own it, do we???
878  // passed into StatCumProbDistDynCalc constructor as pointer
879  // delete m_xmlHandlerProject; // TODO: does xml stuff need project???
880  m_xmlHandlerProject = NULL;
881  }
882 
883 
896  const QString &localName,
897  const QString &qName,
898  const QXmlAttributes &atts) {
899  m_xmlHandlerCharacters = "";
900  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
901  if (localName == "instrumentPointingOptions") {
902 
903  QString pointingSolveOption = atts.value("solveOption");
904  if (!pointingSolveOption.isEmpty()) {
905  m_xmlHandlerObservationSettings->m_instrumentPointingSolveOption
906  = stringToInstrumentPointingSolveOption(pointingSolveOption);
907  }
908 
909  QString numberCoefSolved = atts.value("numberCoefSolved");
910  if (!numberCoefSolved.isEmpty()) {
911  m_xmlHandlerObservationSettings->m_numberCamAngleCoefSolved = toInt(numberCoefSolved);
912  }
913 
914  QString ckDegree = atts.value("degree");
915  if (!ckDegree.isEmpty()) {
916  m_xmlHandlerObservationSettings->m_ckDegree = toInt(ckDegree);
917  }
918 
919  QString ckSolveDegree = atts.value("solveDegree");
920  if (!ckSolveDegree.isEmpty()) {
921  m_xmlHandlerObservationSettings->m_ckSolveDegree = toInt(ckSolveDegree);
922  }
923 
924  QString solveTwist = atts.value("solveTwist");
925  if (!solveTwist.isEmpty()) {
926  m_xmlHandlerObservationSettings->m_solveTwist = toBool(solveTwist);
927  }
928 
929  QString solveOverExisting = atts.value("solveOverExisting");
930  if (!solveOverExisting.isEmpty()) {
931  m_xmlHandlerObservationSettings->m_solvePointingPolynomialOverExisting =
932  toBool(solveOverExisting);
933  }
934 
935  QString interpolationType = atts.value("interpolationType");
936  if (!interpolationType.isEmpty()) {
937  m_xmlHandlerObservationSettings->m_pointingInterpolationType =
938  SpiceRotation::Source(toInt(interpolationType));
939  }
940 
941  }
942  else if (localName == "aprioriPointingSigmas") {
943  m_xmlHandlerAprioriSigmas.clear();
944  }
945  else if (localName == "instrumentPositionOptions") {
946 
947  QString positionSolveOption = atts.value("solveOption");
948  if (!positionSolveOption.isEmpty()) {
949  m_xmlHandlerObservationSettings->m_instrumentPositionSolveOption
950  = stringToInstrumentPositionSolveOption(positionSolveOption);
951  }
952 
953  QString numberCoefSolved = atts.value("numberCoefSolved");
954  if (!numberCoefSolved.isEmpty()) {
955  m_xmlHandlerObservationSettings->m_numberCamPosCoefSolved = toInt(numberCoefSolved);
956  }
957 
958  QString spkDegree = atts.value("degree");
959  if (!spkDegree.isEmpty()) {
960  m_xmlHandlerObservationSettings->m_spkDegree = toInt(spkDegree);
961  }
962 
963  QString spkSolveDegree = atts.value("solveDegree");
964  if (!spkSolveDegree.isEmpty()) {
965  m_xmlHandlerObservationSettings->m_spkSolveDegree = toInt(spkSolveDegree);
966  }
967 
968  QString solveOverHermiteSpline = atts.value("solveOverHermiteSpline");
969  if (!solveOverHermiteSpline.isEmpty()) {
970  m_xmlHandlerObservationSettings->m_solvePositionOverHermiteSpline =
971  toBool(solveOverHermiteSpline);
972  }
973 
974  QString interpolationType = atts.value("interpolationType");
975  if (!interpolationType.isEmpty()) {
976  m_xmlHandlerObservationSettings->m_positionInterpolationType =
977  SpicePosition::Source(toInt(interpolationType));
978  }
979  }
980  else if (localName == "aprioriPositionSigmas") {
981  m_xmlHandlerAprioriSigmas.clear();
982  }
983  }
984  return true;
985  }
986 
987 
997  m_xmlHandlerCharacters += ch;
998  return XmlStackedHandler::characters(ch);
999  }
1000 
1001 
1013  const QString &localName,
1014  const QString &qName) {
1015  if (!m_xmlHandlerCharacters.isEmpty()) {
1016  if (localName == "id") {
1017  m_xmlHandlerObservationSettings->m_id = NULL;
1018  m_xmlHandlerObservationSettings->m_id = new QUuid(m_xmlHandlerCharacters);
1019  }
1020  else if (localName == "instrumentId") {
1021  m_xmlHandlerObservationSettings->setInstrumentId(m_xmlHandlerCharacters);
1022  }
1023 // else if (localName == "bundleObservationSolveSettings") {
1024 // // end tag for this entire class... how to get out???
1025 // // call parse, as in Control List???
1026 // }
1027  else if (localName == "sigma") {
1028  m_xmlHandlerAprioriSigmas.append(m_xmlHandlerCharacters);
1029  }
1030  else if (localName == "aprioriPointingSigmas") {
1031  m_xmlHandlerObservationSettings->m_anglesAprioriSigma.clear();
1032  for (int i = 0; i < m_xmlHandlerAprioriSigmas.size(); i++) {
1033  if (m_xmlHandlerAprioriSigmas[i] == "N/A") {
1034  m_xmlHandlerObservationSettings->m_anglesAprioriSigma.append(Isis::Null);
1035  }
1036  else {
1037  m_xmlHandlerObservationSettings->m_anglesAprioriSigma.append(
1038  toDouble(m_xmlHandlerAprioriSigmas[i]));
1039  }
1040  }
1041  }
1042  else if (localName == "aprioriPositionSigmas") {
1043  m_xmlHandlerObservationSettings->m_positionAprioriSigma.clear();
1044  for (int i = 0; i < m_xmlHandlerAprioriSigmas.size(); i++) {
1045  if (m_xmlHandlerAprioriSigmas[i] == "N/A") {
1046  m_xmlHandlerObservationSettings->m_positionAprioriSigma.append(Isis::Null);
1047  }
1048  else {
1049  m_xmlHandlerObservationSettings->m_positionAprioriSigma.append(
1050  toDouble(m_xmlHandlerAprioriSigmas[i]));
1051  }
1052  }
1053  }
1054  m_xmlHandlerCharacters = "";
1055  }
1056  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
1057  }
1058 }
static InstrumentPointingSolveOption stringToInstrumentPointingSolveOption(QString option)
Translates a QString InstrumentPointingSolveOption to its enumerated value.
const double Null
Value for an Isis Null pixel.
Definition: SpecialPixel.h:110
The main project for ipce.
Definition: Project.h:289
int m_ckSolveDegree
Degree of the camera angles polynomial being fit to in the bundle adjustment.
File name manipulation and expansion.
Definition: FileName.h:116
Object is calculated from nth degree polynomial.
QSet< QString > observationNumbers() const
Returns a list of observation numbers associated with these solve settings.
int numberCameraPositionCoefficientsSolved() const
Accesses the number of camera position coefficients in the solution.
InstrumentPositionSolveOption instrumentPositionSolveOption() const
Accesses the instrument position solve option.
bool removeObservationNumber(QString observationNumber)
Removes an observation number from this solve settings.
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:108
bool m_solvePositionOverHermiteSpline
The polynomial will be fit over an existing Hermite spline.
XmlHandler(BundleObservationSolveSettings *settings, Project *project)
Constructs an XmlHandler for serialization.
bool solvePositionOverHermite() const
Whether or not the polynomial for solving will be fit over an existing Hermite spline.
SpicePosition::Source positionInterpolationType() const
Accesses the SpicePosition interpolation type for the spacecraft position.
void initialize()
Initializes the default state of this BundleObservationSolveSettings.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
Solve for pointing angles, their velocities and their accelerations.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:164
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:171
QString m_instrumentId
The spacecraft instrument id for this observation.
int m_spkSolveDegree
Degree of the camera position polynomial being fit to in the bundle adjustment.
int m_numberCamAngleCoefSolved
The number of camera angle coefficients in solution.
BundleObservationSolveSettings()
Constructor with default parameter initializations.
int ckDegree() const
Accesses the degree of polynomial fit to original camera angles (ckDegree).
InstrumentPointingSolveOption instrumentPointingSolveOption() const
Accesses the instrument pointing solve option.
QList< double > m_positionAprioriSigma
The instrument pointing a priori sigmas.
Solve for all coefficients in the polynomials fit to the instrument positions.
SpicePosition::Source m_positionInterpolationType
SpicePosition interpolation types.
int ckSolveDegree() const
Accesses the degree of the camera angles polynomial being fit to in the bundle adjustment (ckSolveDeg...
int spkSolveDegree() const
Accesses the degree of thecamera position polynomial being fit to in the bundle adjustment (spkSolveD...
void addObservationNumber(QString observationNumber)
Associates an observation number with these solve settings.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
bool m_solvePointingPolynomialOverExisting
The polynomial will be fit over the existing pointing polynomial.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
void save(QXmlStreamWriter &stream, const Project *project) const
Saves this BundleObservationSolveSettings to an xml stream.
static QString instrumentPointingSolveOptionToString(InstrumentPointingSolveOption option)
Tranlsates an enumerated InstrumentPointingSolveOption value to its string representation.
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:134
bool solvePolyOverPointing() const
Whether or not the solve polynomial will be fit over the existing pointing polynomial.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
Definition: FileName.cpp:212
Kernels plus nth degree polynomial.
bool IsSpecial(const double d)
Returns if the input pixel is special.
Definition: SpecialPixel.h:212
Source
The rotation can come from one of 3 places for an Isis cube.
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.
void setInstrumentId(QString instrumentId)
Sets the instrument id for this observation.
InstrumentPositionSolveOption m_instrumentPositionSolveOption
Option for how to solve for instrument position.
QList< double > aprioriPositionSigmas() const
Accesses the a priori position sigmas.
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Solve for instrument positions, velocities, and accelerations.
QList< double > m_anglesAprioriSigma
The image position a priori sigmas.The size of the list is equal to the number of coefficients in the...
Solve for pointing angles and their angular velocities.
int m_spkDegree
Degree of the polynomial fit to the original camera position.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
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.
InstrumentPointingSolveOption m_instrumentPointingSolveOption
Option for how to solve for instrument pointing.
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:53
int m_numberCamPosCoefSolved
The number of camera position coefficients in the solution.
int numberCameraAngleCoefficientsSolved() const
Accesses the number of camera angle coefficients in the solution.
Isis exception class.
Definition: IException.h:107
InstrumentPositionSolveOption
Options for how to solve for instrument position.
static InstrumentPositionSolveOption stringToInstrumentPositionSolveOption(QString option)
Translates a QString InstrumentPositionSolveOption to its enumerated value.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
From nth degree polynomial.
Solve for all coefficients in the polynomials fit to the pointing angles.
InstrumentPointingSolveOption
Options for how to solve for instrument pointing.
QString instrumentId() const
Accesses the instrument id for this observation.
SpiceRotation::Source m_pointingInterpolationType
SpiceRotation interpolation type.
QSet< QString > m_observationNumbers
Associated observation numbers for these settings.
static QString instrumentPositionSolveOptionToString(InstrumentPositionSolveOption option)
Translates an enumerated InstrumentPositionSolveOption to its string representation.
int m_ckDegree
Degree of the polynomial fit to the original camera angles.
SpiceRotation::Source pointingInterpolationType() const
Accesses the SpiceRotation interpolation type for the instrument pointing.
Manage a stack of content handlers for reading XML files.
int spkDegree() const
Accesses the degree of the polynomial fit to the original camera position (spkDegree).
Solve for pointing angles: right ascension, declination and, optionally, twist.
bool solveTwist() const
Accesses the flag for solving for twist.
QUuid * m_id
A unique ID for this object (useful for others to reference this object when saving to disk)...
QList< double > aprioriPointingSigmas() const
Accesses the a priori pointing sigmas.
Source
This enum indicates the status of the object.
BundleObservationSolveSettings & operator=(const BundleObservationSolveSettings &src)
Assigns the state of another BundleObservationSolveSettings to this one.