File failed to load: https://isis.astrogeology.usgs.gov/6.0.0/Object/assets/jax/output/NativeMML/config.js
Isis 3 Programmer Reference
BundleResults.cpp
1 
7 /* SPDX-License-Identifier: CC0-1.0 */
8 
9 #include "BundleResults.h"
10 
11 #include <QDataStream>
12 #include <QDebug>
13 #include <QString>
14 #include <QtGlobal> // qMax()
15 #include <QUuid>
16 #include <QXmlStreamWriter>
17 
18 #include <boost/lexical_cast.hpp>
19 #include <boost/numeric/ublas/io.hpp>
20 #include <boost/numeric/ublas/matrix_sparse.hpp>
21 #include <boost/numeric/ublas/vector_proxy.hpp>
22 
23 #include "Camera.h"
24 #include "ControlMeasure.h"
25 #include "ControlPoint.h"
26 #include "CorrelationMatrix.h"
27 #include "Distance.h"
28 #include "FileName.h"
29 #include "IString.h"
30 #include "MaximumLikelihoodWFunctions.h"
31 #include "Project.h"
32 #include "PvlKeyword.h"
33 #include "PvlObject.h"
34 #include "SerialNumberList.h"
35 #include "StatCumProbDistDynCalc.h"
36 #include "Statistics.h"
37 #include "XmlStackedHandlerReader.h"
38 
39 using namespace boost::numeric::ublas;
40 
41 namespace Isis {
42 
48  BundleResults::BundleResults(QObject *parent) : QObject(parent) {
49 
50  initialize();
51 
55 
56  // residual prob distribution is calculated even if there is no maximum likelihood estimation.
57  // so set up the solver to have a node at every percent of the distribution
59 
60  }
61 
62 
72  QObject *parent) : QObject(parent) {
73  // TODO: does xml stuff need project???
74 
75  initialize();
76 
77  xmlReader->pushContentHandler(new XmlHandler(this, project));
78  xmlReader->setErrorHandler(new XmlHandler(this, project));
79 
80  }
81 
82 
90  : m_correlationMatrix(new CorrelationMatrix(*src.m_correlationMatrix)),
91  m_numberFixedPoints(src.m_numberFixedPoints),
92  m_numberIgnoredPoints(src.m_numberIgnoredPoints),
93  m_numberHeldImages(src.m_numberHeldImages),
94  m_rmsXResiduals(src.m_rmsXResiduals),
95  m_rmsYResiduals(src.m_rmsYResiduals),
96  m_rmsXYResiduals(src.m_rmsXYResiduals),
97  m_rejectionLimit(src.m_rejectionLimit),
98  m_numberObservations(src.m_numberObservations),
99  m_numberRejectedObservations(src.m_numberRejectedObservations),
100  m_numberUnknownParameters(src.m_numberUnknownParameters),
101  m_numberImageParameters(src.m_numberImageParameters),
102  m_numberConstrainedImageParameters(src.m_numberConstrainedImageParameters),
103  m_numberConstrainedPointParameters(src.m_numberConstrainedPointParameters),
104  m_numberConstrainedTargetParameters(src.m_numberConstrainedTargetParameters),
105  m_degreesOfFreedom(src.m_degreesOfFreedom),
106  m_sigma0(src.m_sigma0),
107  m_elapsedTime(src.m_elapsedTime),
108  m_elapsedTimeErrorProp(src.m_elapsedTimeErrorProp),
109  m_converged(src.m_converged),
110  m_bundleControlPoints(src.m_bundleControlPoints),
111  m_outNet(src.m_outNet),
112  m_iterations(src.m_iterations),
113  m_observations(src.m_observations),
114  m_rmsImageSampleResiduals(src.m_rmsImageSampleResiduals),
115  m_rmsImageLineResiduals(src.m_rmsImageLineResiduals),
116  m_rmsImageResiduals(src.m_rmsImageResiduals),
117  m_rmsImageXSigmas(src.m_rmsImageXSigmas),
118  m_rmsImageYSigmas(src.m_rmsImageYSigmas),
119  m_rmsImageZSigmas(src.m_rmsImageZSigmas),
120  m_rmsImageRASigmas(src.m_rmsImageRASigmas),
121  m_rmsImageDECSigmas(src.m_rmsImageDECSigmas),
122  m_rmsImageTWISTSigmas(src.m_rmsImageTWISTSigmas),
123  m_minSigmaCoord1Distance(src.m_minSigmaCoord1Distance),
124  m_maxSigmaCoord1Distance(src.m_maxSigmaCoord1Distance),
125  m_minSigmaCoord2Distance(src.m_minSigmaCoord2Distance),
126  m_maxSigmaCoord2Distance(src.m_maxSigmaCoord2Distance),
127  m_minSigmaCoord3Distance(src.m_minSigmaCoord3Distance),
128  m_maxSigmaCoord3Distance(src.m_maxSigmaCoord3Distance),
129  m_minSigmaCoord1PointId(src.m_minSigmaCoord1PointId),
130  m_maxSigmaCoord1PointId(src.m_maxSigmaCoord1PointId),
131  m_minSigmaCoord2PointId(src.m_minSigmaCoord2PointId),
132  m_maxSigmaCoord2PointId(src.m_maxSigmaCoord2PointId),
133  m_minSigmaCoord3PointId(src.m_minSigmaCoord3PointId),
134  m_maxSigmaCoord3PointId(src.m_maxSigmaCoord3PointId),
135  m_rmsSigmaCoord1Stats(src.m_rmsSigmaCoord1Stats),
136  m_rmsSigmaCoord2Stats(src.m_rmsSigmaCoord2Stats),
137  m_rmsSigmaCoord3Stats(src.m_rmsSigmaCoord3Stats),
138  m_maximumLikelihoodFunctions(src.m_maximumLikelihoodFunctions),
139  m_maximumLikelihoodIndex(src.m_maximumLikelihoodIndex),
140  m_cumPro(new StatCumProbDistDynCalc(*src.m_cumPro)),
141  m_cumProRes(new StatCumProbDistDynCalc(*src.m_cumProRes)),
142  m_maximumLikelihoodMedianR2Residuals(src.m_maximumLikelihoodMedianR2Residuals) {
143  }
144 
145 
150 
151  delete m_correlationMatrix;
152  m_correlationMatrix = NULL;
153 
154  delete m_cumPro;
155  m_cumPro = NULL;
156 
157  delete m_cumProRes;
158  m_cumProRes = NULL;
159 
160  }
161 
162 
170 
171  if (&src != this) {
172  delete m_correlationMatrix;
173  m_correlationMatrix = NULL;
175 
191  m_sigma0 = src.m_sigma0;
194  m_converged = src.m_converged;
196  m_outNet = src.m_outNet;
202  m_rmsImageXSigmas = src.m_rmsImageXSigmas;
225 
226  delete m_cumPro;
227  m_cumPro = NULL;
229 
230  delete m_cumProRes;
231  m_cumProRes = NULL;
233 
235  }
236  return *this;
237  }
238 
239 
246  m_correlationMatrix = NULL;
247 
248  m_numberFixedPoints = 0; // set in BA constructor->init->fillPointIndexMap
249  m_numberIgnoredPoints = 0; // set in BA constructor->init->fillPointIndexMap
250 
251 
252  // set in BundleAdjust init()
253  m_numberHeldImages = 0;
254 
255  // members set while computing bundle stats
257  m_rmsImageLineResiduals.clear();
258  m_rmsImageResiduals.clear();
259  m_rmsImageXSigmas.clear();
260  m_rmsImageYSigmas.clear();
261  m_rmsImageZSigmas.clear();
262  m_rmsImageRASigmas.clear();
263  m_rmsImageDECSigmas.clear();
264  m_rmsImageTWISTSigmas.clear();
265 
266  // Initialize coordinate sigma boundaries. Units are meters for sigmas in both
267  // latitudinal and rectangular coordinates
280 
281  m_rmsSigmaCoord1Stats = 0.0;
282  m_rmsSigmaCoord2Stats = 0.0;
283  m_rmsSigmaCoord3Stats = 0.0;
284 
285 
286  // set by compute residuals
287  m_rmsXResiduals = 0.0;
288  m_rmsYResiduals = 0.0;
289  m_rmsXYResiduals = 0.0;
290 
291  // set by compute rejection limit
292  m_rejectionLimit = 0.0;
293 
294  // set by flag outliers
296 
297  // set by formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or solve
300 
301 // ??? unused variable ??? m_numberHeldPoints = 0;
302 
303  // set by formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or
304  // setParameterWeights (i.e. solve)
308 
309  // set by initialize, formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or solve
311 
312  // solve and solve cholesky
313  m_degreesOfFreedom = -1;
314  m_iterations = 0;
315  m_sigma0 = 0.0;
316  m_elapsedTime = 0.0;
318  m_converged = false; // or initialze method
319 
320  m_cumPro = NULL;
324  m_cumProRes = NULL;
325 
326  m_observations.clear();
327  m_outNet.clear();
328 
329  }
330 
331 
338  m_rmsImageXSigmas.resize(numberImages);
339  m_rmsImageYSigmas.resize(numberImages);
340  m_rmsImageZSigmas.resize(numberImages);
341  m_rmsImageRASigmas.resize(numberImages);
342  m_rmsImageDECSigmas.resize(numberImages);
343  m_rmsImageTWISTSigmas.resize(numberImages);
344  }
345 
346 
347 #if 0
349  QVector<Statistics> rmsImageSampleResiduals,
350  QVector<Statistics> rmsImageResiduals) {
351  // QList??? jigsaw apptest gives - ASSERT failure in QList<T>::operator[]: "index out of range",
355  }
356 #endif
357 
358 
367  QList<Statistics> rmsImageSampleResiduals,
368  QList<Statistics> rmsImageResiduals) {
372  }
373 
374 
383  void BundleResults::setSigmaCoord1Range(Distance minCoord1Dist, Distance maxCoord1Dist,
384  QString minCoord1PointId, QString maxCoord1PointId) {
385  m_minSigmaCoord1Distance = minCoord1Dist;
386  m_maxSigmaCoord1Distance = maxCoord1Dist;
387  m_minSigmaCoord1PointId = minCoord1PointId;
388  m_maxSigmaCoord1PointId = maxCoord1PointId;
389  }
390 
391 
400  void BundleResults::setSigmaCoord2Range(Distance minCoord2Dist, Distance maxCoord2Dist,
401  QString minCoord2PointId, QString maxCoord2PointId) {
402  m_minSigmaCoord2Distance = minCoord2Dist;
403  m_maxSigmaCoord2Distance = maxCoord2Dist;
404  m_minSigmaCoord2PointId = minCoord2PointId;
405  m_maxSigmaCoord2PointId = maxCoord2PointId;
406  }
407 
408 
417  void BundleResults::setSigmaCoord3Range(Distance minCoord3Dist, Distance maxCoord3Dist,
418  QString minCoord3PointId, QString maxCoord3PointId) {
419  m_minSigmaCoord3Distance = minCoord3Dist;
420  m_maxSigmaCoord3Distance = maxCoord3Dist;
421  m_minSigmaCoord3PointId = minCoord3PointId;
422  m_maxSigmaCoord3PointId = maxCoord3PointId;
423  }
424 
425 
434  double rmsFromSigmaCoord1Stats,
435  double rmsFromSigmaCoord2Stats,
436  double rmsFromSigmaCoord3Stats) {
437  m_rmsSigmaCoord1Stats = rmsFromSigmaCoord1Stats;
438  m_rmsSigmaCoord2Stats = rmsFromSigmaCoord2Stats;
439  m_rmsSigmaCoord3Stats = rmsFromSigmaCoord3Stats;
440  }
441 
442 
452 
453 
454  // reinitialize variables if this setup has already been called
457 
458  // residual prob distribution is calculated even if there is no maximum likelihood estimation.
459  // set up the solver to have a node at every percent of the distribution
460  m_cumProRes = NULL;
463 
464  // if numberMaximumLikelihoodModels > 0, then MaximumLikeliHood Estimation is being used.
465  for (int i = 0; i < modelsWithQuantiles.size(); i++) {
466 
467  // if maximum likelihood is being used, the cum prob calculator is initialized.
468  if (i == 0) {
469  m_cumPro = NULL;
471  // set up the solver to have a node at every percent of the distribution
473  }
474 
475  // set up the w functions for the maximum likelihood estimation
477  qMakePair(MaximumLikelihoodWFunctions(modelsWithQuantiles[i].first),
478  modelsWithQuantiles[i].second));
479 
480  }
481 
482 
483  //maximum likelihood estimation tiered solutions requiring multiple convergeances are supported,
484  // this index keeps track of which tier the solution is in
486  }
487 
488 
493 // printf("Maximum Likelihood Tier: %d\n", m_maximumLikelihoodIndex);
495  // if maximum likelihood estimation is being used
496  // at the end of every iteration
497  // reset the tweaking contant to the desired quantile of the |residual| distribution
498  double quantile = m_maximumLikelihoodFunctions[m_maximumLikelihoodIndex].second;
499  double tc = m_cumPro->value(quantile);
500  m_maximumLikelihoodFunctions[m_maximumLikelihoodIndex].first.setTweakingConstant(tc);
501  // print meadians of residuals
503 // printf("Median of R^2 residuals: %lf\n", m_maximumLikelihoodMedianR2Residuals);
504 
505  //restart the dynamic calculation of the cumulative probility distribution of |R^2 residuals|
506  // so it will be up to date for the next iteration
508  }
509  }
510 
511 
518  m_cumPro->setQuantiles(nodes);
519  }
520 
521 
528  m_cumProRes->setQuantiles(nodes);
529  }
530 
531 
539  m_cumPro->addObs(observationValue);
540  }
541 
542 
550  m_cumProRes->addObs(observationValue);
551  }
552 
553 
560  }
561 
562 
568  }
569 
570 
577  return m_numberFixedPoints;
578  }
579 
580 
586  }
587 
588 
595  return m_numberHeldImages;
596  }
597 
598 
604  }
605 
606 
613  return m_numberIgnoredPoints;
614  }
615 
616 
624  void BundleResults::setRmsXYResiduals(double rx, double ry, double rxy) {
625  m_rmsXResiduals = rx;
626  m_rmsYResiduals = ry;
627  m_rmsXYResiduals = rxy;
628  }
629 
630 
636  void BundleResults::setRejectionLimit(double rejectionLimit) {
638  }
639 
640 
646  void BundleResults::setNumberRejectedObservations(int numberRejectedObservations) {
648  }
649 
650 
656  void BundleResults::setNumberObservations(int numberObservations) {
658  }
659 
660 
666  void BundleResults::setNumberImageParameters(int numberParameters) {
667  m_numberImageParameters = numberParameters;
668  }
669 
670 
676  }
677 
678 
685  m_numberConstrainedPointParameters += incrementAmount;
686  }
687 
688 
694  }
695 
696 
703  m_numberConstrainedImageParameters += incrementAmount;
704  }
705 
706 
712  }
713 
714 
721  m_numberConstrainedTargetParameters += incrementAmount;
722  }
723 
724 
730  void BundleResults::setNumberUnknownParameters(int numberParameters) {
731  m_numberUnknownParameters = numberParameters;
732  }
733 
734 
744  }
745 
746 
760 
761  if (m_degreesOfFreedom > 0) {
762  m_sigma0 = dvtpv / m_degreesOfFreedom;
763  }
764  else if (m_degreesOfFreedom == 0 && criteria == BundleSettings::ParameterCorrections) {
765  m_sigma0 = dvtpv;
766  }
767  else {
768  QString msg = "Computed degrees of freedom [" + toString(m_degreesOfFreedom)
769  + "] is invalid.";
770  throw IException(IException::Io, msg, _FILEINFO_);
771  }
772 
773  m_sigma0 = sqrt(m_sigma0);
774  }
775 
776 
782  void BundleResults::setDegreesOfFreedom(double degreesOfFreedom) { // old sparse
784  }
785 
786 
792  void BundleResults::setSigma0(double sigma0) { // old sparse
793  m_sigma0 = sigma0;
794  }
795 
796 
802  void BundleResults::setElapsedTime(double time) {
803  m_elapsedTime = time;
804  }
805 
806 
813  m_elapsedTimeErrorProp = time;
814  }
815 
816 
822  void BundleResults::setConverged(bool converged) {
823  m_converged = converged;
824  }
825 
826 
833  m_bundleControlPoints = controlPoints;
834  }
835 
836 
843  m_outNet = outNet;
844  }
845 
846 
852  void BundleResults::setIterations(int iterations) {
854  }
855 
856 
864  }
865 
866 
867 
868  //************************* Accessors **********************************************************//
869 
877  }
878 
879 
887  }
888 
889 
896  return m_rmsImageResiduals;
897  }
898 
899 
906  return m_rmsImageXSigmas;
907  }
908 
909 
916  return m_rmsImageYSigmas;
917  }
918 
919 
926  return m_rmsImageZSigmas;
927  }
928 
929 
936  return m_rmsImageRASigmas;
937  }
938 
939 
946  return m_rmsImageDECSigmas;
947  }
948 
949 
956  return m_rmsImageTWISTSigmas;
957  }
958 
959 
967  }
968 
969 
977  }
978 
979 
987  }
988 
989 
997  }
998 
999 
1006  return m_minSigmaCoord3Distance;
1007  }
1008 
1009 
1016  return m_maxSigmaCoord3Distance;
1017  }
1018 
1019 
1026  return m_minSigmaCoord1PointId;
1027  }
1028 
1029 
1036  return m_maxSigmaCoord1PointId;
1037  }
1038 
1039 
1046  return m_minSigmaCoord2PointId;
1047  }
1048 
1049 
1056  return m_maxSigmaCoord2PointId;
1057  }
1058 
1059 
1066  return m_minSigmaCoord3PointId;
1067  }
1068 
1069 
1076  return m_maxSigmaCoord3PointId;
1077  }
1078 
1079 
1086  return m_rmsSigmaCoord1Stats;
1087  }
1088 
1089 
1096  return m_rmsSigmaCoord2Stats;
1097  }
1098 
1099 
1106  return m_rmsSigmaCoord3Stats;
1107  }
1108 
1109 
1115  double BundleResults::rmsRx() const {
1116  return m_rmsXResiduals;
1117  }
1118 
1119 
1125  double BundleResults::rmsRy() const {
1126  return m_rmsYResiduals;
1127  }
1128 
1129 
1135  double BundleResults::rmsRxy() const {
1136  return m_rmsXYResiduals;
1137  }
1138 
1139 
1146  return m_rejectionLimit;
1147  }
1148 
1149 
1157  }
1158 
1159 
1166  return m_numberObservations;
1167  }
1168 
1169 
1176  return m_numberImageParameters;
1177  }
1178 
1179 
1187  }
1188 
1189 
1197  }
1198 
1199 
1207  }
1208 
1209 
1217  }
1218 
1219 
1226  return m_degreesOfFreedom;
1227  }
1228 
1229 
1235  double BundleResults::sigma0() const {
1236  return m_sigma0;
1237  }
1238 
1239 
1246  return m_elapsedTime;
1247  }
1248 
1249 
1256  return m_elapsedTimeErrorProp;
1257  }
1258 
1259 
1266  return m_converged;
1267  }
1268 
1269 
1276  return m_bundleControlPoints;
1277  }
1278 
1279 
1288  if (!m_outNet) {
1290  "Output Control Network has not been set.",
1291  _FILEINFO_);
1292  }
1293  return m_outNet;
1294  }
1295 
1296 
1303  return m_iterations;
1304  }
1305 
1306 
1313  return m_observations;
1314  }
1315 
1316 
1323  return m_maximumLikelihoodFunctions.size();
1324  }
1325 
1326 
1333  return m_maximumLikelihoodIndex;
1334  }
1335 
1336 
1344  return *m_cumPro;
1345  }
1346 
1347 
1354  return *m_cumProRes;
1355  }
1356 
1357 
1365  }
1366 
1367 
1376  return m_maximumLikelihoodFunctions[modelIndex].first;
1377  }
1378 
1379 
1387  double BundleResults::maximumLikelihoodModelQuantile(int modelIndex) const {
1388  return m_maximumLikelihoodFunctions[modelIndex].second;
1389  }
1390 
1391 
1392 // QList< QPair< MaximumLikelihoodWFunctions, double > >
1393 // BundleResults::maximumLikelihoodModels() const {
1394 // return m_maximumLikelihoodFunctions;
1395 // }
1396 
1397 
1406  if (m_correlationMatrix) {
1407  return *m_correlationMatrix;
1408  }
1409  else {
1411  "Correlation matrix for this bundle is NULL.",
1412  _FILEINFO_);
1413  }
1414  }
1415 
1416 
1423  correlationMatrix();// throw error if null
1425  }
1426 
1427 
1434  correlationMatrix();// throw error if null
1436  }
1437 
1438 
1439  SurfacePoint::CoordinateType BundleResults::coordTypeReports() {
1440  // Get the coordinate type from the output net if it exists. Otherwise use the default.
1442 
1443  if (m_outNet) {
1444  type = outputControlNet()->GetCoordType();
1445  }
1446 
1447  return type;
1448  }
1449 
1450 
1457  void BundleResults::save(QXmlStreamWriter &stream, const Project *project) const {
1458  // Get the coordinate type from the output net if it exists. Otherwise use the default.
1460 
1461  if (m_outNet) {
1462  coordType = outputControlNet()->GetCoordType();
1463  }
1464 
1465  stream.writeStartElement("bundleResults");
1466  stream.writeStartElement("correlationMatrix");
1467  stream.writeAttribute("correlationFileName",
1468  correlationMatrix().correlationFileName().expanded());
1469  stream.writeAttribute("covarianceFileName",
1470  correlationMatrix().covarianceFileName().expanded());
1471  stream.writeStartElement("imagesAndParameters");
1472  QMapIterator<QString, QStringList> imgParamIt(*correlationMatrix().imagesAndParameters());
1473  while (imgParamIt.hasNext()) {
1474  imgParamIt.next();
1475  stream.writeStartElement("image");
1476  stream.writeAttribute("id", imgParamIt.key());
1477  QStringList parameters = imgParamIt.value();
1478  for (int i = 0; i < parameters.size(); i++) {
1479  stream.writeTextElement("parameter", parameters[i]);
1480  }
1481  stream.writeEndElement(); // end image
1482 
1483  }
1484  stream.writeEndElement(); // end images and parameters
1485  stream.writeEndElement(); // end correlationMatrix
1486 
1487  stream.writeStartElement("generalStatisticsValues");
1488  stream.writeTextElement("numberFixedPoints", toString(numberFixedPoints()));
1489  stream.writeTextElement("numberIgnoredPoints", toString(numberIgnoredPoints()));
1490  stream.writeTextElement("numberHeldImages", toString(numberHeldImages()));
1491  stream.writeTextElement("rejectionLimit", toString(rejectionLimit()));
1492  stream.writeTextElement("numberRejectedObservations", toString(numberRejectedObservations()));
1493  stream.writeTextElement("numberObservations", toString(numberObservations()));
1494  stream.writeTextElement("numberImageParameters", toString(numberImageParameters()));
1495  stream.writeTextElement("numberConstrainedPointParameters",
1497  stream.writeTextElement("numberConstrainedImageParameters",
1499  stream.writeTextElement("numberConstrainedTargetParameters",
1501  stream.writeTextElement("numberUnknownParameters", toString(numberUnknownParameters()));
1502  stream.writeTextElement("degreesOfFreedom", toString(degreesOfFreedom()));
1503  stream.writeTextElement("sigma0", toString(sigma0()));
1504  stream.writeTextElement("converged", toString(converged()));
1505  stream.writeEndElement(); // end generalStatisticsValues
1506 
1507  stream.writeStartElement("rms");
1508  stream.writeStartElement("residuals");
1509  stream.writeAttribute("x", toString(rmsRx()));
1510  stream.writeAttribute("y", toString(rmsRy()));
1511  stream.writeAttribute("xy", toString(rmsRxy()));
1512  stream.writeEndElement(); // end residuals element
1513  stream.writeStartElement("sigmas");
1514 
1515  // Set the label based of the coordinate type set for reports
1516  switch (coordType) {
1518  stream.writeAttribute("lat", toString(sigmaCoord1StatisticsRms()));
1519  stream.writeAttribute("lon", toString(sigmaCoord2StatisticsRms()));
1520  stream.writeAttribute("rad", toString(sigmaCoord3StatisticsRms()));
1521  break;
1523  stream.writeAttribute("x", toString(sigmaCoord1StatisticsRms()));
1524  stream.writeAttribute("y", toString(sigmaCoord2StatisticsRms()));
1525  stream.writeAttribute("z", toString(sigmaCoord3StatisticsRms()));
1526  break;
1527  default:
1528  IString msg ="Unknown surface point coordinate type enum [" + toString(coordType) + "]." ;
1529  throw IException(IException::Programmer, msg, _FILEINFO_);
1530  }
1531  stream.writeEndElement(); // end sigmas element
1532 
1533  stream.writeStartElement("imageResidualsLists");
1534  stream.writeStartElement("residualsList");
1535  stream.writeAttribute("listSize", toString(rmsImageResiduals().size()));
1536  for (int i = 0; i < m_rmsImageResiduals.size(); i++) {
1537  stream.writeStartElement("statisticsItem");
1538  m_rmsImageResiduals[i].save(stream, project);
1539  stream.writeEndElement(); // end statistics item
1540  }
1541  stream.writeEndElement(); // end residuals list
1542  stream.writeStartElement("sampleList");
1543  stream.writeAttribute("listSize", toString(rmsImageSampleResiduals().size()));
1544  for (int i = 0; i < m_rmsImageSampleResiduals.size(); i++) {
1545  stream.writeStartElement("statisticsItem");
1546  m_rmsImageSampleResiduals[i].save(stream, project);
1547  stream.writeEndElement(); // end statistics item
1548  }
1549  stream.writeEndElement(); // end sample residuals list
1550 
1551  stream.writeStartElement("lineList");
1552  stream.writeAttribute("listSize", toString(rmsImageLineResiduals().size()));
1553  for (int i = 0; i < m_rmsImageLineResiduals.size(); i++) {
1554  stream.writeStartElement("statisticsItem");
1555  m_rmsImageLineResiduals[i].save(stream, project);
1556  stream.writeEndElement(); // end statistics item
1557  }
1558  stream.writeEndElement(); // end line residuals list
1559  stream.writeEndElement(); // end image residuals lists
1560 
1561  stream.writeStartElement("imageSigmasLists");
1562  stream.writeStartElement("xSigmas");
1563  stream.writeAttribute("listSize", toString(rmsImageXSigmas().size()));
1564  for (int i = 0; i < m_rmsImageXSigmas.size(); i++) {
1565  stream.writeStartElement("statisticsItem");
1566  m_rmsImageXSigmas[i].save(stream, project);
1567  stream.writeEndElement(); // end statistics item
1568  }
1569 
1570  stream.writeEndElement(); // end x sigma list
1571 
1572  stream.writeStartElement("ySigmas");
1573  stream.writeAttribute("listSize", toString(rmsImageYSigmas().size()));
1574  for (int i = 0; i < m_rmsImageYSigmas.size(); i++) {
1575  stream.writeStartElement("statisticsItem");
1576  m_rmsImageYSigmas[i].save(stream, project);
1577  stream.writeEndElement(); // end statistics item
1578  }
1579  stream.writeEndElement(); // end y sigma list
1580 
1581  stream.writeStartElement("zSigmas");
1582  stream.writeAttribute("listSize", toString(rmsImageZSigmas().size()));
1583  for (int i = 0; i < m_rmsImageZSigmas.size(); i++) {
1584  stream.writeStartElement("statisticsItem");
1585  m_rmsImageZSigmas[i].save(stream, project);
1586  stream.writeEndElement(); // end statistics item
1587  }
1588  stream.writeEndElement(); // end z sigma list
1589 
1590  stream.writeStartElement("raSigmas");
1591  stream.writeAttribute("listSize", toString(rmsImageRASigmas().size()));
1592  for (int i = 0; i < m_rmsImageRASigmas.size(); i++) {
1593  stream.writeStartElement("statisticsItem");
1594  m_rmsImageRASigmas[i].save(stream, project);
1595  stream.writeEndElement(); // end statistics item
1596  }
1597  stream.writeEndElement(); // end ra sigma list
1598 
1599  stream.writeStartElement("decSigmas");
1600  stream.writeAttribute("listSize", toString(rmsImageDECSigmas().size()));
1601  for (int i = 0; i < m_rmsImageDECSigmas.size(); i++) {
1602  stream.writeStartElement("statisticsItem");
1603  m_rmsImageDECSigmas[i].save(stream, project);
1604  stream.writeEndElement(); // end statistics item
1605  }
1606  stream.writeEndElement(); // end dec sigma list
1607 
1608  stream.writeStartElement("twistSigmas");
1609  stream.writeAttribute("listSize", toString(rmsImageTWISTSigmas().size()));
1610  for (int i = 0; i < m_rmsImageTWISTSigmas.size(); i++) {
1611  stream.writeStartElement("statisticsItem");
1612  m_rmsImageTWISTSigmas[i].save(stream, project);
1613  stream.writeEndElement(); // end statistics item
1614  }
1615  stream.writeEndElement(); // end twist sigma list
1616  stream.writeEndElement(); // end sigmas lists
1617  stream.writeEndElement(); // end rms
1618 
1619  stream.writeStartElement("elapsedTime");
1620  stream.writeAttribute("time", toString(elapsedTime()));
1621  stream.writeAttribute("errorProp", toString(elapsedTimeErrorProp()));
1622  stream.writeEndElement(); // end elapsed time
1623 
1624  stream.writeStartElement("minMaxSigmas");
1625 
1626  // Write the labels corresponding to the coordinate type set for reports
1627  switch (coordType) {
1629  stream.writeStartElement("minLat");
1630  stream.writeAttribute("value", toString(minSigmaCoord1Distance().meters()));
1631  stream.writeAttribute("pointId", minSigmaCoord1PointId());
1632  stream.writeEndElement();
1633  stream.writeStartElement("maxLat");
1634  stream.writeAttribute("value", toString(maxSigmaCoord1Distance().meters()));
1635  stream.writeAttribute("pointId", maxSigmaCoord1PointId());
1636  stream.writeEndElement();
1637  stream.writeStartElement("minLon");
1638  stream.writeAttribute("value", toString(minSigmaCoord2Distance().meters()));
1639  stream.writeAttribute("pointId", minSigmaCoord2PointId());
1640  stream.writeEndElement();
1641  stream.writeStartElement("maxLon");
1642  stream.writeAttribute("value", toString(maxSigmaCoord2Distance().meters()));
1643  stream.writeAttribute("pointId", maxSigmaCoord2PointId());
1644  stream.writeEndElement();
1645  stream.writeStartElement("minRad");
1646  stream.writeAttribute("value", toString(minSigmaCoord3Distance().meters()));
1647  stream.writeAttribute("pointId", minSigmaCoord3PointId());
1648  stream.writeEndElement();
1649  stream.writeStartElement("maxRad");
1650  stream.writeAttribute("value", toString(maxSigmaCoord3Distance().meters()));
1651  stream.writeAttribute("pointId", maxSigmaCoord3PointId());
1652  stream.writeEndElement();
1653  break;
1655  stream.writeStartElement("minX");
1656  stream.writeAttribute("value", toString(minSigmaCoord1Distance().meters()));
1657  stream.writeAttribute("pointId", minSigmaCoord1PointId());
1658  stream.writeEndElement();
1659  stream.writeStartElement("maxX");
1660  stream.writeAttribute("value", toString(maxSigmaCoord1Distance().meters()));
1661  stream.writeAttribute("pointId", maxSigmaCoord1PointId());
1662  stream.writeEndElement();
1663  stream.writeStartElement("minY");
1664  stream.writeAttribute("value", toString(minSigmaCoord2Distance().meters()));
1665  stream.writeAttribute("pointId", minSigmaCoord2PointId());
1666  stream.writeEndElement();
1667  stream.writeStartElement("maxY");
1668  stream.writeAttribute("value", toString(maxSigmaCoord2Distance().meters()));
1669  stream.writeAttribute("pointId", maxSigmaCoord2PointId());
1670  stream.writeEndElement();
1671  stream.writeStartElement("minZ");
1672  stream.writeAttribute("value", toString(minSigmaCoord3Distance().meters()));
1673  stream.writeAttribute("pointId", minSigmaCoord3PointId());
1674  stream.writeEndElement();
1675  stream.writeStartElement("maxZ");
1676  stream.writeAttribute("value", toString(maxSigmaCoord3Distance().meters()));
1677  stream.writeAttribute("pointId", maxSigmaCoord3PointId());
1678  stream.writeEndElement();
1679  break;
1680  default:
1681  IString msg ="Unknown surface point coordinate type enum [" + toString(coordType) + "]." ;
1682  throw IException(IException::Programmer, msg, _FILEINFO_);
1683  }
1684  stream.writeEndElement(); // end minMaxSigmas
1685 
1686  // call max likelihood setup from startElement to fill the rest of these values...
1687  stream.writeStartElement("maximumLikelihoodEstimation");
1688  stream.writeAttribute("numberModels", toString(numberMaximumLikelihoodModels()));
1689  stream.writeAttribute("maximumLikelihoodIndex", toString(maximumLikelihoodModelIndex()));
1690  stream.writeAttribute("maximumLikelihoodMedianR2Residuals",
1692 
1693  stream.writeStartElement("cumulativeProbabilityCalculator");
1694  // cumulativeProbabilityDistribution().save(stream, project);
1695  stream.writeEndElement(); // end cumulativeProbabilityCalculator
1696 
1697  stream.writeStartElement("residualsCumulativeProbabilityCalculator");
1698  // residualsCumulativeProbabilityDistribution().save(stream, project);
1699  stream.writeEndElement(); // end residualsCumulativeProbabilityCalculator
1700 
1701  for (int i = 0; i < numberMaximumLikelihoodModels(); i++) {
1702  stream.writeStartElement("model");
1703  stream.writeAttribute("modelNumber", toString(i+1));
1704  stream.writeAttribute("modelSelection",
1706  stream.writeAttribute("tweakingConstant",
1707  toString(m_maximumLikelihoodFunctions[i].first.tweakingConstant()));
1708  stream.writeAttribute("quantile", toString(m_maximumLikelihoodFunctions[i].second));
1709  stream.writeEndElement(); // end this model
1710  }
1711  stream.writeEndElement(); // end maximumLikelihoodEstimation
1712  stream.writeEndElement(); // end bundleResults
1713  }
1714 
1715 
1723  // TODO: does xml stuff need project???
1724  m_xmlHandlerCumProCalc = NULL;
1725  m_xmlHandlerBundleResults = NULL;
1726  m_xmlHandlerProject = NULL;
1727 
1728  m_xmlHandlerBundleResults = statistics;
1729  m_xmlHandlerProject = project; // TODO: does xml stuff need project???
1730  m_xmlHandlerCharacters = "";
1731 
1732  m_xmlHandlerResidualsListSize = 0;
1733  m_xmlHandlerSampleResidualsListSize = 0;
1734  m_xmlHandlerLineResidualsListSize = 0;
1735  m_xmlHandlerXSigmasListSize = 0;
1736  m_xmlHandlerYSigmasListSize = 0;
1737  m_xmlHandlerZSigmasListSize = 0;
1738  m_xmlHandlerRASigmasListSize = 0;
1739  m_xmlHandlerDECSigmasListSize = 0;
1740  m_xmlHandlerTWISTSigmasListSize = 0;
1741  m_xmlHandlerStatisticsList.clear();
1742 
1743  }
1744 
1745 
1750  // do not delete this pointer... we don't own it, do we???
1751  // passed into StatCumProbDistDynCalc constructor as pointer
1752  // delete m_xmlHandlerProject; // TODO: does xml stuff need project???
1753  m_xmlHandlerProject = NULL;
1754 
1755  // delete m_xmlHandlerBundleResults;
1756  // m_xmlHandlerBundleResults = NULL;
1757 
1758  }
1759 
1760 
1772  bool BundleResults::XmlHandler::startElement(const QString &namespaceURI,
1773  const QString &localName,
1774  const QString &qName,
1775  const QXmlAttributes &atts) {
1776  m_xmlHandlerCharacters = "";
1777 
1778  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
1779 
1780  if (qName == "correlationMatrix") {
1781  m_xmlHandlerBundleResults->m_correlationMatrix = NULL;
1782  m_xmlHandlerBundleResults->m_correlationMatrix = new CorrelationMatrix();
1783 
1784  QString correlationFileName = atts.value("correlationFileName");
1785  if (!correlationFileName.isEmpty()) {
1786  FileName correlationFile(correlationFileName);
1787  m_xmlHandlerBundleResults->m_correlationMatrix->setCorrelationFileName(correlationFile);
1788  }
1789 
1790  QString covarianceFileName = atts.value("covarianceFileName");
1791  if (!covarianceFileName.isEmpty()) {
1792  FileName covarianceFile(covarianceFileName);
1793  m_xmlHandlerBundleResults->m_correlationMatrix->setCovarianceFileName(covarianceFile);
1794  }
1795  }
1796  else if (qName == "image") {
1797  QString correlationMatrixImageId = atts.value("id");
1798  if (!correlationMatrixImageId.isEmpty()) {
1799  m_xmlHandlerCorrelationImageId = correlationMatrixImageId;
1800  }
1801  }
1802  else if (qName == "residuals") {
1803  QString rx = atts.value("x");
1804  if (!rx.isEmpty()) {
1805  m_xmlHandlerBundleResults->m_rmsXResiduals = toDouble(rx);
1806  }
1807 
1808  QString ry = atts.value("y");
1809  if (!ry.isEmpty()) {
1810  m_xmlHandlerBundleResults->m_rmsYResiduals = toDouble(ry);
1811  }
1812 
1813  QString rxy = atts.value("xy");
1814  if (!rxy.isEmpty()) {
1815  m_xmlHandlerBundleResults->m_rmsXYResiduals = toDouble(rxy);
1816  }
1817  }
1818  else if (qName == "sigmas") {
1819  QString lat = atts.value("lat");
1820  if (!lat.isEmpty()) {
1821  m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(lat);
1822  }
1823  QString lon = atts.value("lon");
1824  if (!lon.isEmpty()) {
1825  m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(lon);
1826  }
1827  QString rad = atts.value("rad");
1828  if (!rad.isEmpty()) {
1829  m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(rad);
1830  }
1831  QString x = atts.value("x");
1832  if (!x.isEmpty()) {
1833  m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(x);
1834  }
1835  QString y = atts.value("y");
1836  if (!y.isEmpty()) {
1837  m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(y);
1838  }
1839  QString z = atts.value("z");
1840  if (!z.isEmpty()) {
1841  m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(z);
1842  }
1843  }
1844  else if (qName == "residualsList") {
1845  QString listSizeStr = atts.value("listSize");
1846  if (!listSizeStr.isEmpty()) {
1847  m_xmlHandlerResidualsListSize = toInt(listSizeStr);
1848  }
1849  }
1850  else if (qName == "sampleList") {
1851  QString listSizeStr = atts.value("listSize");
1852  if (!listSizeStr.isEmpty()) {
1853  m_xmlHandlerSampleResidualsListSize = toInt(listSizeStr);
1854  }
1855  }
1856  else if (qName == "lineList") {
1857  QString listSizeStr = atts.value("listSize");
1858  if (!listSizeStr.isEmpty()) {
1859  m_xmlHandlerLineResidualsListSize = toInt(listSizeStr);
1860  }
1861  }
1862  else if (qName == "xSigmas") {
1863  QString listSizeStr = atts.value("listSize");
1864  if (!listSizeStr.isEmpty()) {
1865  m_xmlHandlerXSigmasListSize = toInt(listSizeStr);
1866  }
1867  }
1868  else if (qName == "ySigmas") {
1869  QString listSizeStr = atts.value("listSize");
1870  if (!listSizeStr.isEmpty()) {
1871  m_xmlHandlerYSigmasListSize = toInt(listSizeStr);
1872  }
1873  }
1874  else if (qName == "zSigmas") {
1875  QString listSizeStr = atts.value("listSize");
1876  if (!listSizeStr.isEmpty()) {
1877  m_xmlHandlerZSigmasListSize = toInt(listSizeStr);
1878  }
1879  }
1880  else if (qName == "raSigmas") {
1881  QString listSizeStr = atts.value("listSize");
1882  if (!listSizeStr.isEmpty()) {
1883  m_xmlHandlerRASigmasListSize = toInt(listSizeStr);
1884  }
1885 
1886  }
1887  else if (qName == "decSigmas") {
1888  QString listSizeStr = atts.value("listSize");
1889  if (!listSizeStr.isEmpty()) {
1890  m_xmlHandlerDECSigmasListSize = toInt(listSizeStr);
1891  }
1892  }
1893  else if (qName == "twistSigmas") {
1894  QString listSizeStr = atts.value("listSize");
1895  if (!listSizeStr.isEmpty()) {
1896  m_xmlHandlerTWISTSigmasListSize = toInt(listSizeStr);
1897  }
1898  }
1899  else if (qName == "statisticsItem") {
1900  // add statistics object to the xml handler's current statistics list.
1901  m_xmlHandlerStatisticsList.append(
1902  new Statistics(m_xmlHandlerProject, reader()));
1903  }
1904  else if (qName == "elapsedTime") {
1905  QString time = atts.value("time");
1906  if (!time.isEmpty()) {
1907  m_xmlHandlerBundleResults->m_elapsedTime = toDouble(time);
1908  }
1909 
1910  QString errorProp = atts.value("errorProp");
1911  if (!errorProp.isEmpty()) {
1912  m_xmlHandlerBundleResults->m_elapsedTimeErrorProp = toDouble(errorProp);
1913  }
1914 
1915  }
1916 // ??? else if (qName == "minMaxSigmaDistances") {
1917 // ??? QString units = atts.value("units");
1918 // ??? if (!QString::compare(units, "meters", Qt::CaseInsensitive)) {
1919 // ??? QString msg = "Unable to read BundleResults xml. Sigma distances must be "
1920 // ??? "provided in meters.";
1921 // ??? throw IException(IException::Io, msg, _FILEINFO_);
1922 // ??? }
1923 // ??? }
1924  else if (qName == "minLat") {
1925  QString minLat = atts.value("value");
1926  if (!minLat.isEmpty()) {
1927  m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minLat));
1928  }
1929 
1930  QString minLatPointId = atts.value("pointId");
1931  if (!minLatPointId.isEmpty()) {
1932  m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minLatPointId;
1933  }
1934 
1935  }
1936  else if (qName == "minX") {
1937  QString minX = atts.value("value");
1938  if (!minX.isEmpty()) {
1939  m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minX));
1940  }
1941 
1942  QString minXPointId = atts.value("pointId");
1943  if (!minXPointId.isEmpty()) {
1944  m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minXPointId;
1945  }
1946  }
1947  else if (qName == "maxLat") {
1948  QString maxLat = atts.value("value");
1949  if (!maxLat.isEmpty()) {
1950  m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxLat));
1951  }
1952 
1953  QString maxLatPointId = atts.value("pointId");
1954  if (!maxLatPointId.isEmpty()) {
1955  m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxLatPointId;
1956  }
1957 
1958  }
1959  else if (qName == "maxX") {
1960 
1961  QString maxX = atts.value("value");
1962  if (!maxX.isEmpty()) {
1963  m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxX));
1964  }
1965 
1966  QString maxXPointId = atts.value("pointId");
1967  if (!maxXPointId.isEmpty()) {
1968  m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxXPointId;
1969  }
1970 
1971  }
1972  else if (qName == "minLon") {
1973 
1974  QString minLon = atts.value("value");
1975  if (!minLon.isEmpty()) {
1976  m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minLon));
1977  }
1978 
1979  QString minLonPointId = atts.value("pointId");
1980  if (!minLonPointId.isEmpty()) {
1981  m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minLonPointId;
1982  }
1983 
1984  }
1985  else if (qName == "minY") {
1986 
1987  QString minY = atts.value("value");
1988  if (!minY.isEmpty()) {
1989  m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minY));
1990  }
1991 
1992  QString minYPointId = atts.value("pointId");
1993  if (!minYPointId.isEmpty()) {
1994  m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minYPointId;
1995  }
1996 
1997  }
1998  else if (qName == "maxLon") {
1999 
2000  QString maxLon = atts.value("value");
2001  if (!maxLon.isEmpty()) {
2002  m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxLon));
2003  }
2004 
2005  QString maxLonPointId = atts.value("pointId");
2006  if (!maxLonPointId.isEmpty()) {
2007  m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxLonPointId;
2008  }
2009 
2010  }
2011  else if (qName == "maxY") {
2012  QString maxY = atts.value("value");
2013  if (!maxY.isEmpty()) {
2014  m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxY));
2015  }
2016 
2017  QString maxYPointId = atts.value("pointId");
2018  if (!maxYPointId.isEmpty()) {
2019  m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxYPointId;
2020  }
2021 
2022  }
2023  else if (qName == "minRad") {
2024 
2025  QString minRad = atts.value("value");
2026  if (!minRad.isEmpty()) {
2027  m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minRad));
2028  }
2029 
2030  QString minRadPointId = atts.value("pointId");
2031  if (!minRadPointId.isEmpty()) {
2032  m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minRadPointId;
2033  }
2034 
2035  }
2036  else if (qName == "minZ") {
2037 
2038  QString minZ = atts.value("value");
2039  if (!minZ.isEmpty()) {
2040  m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minZ));
2041  }
2042 
2043  QString minZPointId = atts.value("pointId");
2044  if (!minZPointId.isEmpty()) {
2045  m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minZPointId;
2046  }
2047 
2048  }
2049  else if (qName == "maxRad") {
2050 
2051  QString maxRad = atts.value("value");
2052  if (!maxRad.isEmpty()) {
2053  m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxRad));
2054  }
2055 
2056  QString maxRadPointId = atts.value("pointId");
2057  if (!maxRadPointId.isEmpty()) {
2058  m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxRadPointId;
2059  }
2060 
2061  }
2062  else if (qName == "maxZ") {
2063 
2064  QString maxZ = atts.value("value");
2065  if (!maxZ.isEmpty()) {
2066  m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxZ));
2067  }
2068 
2069  QString maxZPointId = atts.value("pointId");
2070  if (!maxZPointId.isEmpty()) {
2071  m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxZPointId;
2072  }
2073 
2074  }
2075  else if (qName == "maximumLikelihoodEstimation") {
2076  QString maximumLikelihoodIndex = atts.value("maximumLikelihoodIndex");
2077  if (!maximumLikelihoodIndex.isEmpty()) {
2078  m_xmlHandlerBundleResults->m_maximumLikelihoodIndex = toInt(maximumLikelihoodIndex);
2079  }
2080 
2082  atts.value("maximumLikelihoodMedianR2Residuals");
2083  if (!maximumLikelihoodMedianR2Residuals.isEmpty()) {
2084  m_xmlHandlerBundleResults->m_maximumLikelihoodMedianR2Residuals =
2086  }
2087  }
2088  else if (qName == "model") {
2089  QString model = atts.value("modelSelection");
2090  QString tweakingConstant = atts.value("tweakingConstant");
2091  QString quantile = atts.value("quantile");
2092  bool validModel = true;
2093  if (model.isEmpty()) validModel = false;
2094  if (tweakingConstant.isEmpty()) validModel = false;
2095  if (quantile.isEmpty()) validModel = false;
2096  if (validModel) {
2097  m_xmlHandlerBundleResults->m_maximumLikelihoodFunctions.append(
2098  qMakePair(MaximumLikelihoodWFunctions(
2099  MaximumLikelihoodWFunctions::stringToModel(model),
2100  toDouble(tweakingConstant)),
2101  toDouble(quantile)));
2102  }
2103  }
2104  else if (qName == "cumulativeProbabilityCalculator") {
2105  m_xmlHandlerBundleResults->m_cumPro = NULL;
2106  m_xmlHandlerBundleResults->m_cumPro =
2107  new StatCumProbDistDynCalc(m_xmlHandlerProject, reader());
2108  }
2109  else if (qName == "residualsCumulativeProbabilityCalculator") {
2110  m_xmlHandlerBundleResults->m_cumProRes = NULL;
2111  m_xmlHandlerBundleResults->m_cumProRes = new StatCumProbDistDynCalc(m_xmlHandlerProject,
2112  reader());
2113  }
2114  }
2115  return true;
2116  }
2117 
2118 
2126  bool BundleResults::XmlHandler::characters(const QString &ch) {
2127  m_xmlHandlerCharacters += ch;
2128  return XmlStackedHandler::characters(ch);
2129  }
2130 
2131 
2141  bool BundleResults::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
2142  const QString &qName) {
2143 
2144  if (!m_xmlHandlerCharacters.isEmpty()) {
2145  if (qName == "parameter") {
2146  // add the parameter to the current list
2147  m_xmlHandlerCorrelationParameterList.append(m_xmlHandlerCharacters);
2148  }
2149  if (qName == "image") {
2150  // add this image and its parameters to the map
2151  if (m_xmlHandlerCorrelationImageId != "") {
2152  m_xmlHandlerCorrelationMap.insert(m_xmlHandlerCorrelationImageId,
2153  m_xmlHandlerCorrelationParameterList);
2154  }
2155  m_xmlHandlerCorrelationImageId = "";
2156  m_xmlHandlerCorrelationParameterList.clear();
2157 
2158  }
2159  if (qName == "imagesAndParameters") {
2160  // set the map after all images and parameters have been added
2161  if (!m_xmlHandlerCorrelationMap.isEmpty()) {
2162  m_xmlHandlerBundleResults->setCorrMatImgsAndParams(m_xmlHandlerCorrelationMap);
2163  }
2164  }
2165  else if (qName == "numberFixedPoints") {
2166  m_xmlHandlerBundleResults->m_numberFixedPoints = toInt(m_xmlHandlerCharacters);
2167  }
2168  else if (qName == "numberIgnoredPoints") {
2169  m_xmlHandlerBundleResults->m_numberIgnoredPoints = toInt(m_xmlHandlerCharacters);
2170  }
2171  else if (qName == "numberHeldImages") {
2172  m_xmlHandlerBundleResults->m_numberHeldImages = toInt(m_xmlHandlerCharacters);
2173  }
2174  else if (qName == "rejectionLimit") {
2175  m_xmlHandlerBundleResults->m_rejectionLimit = toDouble(m_xmlHandlerCharacters);
2176  }
2177  else if (qName == "numberRejectedObservations") {
2178  m_xmlHandlerBundleResults->m_numberRejectedObservations = toInt(m_xmlHandlerCharacters);
2179  }
2180  else if (qName == "numberObservations") {
2181  m_xmlHandlerBundleResults->m_numberObservations = toInt(m_xmlHandlerCharacters);
2182  }
2183  else if (qName == "numberImageParameters") {
2184  m_xmlHandlerBundleResults->m_numberImageParameters = toInt(m_xmlHandlerCharacters);
2185  }
2186  else if (qName == "numberConstrainedPointParameters") {
2187  m_xmlHandlerBundleResults->m_numberConstrainedPointParameters =
2188  toInt(m_xmlHandlerCharacters);
2189  }
2190  else if (qName == "numberConstrainedImageParameters") {
2191  m_xmlHandlerBundleResults->m_numberConstrainedImageParameters =
2192  toInt(m_xmlHandlerCharacters);
2193  }
2194  else if (qName == "numberConstrainedTargetParameters") {
2195  m_xmlHandlerBundleResults->m_numberConstrainedTargetParameters =
2196  toInt(m_xmlHandlerCharacters);
2197  }
2198  else if (qName == "numberUnknownParameters") {
2199  m_xmlHandlerBundleResults->m_numberUnknownParameters = toInt(m_xmlHandlerCharacters);
2200  }
2201  else if (qName == "degreesOfFreedom") {
2202  m_xmlHandlerBundleResults->m_degreesOfFreedom = toInt(m_xmlHandlerCharacters);
2203  }
2204  else if (qName == "sigma0") {
2205  m_xmlHandlerBundleResults->m_sigma0 = toDouble(m_xmlHandlerCharacters);
2206  }
2207  else if (qName == "converged") {
2208  m_xmlHandlerBundleResults->m_converged = toBool(m_xmlHandlerCharacters);
2209  }
2210  // copy the xml handler's statistics list to the appropriate bundle statistics list
2211  else if (qName == "residualsList") {
2212  if (m_xmlHandlerResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2214  "Unable to read xml file. Invalid residualsList", _FILEINFO_);
2215  }
2216  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2217  m_xmlHandlerBundleResults->m_rmsImageResiduals.append(m_xmlHandlerStatisticsList[i]);
2218  }
2219  m_xmlHandlerStatisticsList.clear();
2220  }
2221  else if (qName == "sampleList") {
2222  if (m_xmlHandlerSampleResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2224  "Unable to read xml file. Invalid sampleList", _FILEINFO_);
2225  }
2226  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2227  m_xmlHandlerBundleResults->m_rmsImageSampleResiduals.append(
2228  m_xmlHandlerStatisticsList[i]);
2229  }
2230  m_xmlHandlerStatisticsList.clear();
2231  }
2232  else if (qName == "lineList") {
2233  if (m_xmlHandlerLineResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2235  "Unable to read xml file. Invalid lineList", _FILEINFO_);
2236  }
2237  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2238  m_xmlHandlerBundleResults->m_rmsImageLineResiduals.append(m_xmlHandlerStatisticsList[i]);
2239  }
2240  m_xmlHandlerStatisticsList.clear();
2241  }
2242  else if (qName == "xSigmas") {
2243  if (m_xmlHandlerXSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2245  "Unable to read xml file. Invalid xSigmas", _FILEINFO_);
2246  }
2247  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2248  m_xmlHandlerBundleResults->m_rmsImageXSigmas.append(m_xmlHandlerStatisticsList[i]);
2249  }
2250  m_xmlHandlerStatisticsList.clear();
2251  }
2252  else if (qName == "ySigmas") {
2253  if (m_xmlHandlerYSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2255  "Unable to read xml file. Invalid ySigmas", _FILEINFO_);
2256  }
2257  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2258  m_xmlHandlerBundleResults->m_rmsImageYSigmas.append(m_xmlHandlerStatisticsList[i]);
2259  }
2260  m_xmlHandlerStatisticsList.clear();
2261  }
2262  else if (qName == "zSigmas") {
2263  if (m_xmlHandlerZSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2265  "Unable to read xml file. Invalid zSigmas", _FILEINFO_);
2266  }
2267  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2268  m_xmlHandlerBundleResults->m_rmsImageZSigmas.append(m_xmlHandlerStatisticsList[i]);
2269  }
2270  m_xmlHandlerStatisticsList.clear();
2271  }
2272  else if (qName == "raSigmas") {
2273  if (m_xmlHandlerRASigmasListSize != m_xmlHandlerStatisticsList.size()) {
2275  "Unable to read xml file. Invalid raSigmas", _FILEINFO_);
2276  }
2277  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2278  m_xmlHandlerBundleResults->m_rmsImageRASigmas.append(m_xmlHandlerStatisticsList[i]);
2279  }
2280  m_xmlHandlerStatisticsList.clear();
2281  }
2282  else if (qName == "decSigmas") {
2283  if (m_xmlHandlerDECSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2285  "Unable to read xml file. Invalid decSigmas", _FILEINFO_);
2286  }
2287  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2288  m_xmlHandlerBundleResults->m_rmsImageDECSigmas.append(m_xmlHandlerStatisticsList[i]);
2289  }
2290  m_xmlHandlerStatisticsList.clear();
2291  }
2292  else if (qName == "twistSigmas") {
2293  if (m_xmlHandlerTWISTSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2295  "Unable to read xml file. Invalid twistSigmas", _FILEINFO_);
2296  }
2297  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2298  m_xmlHandlerBundleResults->m_rmsImageTWISTSigmas.append(m_xmlHandlerStatisticsList[i]);
2299  }
2300  m_xmlHandlerStatisticsList.clear();
2301  }
2302  }
2303  m_xmlHandlerCharacters = "";
2304  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
2305  }
2306 }
Isis::BundleResults::maximumLikelihoodMedianR2Residuals
double maximumLikelihoodMedianR2Residuals() const
Returns the median of the |R^2 residuals|.
Definition: BundleResults.cpp:1363
Isis::BundleResults::minSigmaCoord2PointId
QString minSigmaCoord2PointId() const
Returns the minimum sigma point id for coordinate 2.
Definition: BundleResults.cpp:1045
Isis::BundleResults::XmlHandler
This class is an XmlHandler used to read and write BundleResults objects from and to XML files.
Definition: BundleResults.h:252
Isis::BundleResults::numberUnknownParameters
int numberUnknownParameters() const
Returns the number of unknown parameters.
Definition: BundleResults.cpp:1215
Isis::BundleResults::numberConstrainedPointParameters
int numberConstrainedPointParameters() const
Returns the number of constrained point parameters.
Definition: BundleResults.cpp:1185
Isis::BundleResults::iterations
int iterations() const
Returns the number of iterations taken by the BundleAdjust.
Definition: BundleResults.cpp:1302
Isis::BundleSettings::ParameterCorrections
@ ParameterCorrections
All parameter corrections will be used to determine that the bundle adjustment has converged.
Definition: BundleSettings.h:200
Isis::BundleResults::maxSigmaCoord2PointId
QString maxSigmaCoord2PointId() const
Returns the maximum sigma point id for coordinate 2.
Definition: BundleResults.cpp:1055
Isis::BundleResults::XmlHandler::endElement
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle end tags for the BundleResults serialized XML.
Definition: BundleResults.cpp:2141
Isis::BundleResults::m_rmsYResiduals
double m_rmsYResiduals
rms of y residuals
Definition: BundleResults.h:296
Isis::BundleResults::m_correlationMatrix
CorrelationMatrix * m_correlationMatrix
The correlation matrix from the BundleAdjust.
Definition: BundleResults.h:287
Isis::BundleResults::incrementNumberConstrainedTargetParameters
void incrementNumberConstrainedTargetParameters(int incrementAmount)
Increases the number of constrained target parameters.
Definition: BundleResults.cpp:720
Isis::BundleResults::converged
bool converged() const
Returns whether or not the bundle adjustment converged.
Definition: BundleResults.cpp:1265
Isis::Statistics
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:94
Isis::IException::Io
@ Io
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:155
Isis::BundleResults::maximumLikelihoodModelWFunc
MaximumLikelihoodWFunctions maximumLikelihoodModelWFunc(int modelIndex) const
Returns the maximum likelihood model at the given index.
Definition: BundleResults.cpp:1375
Isis::BundleResults::numberConstrainedImageParameters
int numberConstrainedImageParameters() const
Returns the number of constrained image parameters.
Definition: BundleResults.cpp:1195
Isis::BundleResults::m_maxSigmaCoord1Distance
Distance m_maxSigmaCoord1Distance
The maximum sigma latitude distance.
Definition: BundleResults.h:357
Isis::BundleResults::numberObservations
int numberObservations() const
Returns the number of observations.
Definition: BundleResults.cpp:1165
Isis::BundleResults::printMaximumLikelihoodTierInformation
void printMaximumLikelihoodTierInformation()
Prints out information about which tier the solution is in and the status of the residuals.
Definition: BundleResults.cpp:492
Isis::BundleResults::resetNumberConstrainedImageParameters
void resetNumberConstrainedImageParameters()
Resets the number of constrained image parameters to 0.
Definition: BundleResults.cpp:692
QList
This is free and unencumbered software released into the public domain.
Definition: BoxcarCachingAlgorithm.h:13
Isis::BundleResults::setSigmaCoord2Range
void setSigmaCoord2Range(Distance minCoord2Dist, Distance maxCoord2Dist, QString minCoord2PointId, QString maxCoord2PointId)
Sets the min and max sigma distances and point ids for coordinate 2.
Definition: BundleResults.cpp:400
Isis::BundleResults::maxSigmaCoord3Distance
Distance maxSigmaCoord3Distance() const
Returns the maximum sigma distance for coordinate 3.
Definition: BundleResults.cpp:1015
Project.h
Isis::BundleResults::m_maximumLikelihoodIndex
int m_maximumLikelihoodIndex
This count keeps track of which stage of the maximum likelihood adjustment the bundle is currently on...
Definition: BundleResults.h:392
Isis::BundleResults::m_rmsImageZSigmas
QVector< Statistics > m_rmsImageZSigmas
< The root mean square image z sigmas.
Definition: BundleResults.h:348
Isis::BundleResults::m_numberObservations
int m_numberObservations
number of image coordinate observations
Definition: BundleResults.h:301
Isis::BundleResults::setOutputControlNet
void setOutputControlNet(ControlNetQsp outNet)
Sets the output ControlNet.
Definition: BundleResults.cpp:842
Isis::BundleResults::m_rmsImageTWISTSigmas
QVector< Statistics > m_rmsImageTWISTSigmas
< The root mean square image twist sigmas.
Definition: BundleResults.h:354
Isis::BundleResults::rmsImageResiduals
QList< Statistics > rmsImageResiduals() const
Returns the list of RMS image residuals statistics.
Definition: BundleResults.cpp:895
Isis::CorrelationMatrix::setImagesAndParameters
void setImagesAndParameters(QMap< QString, QStringList > imagesAndParameters)
Set the qmap of images and parameters.
Definition: CorrelationMatrix.cpp:381
Isis::BundleResults::sigmaCoord1StatisticsRms
double sigmaCoord1StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 1.
Definition: BundleResults.cpp:1085
Isis::BundleResults::setSigma0
void setSigma0(double sigma0)
Sets the sigma0.
Definition: BundleResults.cpp:792
Isis::BundleResults::m_numberConstrainedPointParameters
int m_numberConstrainedPointParameters
number of constrained point parameters
Definition: BundleResults.h:306
Isis::BundleResults::m_numberRejectedObservations
int m_numberRejectedObservations
number of rejected image coordinate observations
Definition: BundleResults.h:302
Isis::BundleResults::operator=
BundleResults & operator=(const BundleResults &src)
Assignment operator for BundleResults.
Definition: BundleResults.cpp:169
Isis::FileName
File name manipulation and expansion.
Definition: FileName.h:100
Isis::BundleResults::m_cumPro
StatCumProbDistDynCalc * m_cumPro
This class will be used to calculate the cumulative probability distribution of |R^2 residuals|,...
Definition: BundleResults.h:395
Isis::BundleResults::m_numberConstrainedTargetParameters
int m_numberConstrainedTargetParameters
number of constrained target parameters
Definition: BundleResults.h:307
Isis::BundleResults::elapsedTimeErrorProp
double elapsedTimeErrorProp() const
Returns the elapsed time for error propagation.
Definition: BundleResults.cpp:1255
Isis::BundleResults::m_maxSigmaCoord3PointId
QString m_maxSigmaCoord3PointId
The maximum sigma coordinate 3 point id.
Definition: BundleResults.h:368
Isis::BundleResults::m_maximumLikelihoodMedianR2Residuals
double m_maximumLikelihoodMedianR2Residuals
Median of R^2 residuals.
Definition: BundleResults.h:404
Isis::IException::Unknown
@ Unknown
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:118
Isis::XmlStackedHandlerReader::pushContentHandler
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
Definition: XmlStackedHandlerReader.cpp:55
Isis::BundleResults::numberIgnoredPoints
int numberIgnoredPoints() const
Returns the number of ignored points.
Definition: BundleResults.cpp:612
Isis::BundleResults::m_minSigmaCoord3PointId
QString m_minSigmaCoord3PointId
The minimum sigma coordinate 3 point id.
Definition: BundleResults.h:367
Isis::BundleResults::m_minSigmaCoord2PointId
QString m_minSigmaCoord2PointId
The minimum sigma coordinate 2 point id.
Definition: BundleResults.h:365
Isis::BundleResults::rmsImageTWISTSigmas
QVector< Statistics > rmsImageTWISTSigmas() const
Returns the list of RMS image twist sigma statistics.
Definition: BundleResults.cpp:955
Isis::BundleResults::initializeProbabilityDistribution
void initializeProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of |R^2 residuals|.
Definition: BundleResults.cpp:517
Isis::BundleResults::minSigmaCoord1PointId
QString minSigmaCoord1PointId() const
Returns the minimum sigma point id for coordinate 1.
Definition: BundleResults.cpp:1025
Isis::BundleResults::setConverged
void setConverged(bool converged)
Sets if the bundle adjustment converged.
Definition: BundleResults.cpp:822
Isis::BundleResults::numberFixedPoints
int numberFixedPoints() const
Returns the number of 'fixed' (ground) points.
Definition: BundleResults.cpp:576
Isis::BundleResults::setIterations
void setIterations(int iterations)
Sets the number of iterations taken by the BundleAdjust.
Definition: BundleResults.cpp:852
Isis::BundleResults::maxSigmaCoord1Distance
Distance maxSigmaCoord1Distance() const
Returns the maximum sigma distance for coordinate 1.
Definition: BundleResults.cpp:975
Isis::BundleResults::m_degreesOfFreedom
int m_degreesOfFreedom
degrees of freedom
Definition: BundleResults.h:308
Isis::BundleResults::numberImageParameters
int numberImageParameters() const
Returns the total number of image parameters.
Definition: BundleResults.cpp:1175
Isis::BundleResults::m_rmsImageRASigmas
QVector< Statistics > m_rmsImageRASigmas
< The root mean square image right ascension sigmas.
Definition: BundleResults.h:350
Isis::BundleResults::m_rmsSigmaCoord1Stats
double m_rmsSigmaCoord1Stats
rms of adjusted Latitude sigmas
Definition: BundleResults.h:370
Isis::BundleResults::minSigmaCoord3Distance
Distance minSigmaCoord3Distance() const
Returns the minimum sigma distance for coordinate 3.
Definition: BundleResults.cpp:1005
Isis::BundleResults::m_cumProRes
StatCumProbDistDynCalc * m_cumProRes
This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels)...
Definition: BundleResults.h:400
Isis::BundleResults::numberMaximumLikelihoodModels
int numberMaximumLikelihoodModels() const
Returns how many maximum likelihood models were used in the bundle adjustment.
Definition: BundleResults.cpp:1322
Isis::BundleResults::sigma0
double sigma0() const
Returns the Sigma0 of the bundle adjustment.
Definition: BundleResults.cpp:1235
Isis::BundleResults::rmsRxy
double rmsRxy() const
Returns the RMS of the x and y residuals.
Definition: BundleResults.cpp:1135
QSharedPointer< ControlNet >
Isis::BundleResults::m_numberImageParameters
int m_numberImageParameters
number of image parameters
Definition: BundleResults.h:304
Isis::BundleResults::XmlHandler::~XmlHandler
~XmlHandler()
Destroys an XmlHandler.
Definition: BundleResults.cpp:1749
Isis::BundleResults::bundleControlPoints
QVector< BundleControlPointQsp > & bundleControlPoints()
Returns a reference to the BundleControlPoint vector.
Definition: BundleResults.cpp:1275
Isis::BundleResults::m_observations
BundleObservationVector m_observations
The vector of BundleObservations from BundleAdjust.
Definition: BundleResults.h:328
Isis::BundleResults::rmsImageLineResiduals
QList< Statistics > rmsImageLineResiduals() const
Returns the list of RMS image line residuals statistics.
Definition: BundleResults.cpp:885
Isis::BundleResults::maximumLikelihoodModelIndex
int maximumLikelihoodModelIndex() const
Returns which step the bundle adjustment is on.
Definition: BundleResults.cpp:1332
QStringList
Isis::BundleResults::m_maxSigmaCoord3Distance
Distance m_maxSigmaCoord3Distance
The maximum sigma radius distance.
Definition: BundleResults.h:361
Isis::BundleResults::incrementNumberConstrainedImageParameters
void incrementNumberConstrainedImageParameters(int incrementAmount)
Increase the number of constrained image parameters.
Definition: BundleResults.cpp:702
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::CorrelationMatrix
This is a container for the correlation matrix that comes from a bundle adjust.
Definition: CorrelationMatrix.h:61
Isis::BundleResults::m_elapsedTimeErrorProp
double m_elapsedTimeErrorProp
elapsed time for error propagation
Definition: BundleResults.h:311
Isis::BundleResults::rmsImageYSigmas
QVector< Statistics > rmsImageYSigmas() const
Returns the list of RMS image y sigma statistics.
Definition: BundleResults.cpp:915
Isis::BundleResults::initialize
void initialize()
Initializes the BundleResults to a default state where all numeric members are set to 0 or another de...
Definition: BundleResults.cpp:245
Isis::BundleResults::m_numberIgnoredPoints
int m_numberIgnoredPoints
number of ignored points
Definition: BundleResults.h:291
Isis::BundleResults::cumulativeProbabilityDistribution
StatCumProbDistDynCalc cumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the |R^2 residuals|.
Definition: BundleResults.cpp:1343
Isis::BundleResults::elapsedTime
double elapsedTime() const
Returns the elapsed time for the bundle adjustment.
Definition: BundleResults.cpp:1245
Isis::BundleResults::rmsImageZSigmas
QVector< Statistics > rmsImageZSigmas() const
Returns the list of RMS image z sigma statistics.
Definition: BundleResults.cpp:925
Isis::Distance::setMeters
void setMeters(double distanceInMeters)
Set the distance in meters.
Definition: Distance.cpp:96
Isis::BundleResults::setNumberRejectedObservations
void setNumberRejectedObservations(int numberObservations)
Sets the number of rejected observations.
Definition: BundleResults.cpp:646
Isis::Distance
Distance measurement, usually in meters.
Definition: Distance.h:34
Isis::BundleResults::setRejectionLimit
void setRejectionLimit(double rejectionLimit)
Sets the rejection limit.
Definition: BundleResults.cpp:636
Isis::Project
The main project for ipce.
Definition: Project.h:289
Isis::BundleResults::setRmsFromSigmaStatistics
void setRmsFromSigmaStatistics(double rmsFromSigmaCoord1Stats, double rmsFromSigmaCoord2Stats, double rmsFromSigmaCoord3Stats)
Sets the root mean square values of the adjusted sigmas for all three coordinates.
Definition: BundleResults.cpp:433
Isis::BundleResults::degreesOfFreedom
int degreesOfFreedom() const
Returns the degrees of freedom.
Definition: BundleResults.cpp:1225
Isis::BundleResults::m_numberConstrainedImageParameters
int m_numberConstrainedImageParameters
number of constrained image parameters
Definition: BundleResults.h:305
Isis::BundleResults::rmsRx
double rmsRx() const
Returns the RMS of the x residuals.
Definition: BundleResults.cpp:1115
Isis::StatCumProbDistDynCalc
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
Definition: StatCumProbDistDynCalc.h:65
Isis::BundleResults::setBundleControlPoints
void setBundleControlPoints(QVector< BundleControlPointQsp > controlPoints)
Sets the bundle control point vector.
Definition: BundleResults.cpp:832
Isis::BundleResults::m_minSigmaCoord3Distance
Distance m_minSigmaCoord3Distance
The minimum sigma radius distance.
Definition: BundleResults.h:360
Isis::BundleResults::m_maxSigmaCoord1PointId
QString m_maxSigmaCoord1PointId
The maximum sigma coordinate 1 point id.
Definition: BundleResults.h:364
Isis::BundleResults::m_rmsImageResiduals
QList< Statistics > m_rmsImageResiduals
RMS image sample and line residual statistics for each image in the bundle
Definition: BundleResults.h:340
Isis::BundleResults::incrementFixedPoints
void incrementFixedPoints()
Increase the number of 'fixed' (ground) points.
Definition: BundleResults.cpp:566
Isis::BundleResults::observations
const BundleObservationVector & observations() const
Returns a reference to the observations used by the BundleAdjust.
Definition: BundleResults.cpp:1312
Isis::SurfacePoint::Rectangular
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
Definition: SurfacePoint.h:141
Isis::BundleResults::m_rmsXResiduals
double m_rmsXResiduals
rms of x residuals
Definition: BundleResults.h:295
Isis::BundleResults::resetNumberConstrainedPointParameters
void resetNumberConstrainedPointParameters()
Resets the number of contrained point parameters to 0.
Definition: BundleResults.cpp:674
Isis::BundleResults::setElapsedTime
void setElapsedTime(double time)
Sets the elapsed time for the bundle adjustment.
Definition: BundleResults.cpp:802
Isis::BundleResults::XmlHandler::startElement
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
Definition: BundleResults.cpp:1772
Isis::BundleResults::m_sigma0
double m_sigma0
std deviation of unit weight
Definition: BundleResults.h:309
Isis::MaximumLikelihoodWFunctions::modelToString
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
Definition: MaximumLikelihoodWFunctions.cpp:355
Isis::BundleResults::maxSigmaCoord1PointId
QString maxSigmaCoord1PointId() const
Returns the maximum sigma point id for coordinate 1.
Definition: BundleResults.cpp:1035
Isis::SurfacePoint::CoordinateType
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:139
Isis::BundleSettings::ConvergenceCriteria
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
Definition: BundleSettings.h:197
Isis::BundleResults::incrementNumberConstrainedPointParameters
void incrementNumberConstrainedPointParameters(int incrementAmount)
Increase the number of contrained point parameters.
Definition: BundleResults.cpp:684
Isis::BundleResults::m_rejectionLimit
double m_rejectionLimit
current rejection limit
Definition: BundleResults.h:299
Isis::BundleResults::setSigmaCoord1Range
void setSigmaCoord1Range(Distance minCoord1Dist, Distance maxCoord1Dist, QString minCoord1PointId, QString maxCoord1PointId)
Sets the min and max sigma distances and point ids for coordinate 1.
Definition: BundleResults.cpp:383
Isis::toInt
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:93
Isis::BundleResults::maxSigmaCoord3PointId
QString maxSigmaCoord3PointId() const
Returns the maximum sigma point id for coordinate 3.
Definition: BundleResults.cpp:1075
Isis::BundleResults::setNumberUnknownParameters
void setNumberUnknownParameters(int numberParameters)
Sets the total number of parameters to solve for.
Definition: BundleResults.cpp:730
Isis::BundleResults::m_outNet
ControlNetQsp m_outNet
The output control net from BundleAdjust.
Definition: BundleResults.h:324
Isis::BundleResults::m_rmsSigmaCoord2Stats
double m_rmsSigmaCoord2Stats
rms of adjusted Longitude sigmas
Definition: BundleResults.h:371
Isis::BundleResults::addProbabilityDistributionObservation
void addProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of |R^2 residuals|.
Definition: BundleResults.cpp:538
Isis::BundleResults::XmlHandler::characters
virtual bool characters(const QString &ch)
Adds a QString to the XmlHandler's internal character data.
Definition: BundleResults.cpp:2126
Isis::BundleResults::setNumberObservations
void setNumberObservations(int numberObservations)
Sets the number of observations.
Definition: BundleResults.cpp:656
Isis::BundleResults::outputControlNet
ControlNetQsp outputControlNet() const
Returns a shared pointer to the output control network.
Definition: BundleResults.cpp:1287
Isis::BundleResults::m_maxSigmaCoord2Distance
Distance m_maxSigmaCoord2Distance
The maximum sigma longitude distance.
Definition: BundleResults.h:359
Isis::BundleResults::numberHeldImages
int numberHeldImages() const
Returns the number of 'held' images.
Definition: BundleResults.cpp:594
Isis::BundleResults::m_elapsedTime
double m_elapsedTime
elapsed time for bundle
Definition: BundleResults.h:310
Isis::BundleResults::sigmaCoord3StatisticsRms
double sigmaCoord3StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 3.
Definition: BundleResults.cpp:1105
Isis::BundleResults::maxSigmaCoord2Distance
Distance maxSigmaCoord2Distance() const
Returns the maximum sigma distance for coordinate 2.
Definition: BundleResults.cpp:995
Isis::BundleResults::addResidualsProbabilityDistributionObservation
void addResidualsProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of residuals used for reporting.
Definition: BundleResults.cpp:549
Isis::BundleResults::setDegreesOfFreedom
void setDegreesOfFreedom(double degreesOfFreedom)
Sets the degrees of freedom.
Definition: BundleResults.cpp:782
Isis::BundleResults::m_rmsImageLineResiduals
QList< Statistics > m_rmsImageLineResiduals
List of RMS image line residual statistics for each image in the bundle
Definition: BundleResults.h:338
Isis::BundleResults::m_iterations
int m_iterations
The number of iterations taken by BundleAdjust.
Definition: BundleResults.h:326
Isis::BundleResults::computeSigma0
void computeSigma0(double dvtpv, BundleSettings::ConvergenceCriteria criteria)
Computes the sigma0 and stores it internally.
Definition: BundleResults.cpp:758
Isis::IException
Isis exception class.
Definition: IException.h:91
Isis::BundleResults::BundleResults
BundleResults(QObject *parent=0)
Constructs a BundleResults object.
Definition: BundleResults.cpp:48
Isis::BundleResults::minSigmaCoord1Distance
Distance minSigmaCoord1Distance() const
Returns the minimum sigma distance for coordinate 1.
Definition: BundleResults.cpp:965
Isis::BundleResults::rejectionLimit
double rejectionLimit() const
Returns the rejection limit.
Definition: BundleResults.cpp:1145
Isis::BundleResults::sigmaCoord2StatisticsRms
double sigmaCoord2StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 2.
Definition: BundleResults.cpp:1095
Isis::BundleResults::maximumLikelihoodSetUp
void maximumLikelihoodSetUp(QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles)
This method steps up the maximum likelihood estimation solution.
Definition: BundleResults.cpp:450
Isis::BundleResults::setCorrMatImgsAndParams
void setCorrMatImgsAndParams(QMap< QString, QStringList > imgsAndParams)
Set the images and their associated parameters of the correlation matrix.
Definition: BundleResults.cpp:1433
Isis::BundleResults::rmsImageDECSigmas
QVector< Statistics > rmsImageDECSigmas() const
Returns the list of RMS image declination sigma statistics.
Definition: BundleResults.cpp:945
Isis::BundleResults::m_rmsSigmaCoord3Stats
double m_rmsSigmaCoord3Stats
rms of adjusted Radius sigmas
Definition: BundleResults.h:372
Isis::StatCumProbDistDynCalc::value
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
Definition: StatCumProbDistDynCalc.cpp:182
Isis::BundleResults::maximumLikelihoodModelQuantile
double maximumLikelihoodModelQuantile(int modelIndex) const
Returns the quantile of the maximum likelihood model at the given index.
Definition: BundleResults.cpp:1387
Isis::BundleResults::XmlHandler::XmlHandler
XmlHandler(BundleResults *statistics, Project *project)
Constructs an XmlHandler used to save a BundleResults object.
Definition: BundleResults.cpp:1722
Isis::BundleResults::m_minSigmaCoord2Distance
Distance m_minSigmaCoord2Distance
The minimum sigma longitude distance.
Definition: BundleResults.h:358
Isis::BundleResults::m_numberFixedPoints
int m_numberFixedPoints
number of 'fixed' (ground) points (define)
Definition: BundleResults.h:289
Isis::BundleResults::minSigmaCoord3PointId
QString minSigmaCoord3PointId() const
Returns the minimum sigma point id for coordinate 3.
Definition: BundleResults.cpp:1065
Isis::BundleResults::m_rmsXYResiduals
double m_rmsXYResiduals
rms of all x and y residuals
Definition: BundleResults.h:297
Isis::BundleResults::correlationMatrix
CorrelationMatrix correlationMatrix() const
Returns the Correlation Matrix.
Definition: BundleResults.cpp:1405
Isis::BundleResults::setElapsedTimeErrorProp
void setElapsedTimeErrorProp(double time)
Sets the elapsed time for error propegation.
Definition: BundleResults.cpp:812
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::BundleResults::m_rmsImageYSigmas
QVector< Statistics > m_rmsImageYSigmas
< The root mean square image y sigmas.
Definition: BundleResults.h:346
Isis::BundleResults::rmsRy
double rmsRy() const
Returns the RMS of the y residuals.
Definition: BundleResults.cpp:1125
Isis::CorrelationMatrix::setCovarianceFileName
void setCovarianceFileName(FileName covarianceFileName)
Set the qmap of images and parameters.
Definition: CorrelationMatrix.cpp:359
Isis::BundleResults::setRmsXYResiduals
void setRmsXYResiduals(double rx, double ry, double rxy)
Sets the root mean square of the x and y residuals.
Definition: BundleResults.cpp:624
Isis::BundleResults::numberConstrainedTargetParameters
int numberConstrainedTargetParameters() const
Return the number of constrained target parameters.
Definition: BundleResults.cpp:1205
Isis::BundleResults::setCorrMatCovFileName
void setCorrMatCovFileName(FileName name)
Set the covariance file name for the matrix used to calculate the correlation matrix.
Definition: BundleResults.cpp:1422
Isis::BundleResults::m_rmsImageDECSigmas
QVector< Statistics > m_rmsImageDECSigmas
< The root mean square image declination sigmas.
Definition: BundleResults.h:352
QPair
This is free and unencumbered software released into the public domain.
Definition: CubeIoHandler.h:23
Isis::toBool
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:38
Isis::BundleResults::setRmsImageResidualLists
void setRmsImageResidualLists(QList< Statistics > rmsImageLineResiduals, QList< Statistics > rmsImageSampleResiduals, QList< Statistics > rmsImageResiduals)
Sets the root mean square image residual Statistics lists.
Definition: BundleResults.cpp:366
Isis::BundleResults::m_rmsImageSampleResiduals
QList< Statistics > m_rmsImageSampleResiduals
List of RMS image sample residual statistics for each image in the bundle
Definition: BundleResults.h:336
Isis::BundleResults::incrementMaximumLikelihoodModelIndex
void incrementMaximumLikelihoodModelIndex()
Increases the value that indicates which stage the maximum likelihood adjustment is currently on.
Definition: BundleResults.cpp:558
Isis::BundleResults::initializeResidualsProbabilityDistribution
void initializeResidualsProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of residuals used for reporting.
Definition: BundleResults.cpp:527
QMap< QString, QStringList >
Isis::MaximumLikelihoodWFunctions
Class provides maximum likelihood estimation functions for robust parameter estimation,...
Definition: MaximumLikelihoodWFunctions.h:49
Isis::BundleResults::incrementIgnoredPoints
void incrementIgnoredPoints()
Increase the number of ignored points.
Definition: BundleResults.cpp:602
Isis::StatCumProbDistDynCalc::addObs
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added.
Definition: StatCumProbDistDynCalc.cpp:394
Isis::BundleResults::computeDegreesOfFreedom
void computeDegreesOfFreedom()
Computes the degrees of freedom of the bundle adjustment and stores it internally.
Definition: BundleResults.cpp:738
Isis::BundleResults::m_minSigmaCoord1Distance
Distance m_minSigmaCoord1Distance
The minimum sigma latitude distance.
Definition: BundleResults.h:356
Isis::BundleResults::incrementHeldImages
void incrementHeldImages()
Increases the number of 'held' images.
Definition: BundleResults.cpp:584
Isis::BundleResults::setObservations
void setObservations(BundleObservationVector observations)
Sets the vector of BundleObservations.
Definition: BundleResults.cpp:862
Isis::BundleResults::numberRejectedObservations
int numberRejectedObservations() const
Returns the number of observation that were rejected.
Definition: BundleResults.cpp:1155
Isis::SurfacePoint::Latitudinal
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:140
Isis::BundleResults::rmsImageXSigmas
QVector< Statistics > rmsImageXSigmas() const
Returns the list of RMS image x sigma statistics.
Definition: BundleResults.cpp:905
Isis::BundleResults::resetNumberConstrainedTargetParameters
void resetNumberConstrainedTargetParameters()
Resets the number of constrained target parameters to 0.
Definition: BundleResults.cpp:710
Isis::IString
Adds specific functionality to C++ strings.
Definition: IString.h:165
Isis::BundleResults::m_numberHeldImages
int m_numberHeldImages
number of 'held' images (define)
Definition: BundleResults.h:292
Isis::BundleResults::m_maximumLikelihoodFunctions
QList< QPair< MaximumLikelihoodWFunctions, double > > m_maximumLikelihoodFunctions
< The maximum likelihood models and their quantiles.
Definition: BundleResults.h:379
Isis::BundleResults
A container class for statistical results from a BundleAdjust solution.
Definition: BundleResults.h:82
Isis::BundleResults::minSigmaCoord2Distance
Distance minSigmaCoord2Distance() const
Returns the minimum sigma distance for coordinate 2.
Definition: BundleResults.cpp:985
QObject
QVector
This is free and unencumbered software released into the public domain.
Definition: Calculator.h:18
Isis::BundleResults::setSigmaCoord3Range
void setSigmaCoord3Range(Distance minCoord3Dist, Distance maxCoord3Dist, QString minCoord3PointId, QString maxCoord3PointId)
Sets the min and max sigma distances and point ids for coordinate 3.
Definition: BundleResults.cpp:417
Isis::BundleResults::m_bundleControlPoints
QVector< BundleControlPointQsp > m_bundleControlPoints
The vector of BundleControlPoints from BundleAdjust.
Definition: BundleResults.h:316
Isis::BundleResults::save
void save(QXmlStreamWriter &stream, const Project *project) const
Saves the BundleResults object to an XML file.
Definition: BundleResults.cpp:1457
Isis::BundleResults::m_maxSigmaCoord2PointId
QString m_maxSigmaCoord2PointId
The maximum sigma coordinate2 point id.
Definition: BundleResults.h:366
Isis::BundleResults::setNumberImageParameters
void setNumberImageParameters(int numberParameters)
Sets the number of image parameters.
Definition: BundleResults.cpp:666
Isis::BundleResults::rmsImageSampleResiduals
QList< Statistics > rmsImageSampleResiduals() const
Returns the list of RMS image sample residuals statistics.
Definition: BundleResults.cpp:875
Isis::BundleResults::residualsCumulativeProbabilityDistribution
StatCumProbDistDynCalc residualsCumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the residuals used for reporting.
Definition: BundleResults.cpp:1353
Isis
This is free and unencumbered software released into the public domain.
Definition: Apollo.h:16
Isis::BundleObservationVector
This class is a container class for BundleObservations.
Definition: BundleObservationVector.h:55
Isis::BundleResults::resizeSigmaStatisticsVectors
void resizeSigmaStatisticsVectors(int numberImages)
Resizes all image sigma vectors.
Definition: BundleResults.cpp:337
Isis::BundleResults::~BundleResults
~BundleResults()
Destroys this BundleResults object.
Definition: BundleResults.cpp:149
Isis::BundleResults::rmsImageRASigmas
QVector< Statistics > rmsImageRASigmas() const
Returns the list of RMS image right ascension sigma statistics.
Definition: BundleResults.cpp:935
Isis::BundleResults::m_numberUnknownParameters
int m_numberUnknownParameters
total number of parameters to solve for
Definition: BundleResults.h:303
Isis::BundleResults::m_minSigmaCoord1PointId
QString m_minSigmaCoord1PointId
The minimum sigma coordinate 1 point id.
Definition: BundleResults.h:363

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 USGS Astrogeology Discussion Board
To report a bug, or suggest a feature go to: ISIS Github
File Modified: 07/13/2023 15:16:12