Isis 3 Programmer Reference
BundleSettings.cpp
1
7/* SPDX-License-Identifier: CC0-1.0 */
8
9#include "BundleSettings.h"
10
11#include <QDataStream>
12#include <QDebug>
13#include <QList>
14#include <QString>
15#include <QtGlobal> // qMax()
16#include <QUuid>
17#include <QXmlStreamWriter>
18#include <QXmlInputSource>
19
20#include "BundleObservationSolveSettings.h"
21#include "IException.h"
22#include "IString.h"
23#include "Project.h" // currently used for xml handler
24#include "PvlKeyword.h"
25#include "PvlObject.h"
26#include "SpecialPixel.h"
27
28namespace Isis {
29
39 init();
40 BundleObservationSolveSettings defaultSolveSettings;
41 m_observationSolveSettings.append(defaultSolveSettings);
42 }
43
50 m_validateNetwork = true;
51
53 m_solveRadius = false;
54 m_updateCubeLabel = false;
55 m_errorPropagation = false;
57 m_cubeList = "";
58 m_outlierRejection = false;
60
61 // Parameter Uncertainties (Weighting)
62 // The units are meters for either coordinate type
66
67 // Convergence Criteria
71
72 // Maximum Likelihood Estimation Options no default in the constructor - must be set.
73 m_maximumLikelihood.clear();
74
75 // Self Calibration ??? (from ipce only)
76
77 // Target Body
78 m_solveTargetBody = false;
79// m_solveTargetBodyPolePosition = false;
80// m_solveTargetBodyZeroMeridian = false;
81// m_solveTargetBodyRotationRate = false;
82// m_solveTargetBodyRadiusMethod = None;
83
84 // Control Points
87
88 // Output Options
90 }
91
92
100 : m_validateNetwork(other.m_validateNetwork),
101 m_cubeList(other.m_cubeList),
102 m_solveObservationMode(other.m_solveObservationMode),
103 m_solveRadius(other.m_solveRadius),
104 m_updateCubeLabel(other.m_updateCubeLabel),
105 m_errorPropagation(other.m_errorPropagation),
106 m_createInverseMatrix(other.m_createInverseMatrix),
107 m_outlierRejection(other.m_outlierRejection),
108 m_outlierRejectionMultiplier(other.m_outlierRejectionMultiplier),
109 m_globalPointCoord1AprioriSigma(other.m_globalPointCoord1AprioriSigma),
110 m_globalPointCoord2AprioriSigma(other.m_globalPointCoord2AprioriSigma),
111 m_globalPointCoord3AprioriSigma(other.m_globalPointCoord3AprioriSigma),
112 m_observationSolveSettings(other.m_observationSolveSettings),
113 m_convergenceCriteria(other.m_convergenceCriteria),
114 m_convergenceCriteriaThreshold(other.m_convergenceCriteriaThreshold),
115 m_convergenceCriteriaMaximumIterations(other.m_convergenceCriteriaMaximumIterations),
116 m_maximumLikelihood(other.m_maximumLikelihood),
117 m_solveTargetBody(other.m_solveTargetBody),
118 m_bundleTargetBody(other.m_bundleTargetBody),
119 m_cpCoordTypeReports(other.m_cpCoordTypeReports),
120 m_cpCoordTypeBundle(other.m_cpCoordTypeBundle),
121 m_outputFilePrefix(other.m_outputFilePrefix){
122 }
123
124
130
131
145 if (&other != this) {
146 m_validateNetwork = other.m_validateNetwork;
147 m_cubeList = other.m_cubeList;
148 m_solveObservationMode = other.m_solveObservationMode;
149 m_solveRadius = other.m_solveRadius;
150 m_updateCubeLabel = other.m_updateCubeLabel;
151 m_errorPropagation = other.m_errorPropagation;
152 m_createInverseMatrix = other.m_createInverseMatrix;
153 m_outlierRejection = other.m_outlierRejection;
154 m_outlierRejectionMultiplier = other.m_outlierRejectionMultiplier;
155 m_globalPointCoord1AprioriSigma = other.m_globalPointCoord1AprioriSigma;
156 m_globalPointCoord2AprioriSigma = other.m_globalPointCoord2AprioriSigma;
157 m_globalPointCoord3AprioriSigma = other.m_globalPointCoord3AprioriSigma;
158 m_observationSolveSettings = other.m_observationSolveSettings;
159 m_convergenceCriteria = other.m_convergenceCriteria;
160 m_convergenceCriteriaThreshold = other.m_convergenceCriteriaThreshold;
161 m_convergenceCriteriaMaximumIterations = other.m_convergenceCriteriaMaximumIterations;
162 m_solveTargetBody = other.m_solveTargetBody;
163 m_bundleTargetBody = other.m_bundleTargetBody;
164 m_cpCoordTypeReports = other.m_cpCoordTypeReports;
165 m_cpCoordTypeBundle = other.m_cpCoordTypeBundle;
166 m_maximumLikelihood = other.m_maximumLikelihood;
167 m_outputFilePrefix = other.m_outputFilePrefix;
168 }
169 return *this;
170 }
171
172
186
187
199 return m_validateNetwork;
200 }
201
202
209 void BundleSettings::setCubeList(QString cubeList) {
210 m_cubeList = cubeList;
211 }
212
213
219 QString BundleSettings::cubeList() const {
220 return m_cubeList;
221 }
222
223
224 // =============================================================================================//
225 // ======================== Solve Options ======================================================//
226 // =============================================================================================//
227
244 void BundleSettings::setSolveOptions(bool solveObservationMode,
245 bool updateCubeLabel,
246 bool errorPropagation,
247 bool solveRadius,
248 SurfacePoint::CoordinateType coordTypeBundle,
249 SurfacePoint::CoordinateType coordTypeReports,
250 double globalPointCoord1AprioriSigma,
251 double globalPointCoord2AprioriSigma,
252 double globalPointCoord3AprioriSigma) {
257 m_cpCoordTypeReports = coordTypeReports;
258 m_cpCoordTypeBundle = coordTypeBundle;
259 // m_cpCoordTypeBundle = SurfacePoint::Latitudinal;
260
261 if (globalPointCoord1AprioriSigma > 0.0) { // otherwise, we leave as default Isis::Null
263 }
264 else {
266 }
267
270 }
271 else {
273 }
274
275 // This is ugly. *** TODO *** Revisit this section to try to find a cleaner solution.
276 // I think we will have to do similar checking other places.
277 // See pvlObject, save, (DAC 03-29-2017)
278 if (coordTypeBundle == SurfacePoint::Latitudinal) {
281 }
282 else {
284 }
285 }
286 else if (coordTypeBundle == SurfacePoint::Rectangular) {
289 }
290 else {
292 }
293 }
294 }
295
296
304 void BundleSettings::setOutlierRejection(bool outlierRejection, double multiplier) {
306 if (m_outlierRejection) {
307 m_outlierRejectionMultiplier = multiplier;
308 }
309 else {
311 }
312 }
313
314
323 QList<BundleObservationSolveSettings> obsSolveSettingsList) {
324 m_observationSolveSettings = obsSolveSettingsList;
325 }
326
327
339
340
353
354
369
370
379 return m_outlierRejection;
380 }
381
382
392
393
401 return m_solveRadius;
402 }
403
404
413 return m_updateCubeLabel;
414 }
415
416
424 return m_errorPropagation;
425 }
426
427
441 void BundleSettings::setCreateInverseMatrix(bool createMatrixFile) {
442 m_createInverseMatrix = createMatrixFile;
443 }
444
445
454
455
464
465
474
475
484
485
493 return m_observationSolveSettings.size();
494 }
495
496
509 BundleSettings::observationSolveSettings(QString observationNumber) const {
510
511 BundleObservationSolveSettings defaultSolveSettings;
512
513 for (int i = 0; i < numberSolveSettings(); i++) {
514 if (m_observationSolveSettings[i].observationNumbers().contains(observationNumber)) {
515 return m_observationSolveSettings[i];
516 }
517 }
518 return defaultSolveSettings;
519 }
520
521
535
536 if (n >= 0 && n < numberSolveSettings()) {
537 return m_observationSolveSettings[n];
538 }
539 QString msg = "Unable to find BundleObservationSolveSettings with index = ["
540 + toString(n) + "].";
541 throw IException(IException::Unknown, msg, _FILEINFO_);
542 }
543
544
551 QList<BundleObservationSolveSettings> BundleSettings::observationSolveSettings() const {
552 return m_observationSolveSettings;
553 }
554
555
556 // =============================================================================================//
557 // ======================== Convergence Criteria ===============================================//
558 // =============================================================================================//
559
577 if (criteria.compare("SIGMA0", Qt::CaseInsensitive) == 0) {
579 }
580 else if (criteria.compare("PARAMETERCORRECTIONS", Qt::CaseInsensitive) == 0) {
582 }
584 "Unknown bundle convergence criteria [" + criteria + "].",
585 _FILEINFO_);
586 }
587
588
602 if (criteria == Sigma0) return "Sigma0";
603 else if (criteria == ParameterCorrections) return "ParameterCorrections";
605 "Unknown convergence criteria enum [" + toString(criteria) + "].",
606 _FILEINFO_);
607 }
608
609
621 double threshold,
622 int maximumIterations) {
623 m_convergenceCriteria = criteria;
625 m_convergenceCriteriaMaximumIterations = maximumIterations;
626 }
627
628
638
639
649
650
662
663
664
665 // =============================================================================================//
666 // ======================== Parameter Uncertainties (Weighting) ================================//
667 // =============================================================================================//
668// void BundleSettings::setGlobalLatitudeAprioriSigma(double sigma) {
669// m_globalLatitudeAprioriSigma = sigma;
670// }
671//
672//
673//
674// void BundleSettings::setGlobalLongitudeAprioriSigma(double sigma) {
675// m_globalLongitudeAprioriSigma = sigma;
676// }
677//
678//
679//
680// void BundleSettings::setGlobalRadiiAprioriSigma(double sigma) {
681// m_globalRadiusAprioriSigma = sigma;
682// }
683
684
685 // =============================================================================================//
686 // ======================== Maximum Likelihood Estimation Options ==============================//
687 // =============================================================================================//
688
689
703 double maxModelCQuantile) {
704
706 QString msg = "For bundle adjustments with multiple maximum likelihood estimators, the first "
707 "model must be of type HUBER or HUBER_MODIFIED.";
708 throw IException(IException::Programmer, msg, _FILEINFO_);
709 }
710
711 m_maximumLikelihood.append(qMakePair(model, maxModelCQuantile));
712 }
713
714
723 QList< QPair< MaximumLikelihoodWFunctions::Model, double > >
727
728
729 // =============================================================================================//
730 // ======================== Self Calibration ??? (from ipce only) =========================//
731 // =============================================================================================//
732
733 // =============================================================================================//
734 // ======================== Target Body ??? (from ipce only) ==============================//
735 // =============================================================================================//
736
746
747
757
758
765// bool BundleSettings::solveTargetBodyPolePosition() const {
766// return m_solveTargetBodyPolePosition;
767// }
768
769
778 return 0;
779
780 return m_bundleTargetBody->numberParameters();
781 }
782
783
791 if (!m_bundleTargetBody) {
792 return false;
793 }
794 else {
795 return (m_bundleTargetBody->numberParameters() > 0);
796 }
797 }
798
799
809 if (!m_bundleTargetBody) {
810 return false;
811 }
812 return m_bundleTargetBody->solvePoleRA();
813 }
814
815
825 if (!m_bundleTargetBody) {
826 return false;
827 }
828 return m_bundleTargetBody->solvePoleRAVelocity();
829 }
830
831
841 if (!m_bundleTargetBody) {
842 return false;
843 }
844 return m_bundleTargetBody->solvePoleDec();
845 }
846
847
857 if (!m_bundleTargetBody) {
858 return false;
859 }
860 return m_bundleTargetBody->solvePoleDecVelocity();
861 }
862
863
873 if (!m_bundleTargetBody) {
874 return false;
875 }
876 return m_bundleTargetBody->solvePM();
877 }
878
879
889 if (!m_bundleTargetBody) {
890 return false;
891 }
892 return m_bundleTargetBody->solvePMVelocity();
893 }
894
895
905 if (!m_bundleTargetBody) {
906 return false;
907 }
908 return m_bundleTargetBody->solvePMAcceleration();
909 }
910
911
921 if (!m_bundleTargetBody) {
922 return false;
923 }
924 return m_bundleTargetBody->solveTriaxialRadii();
925 }
926
927
937 if (!m_bundleTargetBody) {
938 return false;
939 }
940 return m_bundleTargetBody->solveMeanRadius();
941 }
942
943
944// void BundleSettings::setTargetBodySolveOptions(bool solveTargetBodyPolePosition,
945// double aprioriRaPole, double sigmaRaPole,
946// double aprioriDecPole, double sigmaDecPole,
947// bool solveTargetBodyZeroMeridian,
948// double aprioriW0, double sigmaW0,
949// bool solveTargetBodyRotationRate,
950// double aprioriWDot, double sigmaWDot,
951// TargetRadiiSolveMethod solveRadiiMethod,
952// double aprioriRadiusA, double sigmaRadiusA,
953// double aprioriRadiusB, double sigmaRadiusB,
954// double aprioriRadiusC, double sigmaRadiusC,
955// double aprioriMeanRadius, double sigmaMeanRadius) {
956
957
958// m_solveTargetBody = true;
959// m_solveTargetBodyPolePosition = solveTargetBodyPolePosition;
960// m_aprioriRaPole = aprioriRaPole;
961// m_sigmaRaPole = sigmaRaPole;
962// m_aprioriDecPole = aprioriDecPole;
963// m_sigmaDecPole = sigmaDecPole;
964// m_solveTargetBodyZeroMeridian =solveTargetBodyZeroMeridian;
965// m_aprioriW0 = aprioriW0;
966// m_sigmaW0 = sigmaW0;
967// m_solveTargetBodyRotationRate = solveTargetBodyRotationRate;
968// m_aprioriWDot = aprioriWDot;
969// m_sigmaWDot = sigmaWDot;
970// m_solveTargetBodyRadiusMethod = solveRadiiMethod;
971// m_aprioriRadiusA = aprioriRadiusA;
972// m_sigmaRadiusA = sigmaRadiusA;
973// m_aprioriRadiusB = aprioriRadiusB;
974// m_sigmaRadiusB = sigmaRadiusB;
975// m_aprioriRadiusC = aprioriRadiusC;
976// m_sigmaRadiusC = sigmaRadiusC;
977// m_aprioriMeanRadius = aprioriMeanRadius;
978// m_sigmaMeanRadius = sigmaMeanRadius;
979
980// m_bundleTargetBody->setSolveSettings(solveTargetBodyPolePosition, aprioriRaPole, sigmaRaPole,
981// aprioriDecPole, sigmaDecPole, solveTargetBodyZeroMeridian,
982// aprioriW0, sigmaW0, solveTargetBodyRotationRate,
983// aprioriWDot, sigmaWDot, solveRadiiMethod, aprioriRadiusA,
984// sigmaRadiusA, aprioriRadiusB, sigmaRadiusB, aprioriRadiusC,
985// sigmaRadiusC, aprioriMeanRadius, sigmaMeanRadius);
986// }
987
988
989 // =============================================================================================//
990 // ========================= Output Options (from Jigsaw only) ================================//
991 // =============================================================================================//
997 void BundleSettings::setOutputFilePrefix(QString outputFilePrefix) {
999 }
1000
1001
1012 return m_outputFilePrefix;
1013 }
1014
1015
1025 void BundleSettings::save(QXmlStreamWriter &stream, const Project *project) const {
1026 stream.writeStartElement("bundleSettings");
1027
1028 stream.writeStartElement("globalSettings");
1029
1030 stream.writeTextElement("validateNetwork", toString(validateNetwork()));
1031
1032 stream.writeStartElement("solveOptions");
1033 stream.writeAttribute("solveObservationMode", toString(solveObservationMode()));
1034 stream.writeAttribute("solveRadius", toString(solveRadius()));
1035 stream.writeAttribute("controlPointCoordTypeReports", toString(controlPointCoordTypeReports()));
1036 stream.writeAttribute("controlPointCoordTypeBundle", toString(controlPointCoordTypeBundle()));
1037 stream.writeAttribute("updateCubeLabel", toString(updateCubeLabel()));
1038 stream.writeAttribute("errorPropagation", toString(errorPropagation()));
1039 stream.writeAttribute("createInverseMatrix", toString(createInverseMatrix()));
1040 stream.writeEndElement();
1041
1042 stream.writeStartElement("aprioriSigmas");
1044 stream.writeAttribute("pointCoord1", "N/A");
1045 }
1046 else {
1047 stream.writeAttribute("pointCoord1", toString(globalPointCoord1AprioriSigma()));
1048 }
1050 stream.writeAttribute("pointCoord2", "N/A");
1051 }
1052 else {
1053 stream.writeAttribute("pointCoord2", toString(globalPointCoord2AprioriSigma()));
1054 }
1056 stream.writeAttribute("pointCoord3", "N/A");
1057 }
1058 else {
1059 stream.writeAttribute("pointCoord3", toString(globalPointCoord3AprioriSigma()));
1060 }
1061 stream.writeEndElement();
1062
1063 stream.writeStartElement("outlierRejectionOptions");
1064 stream.writeAttribute("rejection", toString(outlierRejection()));
1065 if (outlierRejection()) {
1066 stream.writeAttribute("multiplier", toString(outlierRejectionMultiplier()));
1067 }
1068 else {
1069 stream.writeAttribute("multiplier", "N/A");
1070 }
1071 stream.writeEndElement();
1072
1073 stream.writeStartElement("convergenceCriteriaOptions");
1074 stream.writeAttribute("convergenceCriteria",
1076 stream.writeAttribute("threshold",
1078 stream.writeAttribute("maximumIterations",
1080 stream.writeEndElement();
1081
1082 stream.writeStartElement("maximumLikelihoodEstimation");
1083 for (int i = 0; i < m_maximumLikelihood.size(); i++) {
1084 stream.writeStartElement("model");
1085 stream.writeAttribute("type",
1087 stream.writeAttribute("quantile", toString(m_maximumLikelihood[i].second));
1088 stream.writeEndElement();
1089 }
1090 stream.writeEndElement();
1091
1092 stream.writeStartElement("outputFileOptions");
1093 stream.writeAttribute("fileNamePrefix", outputFilePrefix());
1094 stream.writeEndElement();
1095
1096 stream.writeEndElement(); // end global settings
1097
1098 if (!m_observationSolveSettings.isEmpty()) {
1099 stream.writeStartElement("observationSolveSettingsList");
1100 for (int i = 0; i < m_observationSolveSettings.size(); i++) {
1101 m_observationSolveSettings[i].save(stream, project);
1102 }
1103 stream.writeEndElement();
1104 }
1105 else {
1106 // throw error??? should not write if no observation settings...
1107 }
1108 stream.writeEndElement();
1109 }
1110
1111 void BundleSettings::readBundleSettings(QXmlStreamReader *xmlReader) {
1112 init();
1113 Q_ASSERT(xmlReader->name() == "bundleSettings");
1114 while (xmlReader->readNextStartElement()) {
1115 if (xmlReader->qualifiedName() == "globalSettings") {
1116 while (xmlReader->readNextStartElement()) {
1117 if (xmlReader->qualifiedName() == "validateNetwork") {
1118 QString validateNetwork = xmlReader->readElementText();
1119 if (!validateNetwork.isEmpty()) {
1121 }
1122 }
1123 else if (xmlReader->qualifiedName() == "solveOptions") {
1124 QStringRef solveObservationMode = xmlReader->attributes().value("solveObservationMode");
1125 if (!solveObservationMode.isEmpty()) {
1127 }
1128 QStringRef solveRadius = xmlReader->attributes().value("solveRadius");
1129 if (!solveRadius.isEmpty()) {
1130 m_solveRadius = toBool(solveRadius.toString());
1131 }
1132 QStringRef controlPointCoordTypeReports = xmlReader->attributes().value("controlPointCoordTypeReports");
1133 if (!controlPointCoordTypeReports.isEmpty()) {
1134 if (controlPointCoordTypeReports == "0") {
1136 }
1137 else if (controlPointCoordTypeReports == "1") {
1139 }
1140 }
1141 QStringRef controlPointCoordTypeBundle = xmlReader->attributes().value("controlPointCoordTypeBundle");
1142 if (!controlPointCoordTypeBundle.isEmpty()) {
1143 if (controlPointCoordTypeBundle == "0") {
1145 }
1146 else if (controlPointCoordTypeBundle == "1") {
1148 }
1149 }
1150 QStringRef updateCubeLabel = xmlReader->attributes().value("updateCubeLabel");
1151 if (!updateCubeLabel.isEmpty()) {
1153 }
1154 QStringRef errorPropagation = xmlReader->attributes().value("errorPropagation");
1155 if (!errorPropagation.isEmpty()) {
1157 }
1158 QStringRef createInverseMatrix = xmlReader->attributes().value("createInverseMatrix");
1159 if (!createInverseMatrix.isEmpty()) {
1161 }
1162 xmlReader->skipCurrentElement();
1163 }
1164 else if (xmlReader->qualifiedName() == "aprioriSigmas") {
1165 QStringRef globalPointCoord1AprioriSigma = xmlReader->attributes().value("pointCoord1");
1166 if (!globalPointCoord1AprioriSigma.isEmpty()) {
1167 if (globalPointCoord1AprioriSigma == "N/A") {
1169 }
1170 else {
1172 }
1173 }
1174 QStringRef globalPointCoord2AprioriSigma = xmlReader->attributes().value("pointCoord2");
1175 if (!globalPointCoord2AprioriSigma.isEmpty()) {
1176 if (globalPointCoord2AprioriSigma == "N/A") {
1178 }
1179 else {
1181 }
1182 }
1183 QStringRef globalPointCoord3AprioriSigma = xmlReader->attributes().value("radius");
1184 if (!globalPointCoord3AprioriSigma.isEmpty()) {
1185 if (globalPointCoord3AprioriSigma == "N/A") {
1187 }
1188 else {
1190 }
1191 }
1192 xmlReader->skipCurrentElement();
1193 }
1194 else if (xmlReader->qualifiedName() == "outlierRejectionOptions") {
1195 QStringRef outlierRejection = xmlReader->attributes().value("rejection");
1196 if (!outlierRejection.isEmpty()) {
1198 }
1199 QStringRef outlierRejectionMultiplier = xmlReader->attributes().value("multiplier");
1200 if (!outlierRejectionMultiplier.isEmpty()) {
1201 if (outlierRejectionMultiplier != "N/A") {
1203 }
1204 else {
1206 }
1207 }
1208 xmlReader->skipCurrentElement();
1209 }
1210 else if (xmlReader->qualifiedName() == "convergenceCriteriaOptions") {
1211 QStringRef convergenceCriteria = xmlReader->attributes().value("convergenceCriteria");
1212 if (!convergenceCriteria.isEmpty()) {
1214 }
1215 QStringRef threshold = xmlReader->attributes().value("threshold");
1216 if (!threshold.isEmpty()) {
1217 m_convergenceCriteriaThreshold = threshold.toDouble();
1218 }
1219 QStringRef maximumIterations = xmlReader->attributes().value("maximumIterations");
1220 if (!maximumIterations.isEmpty()) {
1221 m_convergenceCriteriaMaximumIterations = maximumIterations.toInt();
1222 }
1223 xmlReader->skipCurrentElement();
1224 }
1225 else if (xmlReader->qualifiedName() == "maximumLikelihoodEstimation") {
1226 while (xmlReader->readNextStartElement()) {
1227 if (xmlReader->qualifiedName() == "model") {
1228 QStringRef type = xmlReader->attributes().value("type");
1229 QStringRef quantile = xmlReader->attributes().value("quantile");
1230 if (!type.isEmpty() && !quantile.isEmpty()) {
1231 m_maximumLikelihood.append(qMakePair(MaximumLikelihoodWFunctions::stringToModel(type.toString()), quantile.toDouble()));
1232 }
1233 xmlReader->skipCurrentElement();
1234 }
1235 else {
1236 xmlReader->skipCurrentElement();
1237 }
1238 }
1239 }
1240 else if (xmlReader->qualifiedName() == "outputFileOptions") {
1241 QStringRef fileNamePrefix = xmlReader->attributes().value("fileNamePrefix");
1242 if (!fileNamePrefix.isEmpty()) {
1243 m_outputFilePrefix = fileNamePrefix.toString();
1244 }
1245 xmlReader->skipCurrentElement();
1246 }
1247 else {
1248 xmlReader->skipCurrentElement();
1249 }
1250 }
1251 }
1252 else if (xmlReader->qualifiedName() == "observationSolveSettingsList") {
1253 m_observationSolveSettings.clear();
1254 while (xmlReader->readNextStartElement()) {
1255 if (xmlReader->qualifiedName() == "bundleObservationSolveSettings") {
1257 m_observationSolveSettings.append(*settings);
1258 }
1259 else {
1260 xmlReader->skipCurrentElement();
1261 }
1262 }
1263 }
1264 else {
1265 xmlReader->skipCurrentElement();
1266 }
1267 }
1268 }
1269}
This class is used to modify and manage solve settings for 1 to many BundleObservations.
Container class for BundleAdjustment settings.
bool m_createInverseMatrix
Indicates whether to create the inverse matrix file.
double globalPointCoord2AprioriSigma() const
Retrieves the global a priori sigma for 2nd coordinate of points for this bundle.
bool validateNetwork() const
This method is used to determine whether to validate the network before the bundle adjustment.
int convergenceCriteriaMaximumIterations() const
Retrieves the maximum number of iterations allowed to solve the bundle adjustment.
bool m_solveRadius
Indicates whether to solve for point radii.
BundleSettings & operator=(const BundleSettings &other)
Assignment operator to allow proper copying of the 'other' BundleSettings object to this one.
double globalPointCoord3AprioriSigma() const
Retrieves the global a priori sigma 3rd coordinate of points for this bundle.
void addMaximumLikelihoodEstimatorModel(MaximumLikelihoodWFunctions::Model model, double cQuantile)
Add a maximum likelihood estimator (MLE) model to the bundle adjustment.
BundleSettings()
Constructs a BundleSettings object.
QString m_outputFilePrefix
The prefix for all output files.
bool m_solveObservationMode
Indicates whether to solve for observation mode.
SurfacePoint::CoordinateType controlPointCoordTypeBundle() const
Indicates the control point coordinate type for the actual bundle adjust.
bool errorPropagation() const
This method is used to determine whether this bundle adjustment will perform error propagation.
void setConvergenceCriteria(ConvergenceCriteria criteria, double threshold, int maximumIterations)
Set the convergence criteria options for the bundle adjustment.
bool solvePMVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
double m_globalPointCoord2AprioriSigma
The global a priori sigma for longitude or Y.
void save(QXmlStreamWriter &stream, const Project *project) const
This method is used to write a BundleSettings object in an XML format.
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
@ Sigma0
The value of sigma0 will be used to determine that the bundle adjustment has converged.
@ ParameterCorrections
All parameter corrections will be used to determine that the bundle adjustment has converged.
BundleTargetBodyQsp bundleTargetBody() const
Retrieves a pointer to target body information for the bundle adjustment.
void setCreateInverseMatrix(bool createMatrix)
Turn the creation of the inverse correlation matrix file on or off.
bool solveMeanRadius() const
This method is used to determine whether the bundle adjustment will solve for target body mean radius...
bool solveRadius() const
This method is used to determine whether this bundle adjustment will solve for radius.
void init()
Set Default vales for a BundleSettings object.
bool solveTriaxialRadii() const
This method is used to determine whether the bundle adjustment will solve for target body triaxial ra...
BundleTargetBodyQsp m_bundleTargetBody
A pointer to the target body settings and information.
ConvergenceCriteria m_convergenceCriteria
Enumeration used to indicate what criteria to use to determine bundle adjustment convergence.
double m_globalPointCoord3AprioriSigma
The global a priori sigma for radius or Z.
bool solvePMAcceleration() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
QList< BundleObservationSolveSettings > observationSolveSettings() const
Retrieves solve settings for the observation corresponding to the given index.
void setBundleTargetBody(BundleTargetBodyQsp bundleTargetBody)
Sets the target body for the bundle adjustment.
int numberTargetBodyParameters() const
This method is used to determine whether the bundle adjustment will solve for target body pole positi...
QString outputFilePrefix() const
Retrieve the output file prefix.
double globalPointCoord1AprioriSigma() const
Retrieves global a priori sigma for 1st coordinate of points for this bundle.
bool updateCubeLabel() const
This method is used to determine whether this bundle adjustment will update the cube labels.
double m_convergenceCriteriaThreshold
Tolerance value corresponding to the selected convergence criteria.
double m_outlierRejectionMultiplier
The multiplier value for outlier rejection.
bool outlierRejection() const
This method is used to determine whether outlier rejection will be performed on this bundle adjustmen...
void setOutputFilePrefix(QString outputFilePrefix)
Set the output file prefix for the bundle adjustment.
bool solvePoleRA() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
bool solvePoleDecVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
static QString convergenceCriteriaToString(ConvergenceCriteria criteria)
Converts the given BundleSettings::ConvergenceCriteria enumeration to a string.
void setValidateNetwork(bool validate)
Sets the internal flag to indicate whether to validate the network before the bundle adjustment.
~BundleSettings()
Destroys the BundleSettings object.
static ConvergenceCriteria stringToConvergenceCriteria(QString criteria)
Converts the given string value to a BundleSettings::ConvergenceCriteria enumeration.
SurfacePoint::CoordinateType m_cpCoordTypeReports
Indicates the coordinate type for outputting control points in reports.
bool m_outlierRejection
Indicates whether to perform automatic outlier detection/rejection.
bool m_errorPropagation
Indicates whether to perform error propagation.
bool createInverseMatrix() const
Indicates if the settings will allow the inverse correlation matrix to be created.
bool solvePoleRAVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
QString cubeList() const
BundleSettings::cubeList.
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > m_maximumLikelihood
Model and C-Quantile for each of the three maximum likelihood estimations.
void setOutlierRejection(bool outlierRejection, double multiplier=1.0)
Set the outlier rejection options for the bundle adjustment.
ConvergenceCriteria convergenceCriteria() const
Retrieves the convergence criteria to be used to solve the bundle adjustment.
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > maximumLikelihoodEstimatorModels() const
Retrieves the list of maximum likelihood estimator (MLE) models with their corresponding C-Quantiles.
bool solvePoleDec() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
bool m_validateNetwork
Indicates whether the network should be validated.
double m_globalPointCoord1AprioriSigma
The global a priori sigma for latitude or X.
int numberSolveSettings() const
Retrieves the number of observation solve settings.
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.
SurfacePoint::CoordinateType controlPointCoordTypeReports() const
Indicates the control point coordinate type for reports.
bool solvePM() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
void setCubeList(QString fileName)
BundleSettings::setCubeList.
bool m_updateCubeLabel
Indicates whether to update cubes.
double convergenceCriteriaThreshold() const
Retrieves the convergence threshold to be used to solve the bundle adjustment.
void setObservationSolveOptions(QList< BundleObservationSolveSettings > obsSolveSettingsList)
Add the list of solve options for each observation.
bool solveObservationMode() const
This method is used to determine whether this bundle adjustment will solve for observation mode.
int m_convergenceCriteriaMaximumIterations
Maximum number of iterations before quitting the bundle adjustment if it has not yet converged to the...
bool solveTargetBody() const
This method is used to determine whether the bundle adjustment will solve for target body.
double outlierRejectionMultiplier() const
Retrieves the outlier rejection multiplier for the bundle adjustment.
bool m_solveTargetBody
Indicates whether to solve for target body.
SurfacePoint::CoordinateType m_cpCoordTypeBundle
Indicates the coordinate type used for control points in the bundle adjustment.
Isis exception class.
Definition IException.h:91
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition IException.h:118
@ Programmer
This error is for when a programmer made an API call that was illegal.
Definition IException.h:146
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
Model
The supported maximum likelihood estimation models.
@ HuberModified
A modification to Huber's method propsed by William J.J.
The main project for ipce.
Definition Project.h:287
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
This is free and unencumbered software released into the public domain.
Definition Apollo.h:16
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition IString.cpp:211
const double Null
Value for an Isis Null pixel.
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition IString.cpp:38
bool IsSpecial(const double d)
Returns if the input pixel is special.
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.