Isis 3 Programmer Reference
BundleResults.cpp
1 #include "BundleResults.h"
2 
3 #include <QDataStream>
4 #include <QDebug>
5 #include <QString>
6 #include <QtGlobal> // qMax()
7 #include <QUuid>
8 #include <QXmlStreamWriter>
9 
10 #include <boost/lexical_cast.hpp>
11 #include <boost/numeric/ublas/io.hpp>
12 #include <boost/numeric/ublas/matrix_sparse.hpp>
13 #include <boost/numeric/ublas/vector_proxy.hpp>
14 
15 #include "Camera.h"
16 #include "ControlMeasure.h"
17 #include "ControlPoint.h"
18 #include "CorrelationMatrix.h"
19 #include "Distance.h"
20 #include "FileName.h"
21 #include "IString.h"
23 #include "Project.h"
24 #include "PvlKeyword.h"
25 #include "PvlObject.h"
26 #include "SerialNumberList.h"
27 #include "StatCumProbDistDynCalc.h"
28 #include "Statistics.h"
29 #include "XmlStackedHandlerReader.h"
30 
31 using namespace boost::numeric::ublas;
32 
33 namespace Isis {
34 
40  BundleResults::BundleResults(QObject *parent) : QObject(parent) {
41 
42  initialize();
43 
47 
48  // residual prob distribution is calculated even if there is no maximum likelihood estimation.
49  // so set up the solver to have a node at every percent of the distribution
51 
52  }
53 
54 
64  QObject *parent) : QObject(parent) {
65  // TODO: does xml stuff need project???
66 
67  initialize();
68 
69  xmlReader->pushContentHandler(new XmlHandler(this, project));
70  xmlReader->setErrorHandler(new XmlHandler(this, project));
71 
72  }
73 
74 
82  : m_correlationMatrix(new CorrelationMatrix(*src.m_correlationMatrix)),
83  m_numberFixedPoints(src.m_numberFixedPoints),
84  m_numberIgnoredPoints(src.m_numberIgnoredPoints),
85  m_numberHeldImages(src.m_numberHeldImages),
86  m_rmsXResiduals(src.m_rmsXResiduals),
87  m_rmsYResiduals(src.m_rmsYResiduals),
88  m_rmsXYResiduals(src.m_rmsXYResiduals),
89  m_rejectionLimit(src.m_rejectionLimit),
90  m_numberObservations(src.m_numberObservations),
91  m_numberRejectedObservations(src.m_numberRejectedObservations),
92  m_numberUnknownParameters(src.m_numberUnknownParameters),
93  m_numberImageParameters(src.m_numberImageParameters),
94  m_numberConstrainedImageParameters(src.m_numberConstrainedImageParameters),
95  m_numberConstrainedPointParameters(src.m_numberConstrainedPointParameters),
96  m_numberConstrainedTargetParameters(src.m_numberConstrainedTargetParameters),
97  m_degreesOfFreedom(src.m_degreesOfFreedom),
98  m_sigma0(src.m_sigma0),
99  m_elapsedTime(src.m_elapsedTime),
100  m_elapsedTimeErrorProp(src.m_elapsedTimeErrorProp),
101  m_converged(src.m_converged),
102  m_bundleControlPoints(src.m_bundleControlPoints),
103  m_outNet(src.m_outNet),
104  m_iterations(src.m_iterations),
105  m_observations(src.m_observations),
106  m_rmsImageSampleResiduals(src.m_rmsImageSampleResiduals),
107  m_rmsImageLineResiduals(src.m_rmsImageLineResiduals),
108  m_rmsImageResiduals(src.m_rmsImageResiduals),
109  m_rmsImageXSigmas(src.m_rmsImageXSigmas),
110  m_rmsImageYSigmas(src.m_rmsImageYSigmas),
111  m_rmsImageZSigmas(src.m_rmsImageZSigmas),
112  m_rmsImageRASigmas(src.m_rmsImageRASigmas),
113  m_rmsImageDECSigmas(src.m_rmsImageDECSigmas),
114  m_rmsImageTWISTSigmas(src.m_rmsImageTWISTSigmas),
115  m_minSigmaCoord1Distance(src.m_minSigmaCoord1Distance),
116  m_maxSigmaCoord1Distance(src.m_maxSigmaCoord1Distance),
117  m_minSigmaCoord2Distance(src.m_minSigmaCoord2Distance),
118  m_maxSigmaCoord2Distance(src.m_maxSigmaCoord2Distance),
119  m_minSigmaCoord3Distance(src.m_minSigmaCoord3Distance),
120  m_maxSigmaCoord3Distance(src.m_maxSigmaCoord3Distance),
121  m_minSigmaCoord1PointId(src.m_minSigmaCoord1PointId),
122  m_maxSigmaCoord1PointId(src.m_maxSigmaCoord1PointId),
123  m_minSigmaCoord2PointId(src.m_minSigmaCoord2PointId),
124  m_maxSigmaCoord2PointId(src.m_maxSigmaCoord2PointId),
125  m_minSigmaCoord3PointId(src.m_minSigmaCoord3PointId),
126  m_maxSigmaCoord3PointId(src.m_maxSigmaCoord3PointId),
127  m_rmsSigmaCoord1Stats(src.m_rmsSigmaCoord1Stats),
128  m_rmsSigmaCoord2Stats(src.m_rmsSigmaCoord2Stats),
129  m_rmsSigmaCoord3Stats(src.m_rmsSigmaCoord3Stats),
130  m_maximumLikelihoodFunctions(src.m_maximumLikelihoodFunctions),
131  m_maximumLikelihoodIndex(src.m_maximumLikelihoodIndex),
132  m_cumPro(new StatCumProbDistDynCalc(*src.m_cumPro)),
133  m_cumProRes(new StatCumProbDistDynCalc(*src.m_cumProRes)),
134  m_maximumLikelihoodMedianR2Residuals(src.m_maximumLikelihoodMedianR2Residuals) {
135  }
136 
137 
142 
143  delete m_correlationMatrix;
144  m_correlationMatrix = NULL;
145 
146  delete m_cumPro;
147  m_cumPro = NULL;
148 
149  delete m_cumProRes;
150  m_cumProRes = NULL;
151 
152  }
153 
154 
162 
163  if (&src != this) {
164  delete m_correlationMatrix;
165  m_correlationMatrix = NULL;
167 
183  m_sigma0 = src.m_sigma0;
186  m_converged = src.m_converged;
188  m_outNet = src.m_outNet;
194  m_rmsImageXSigmas = src.m_rmsImageXSigmas;
217 
218  delete m_cumPro;
219  m_cumPro = NULL;
221 
222  delete m_cumProRes;
223  m_cumProRes = NULL;
225 
227  }
228  return *this;
229  }
230 
231 
238  m_correlationMatrix = NULL;
239 
240  m_numberFixedPoints = 0; // set in BA constructor->init->fillPointIndexMap
241  m_numberIgnoredPoints = 0; // set in BA constructor->init->fillPointIndexMap
242 
243 
244  // set in BundleAdjust init()
245  m_numberHeldImages = 0;
246 
247  // members set while computing bundle stats
249  m_rmsImageLineResiduals.clear();
250  m_rmsImageResiduals.clear();
251  m_rmsImageXSigmas.clear();
252  m_rmsImageYSigmas.clear();
253  m_rmsImageZSigmas.clear();
254  m_rmsImageRASigmas.clear();
255  m_rmsImageDECSigmas.clear();
256  m_rmsImageTWISTSigmas.clear();
257 
258  // Initialize coordinate sigma boundaries. Units are meters for sigmas in both
259  // latitudinal and rectangular coordinates
272 
273  m_rmsSigmaCoord1Stats = 0.0;
274  m_rmsSigmaCoord2Stats = 0.0;
275  m_rmsSigmaCoord3Stats = 0.0;
276 
277 
278  // set by compute residuals
279  m_rmsXResiduals = 0.0;
280  m_rmsYResiduals = 0.0;
281  m_rmsXYResiduals = 0.0;
282 
283  // set by compute rejection limit
284  m_rejectionLimit = 0.0;
285 
286  // set by flag outliers
288 
289  // set by formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or solve
292 
293 // ??? unused variable ??? m_numberHeldPoints = 0;
294 
295  // set by formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or
296  // setParameterWeights (i.e. solve)
300 
301  // set by initialize, formNormalEquations_CHOLMOD, formNormalEquations_SPECIALK, or solve
303 
304  // solve and solve cholesky
305  m_degreesOfFreedom = -1;
306  m_iterations = 0;
307  m_sigma0 = 0.0;
308  m_elapsedTime = 0.0;
310  m_converged = false; // or initialze method
311 
312  m_cumPro = NULL;
316  m_cumProRes = NULL;
317 
318  m_observations.clear();
319  m_outNet.clear();
320 
321  }
322 
323 
330  m_rmsImageXSigmas.resize(numberImages);
331  m_rmsImageYSigmas.resize(numberImages);
332  m_rmsImageZSigmas.resize(numberImages);
333  m_rmsImageRASigmas.resize(numberImages);
334  m_rmsImageDECSigmas.resize(numberImages);
335  m_rmsImageTWISTSigmas.resize(numberImages);
336  }
337 
338 
339 #if 0
341  QVector<Statistics> rmsImageSampleResiduals,
342  QVector<Statistics> rmsImageResiduals) {
343  // QList??? jigsaw apptest gives - ASSERT failure in QList<T>::operator[]: "index out of range",
347  }
348 #endif
349 
350 
359  QList<Statistics> rmsImageSampleResiduals,
360  QList<Statistics> rmsImageResiduals) {
364  }
365 
366 
375  void BundleResults::setSigmaCoord1Range(Distance minCoord1Dist, Distance maxCoord1Dist,
376  QString minCoord1PointId, QString maxCoord1PointId) {
377  m_minSigmaCoord1Distance = minCoord1Dist;
378  m_maxSigmaCoord1Distance = maxCoord1Dist;
379  m_minSigmaCoord1PointId = minCoord1PointId;
380  m_maxSigmaCoord1PointId = maxCoord1PointId;
381  }
382 
383 
392  void BundleResults::setSigmaCoord2Range(Distance minCoord2Dist, Distance maxCoord2Dist,
393  QString minCoord2PointId, QString maxCoord2PointId) {
394  m_minSigmaCoord2Distance = minCoord2Dist;
395  m_maxSigmaCoord2Distance = maxCoord2Dist;
396  m_minSigmaCoord2PointId = minCoord2PointId;
397  m_maxSigmaCoord2PointId = maxCoord2PointId;
398  }
399 
400 
409  void BundleResults::setSigmaCoord3Range(Distance minCoord3Dist, Distance maxCoord3Dist,
410  QString minCoord3PointId, QString maxCoord3PointId) {
411  m_minSigmaCoord3Distance = minCoord3Dist;
412  m_maxSigmaCoord3Distance = maxCoord3Dist;
413  m_minSigmaCoord3PointId = minCoord3PointId;
414  m_maxSigmaCoord3PointId = maxCoord3PointId;
415  }
416 
417 
426  double rmsFromSigmaCoord1Stats,
427  double rmsFromSigmaCoord2Stats,
428  double rmsFromSigmaCoord3Stats) {
429  m_rmsSigmaCoord1Stats = rmsFromSigmaCoord1Stats;
430  m_rmsSigmaCoord2Stats = rmsFromSigmaCoord2Stats;
431  m_rmsSigmaCoord3Stats = rmsFromSigmaCoord3Stats;
432  }
433 
434 
444 
445 
446  // reinitialize variables if this setup has already been called
449 
450  // residual prob distribution is calculated even if there is no maximum likelihood estimation.
451  // set up the solver to have a node at every percent of the distribution
452  m_cumProRes = NULL;
455 
456  // if numberMaximumLikelihoodModels > 0, then MaximumLikeliHood Estimation is being used.
457  for (int i = 0; i < modelsWithQuantiles.size(); i++) {
458 
459  // if maximum likelihood is being used, the cum prob calculator is initialized.
460  if (i == 0) {
461  m_cumPro = NULL;
463  // set up the solver to have a node at every percent of the distribution
465  }
466 
467  // set up the w functions for the maximum likelihood estimation
469  qMakePair(MaximumLikelihoodWFunctions(modelsWithQuantiles[i].first),
470  modelsWithQuantiles[i].second));
471 
472  }
473 
474 
475  //maximum likelihood estimation tiered solutions requiring multiple convergeances are supported,
476  // this index keeps track of which tier the solution is in
478  }
479 
480 
485 // printf("Maximum Likelihood Tier: %d\n", m_maximumLikelihoodIndex);
487  // if maximum likelihood estimation is being used
488  // at the end of every iteration
489  // reset the tweaking contant to the desired quantile of the |residual| distribution
490  double quantile = m_maximumLikelihoodFunctions[m_maximumLikelihoodIndex].second;
491  double tc = m_cumPro->value(quantile);
492  m_maximumLikelihoodFunctions[m_maximumLikelihoodIndex].first.setTweakingConstant(tc);
493  // print meadians of residuals
495 // printf("Median of R^2 residuals: %lf\n", m_maximumLikelihoodMedianR2Residuals);
496 
497  //restart the dynamic calculation of the cumulative probility distribution of |R^2 residuals|
498  // so it will be up to date for the next iteration
500  }
501  }
502 
503 
510  m_cumPro->setQuantiles(nodes);
511  }
512 
513 
520  m_cumProRes->setQuantiles(nodes);
521  }
522 
523 
531  m_cumPro->addObs(observationValue);
532  }
533 
534 
542  m_cumProRes->addObs(observationValue);
543  }
544 
545 
552  }
553 
554 
560  }
561 
562 
569  return m_numberFixedPoints;
570  }
571 
572 
578  }
579 
580 
587  return m_numberHeldImages;
588  }
589 
590 
596  }
597 
598 
605  return m_numberIgnoredPoints;
606  }
607 
608 
616  void BundleResults::setRmsXYResiduals(double rx, double ry, double rxy) {
617  m_rmsXResiduals = rx;
618  m_rmsYResiduals = ry;
619  m_rmsXYResiduals = rxy;
620  }
621 
622 
628  void BundleResults::setRejectionLimit(double rejectionLimit) {
630  }
631 
632 
638  void BundleResults::setNumberRejectedObservations(int numberRejectedObservations) {
640  }
641 
642 
648  void BundleResults::setNumberObservations(int numberObservations) {
650  }
651 
652 
658  void BundleResults::setNumberImageParameters(int numberParameters) {
659  m_numberImageParameters = numberParameters;
660  }
661 
662 
668  }
669 
670 
677  m_numberConstrainedPointParameters += incrementAmount;
678  }
679 
680 
686  }
687 
688 
695  m_numberConstrainedImageParameters += incrementAmount;
696  }
697 
698 
704  }
705 
706 
713  m_numberConstrainedTargetParameters += incrementAmount;
714  }
715 
716 
722  void BundleResults::setNumberUnknownParameters(int numberParameters) {
723  m_numberUnknownParameters = numberParameters;
724  }
725 
726 
736  }
737 
738 
752 
753  if (m_degreesOfFreedom > 0) {
754  m_sigma0 = dvtpv / m_degreesOfFreedom;
755  }
756  else if (m_degreesOfFreedom == 0 && criteria == BundleSettings::ParameterCorrections) {
757  m_sigma0 = dvtpv;
758  }
759  else {
760  QString msg = "Computed degrees of freedom [" + toString(m_degreesOfFreedom)
761  + "] is invalid.";
762  throw IException(IException::Io, msg, _FILEINFO_);
763  }
764 
765  m_sigma0 = sqrt(m_sigma0);
766  }
767 
768 
774  void BundleResults::setDegreesOfFreedom(double degreesOfFreedom) { // old sparse
776  }
777 
778 
784  void BundleResults::setSigma0(double sigma0) { // old sparse
785  m_sigma0 = sigma0;
786  }
787 
788 
794  void BundleResults::setElapsedTime(double time) {
795  m_elapsedTime = time;
796  }
797 
798 
805  m_elapsedTimeErrorProp = time;
806  }
807 
808 
814  void BundleResults::setConverged(bool converged) {
815  m_converged = converged;
816  }
817 
818 
825  m_bundleControlPoints = controlPoints;
826  }
827 
828 
835  m_outNet = outNet;
836  }
837 
838 
844  void BundleResults::setIterations(int iterations) {
846  }
847 
848 
856  }
857 
858 
859 
860  //************************* Accessors **********************************************************//
861 
869  }
870 
871 
879  }
880 
881 
888  return m_rmsImageResiduals;
889  }
890 
891 
898  return m_rmsImageXSigmas;
899  }
900 
901 
908  return m_rmsImageYSigmas;
909  }
910 
911 
918  return m_rmsImageZSigmas;
919  }
920 
921 
928  return m_rmsImageRASigmas;
929  }
930 
931 
938  return m_rmsImageDECSigmas;
939  }
940 
941 
948  return m_rmsImageTWISTSigmas;
949  }
950 
951 
959  }
960 
961 
969  }
970 
971 
979  }
980 
981 
989  }
990 
991 
999  }
1000 
1001 
1008  return m_maxSigmaCoord3Distance;
1009  }
1010 
1011 
1018  return m_minSigmaCoord1PointId;
1019  }
1020 
1021 
1028  return m_maxSigmaCoord1PointId;
1029  }
1030 
1031 
1038  return m_minSigmaCoord2PointId;
1039  }
1040 
1041 
1048  return m_maxSigmaCoord2PointId;
1049  }
1050 
1051 
1058  return m_minSigmaCoord3PointId;
1059  }
1060 
1061 
1068  return m_maxSigmaCoord3PointId;
1069  }
1070 
1071 
1078  return m_rmsSigmaCoord1Stats;
1079  }
1080 
1081 
1088  return m_rmsSigmaCoord2Stats;
1089  }
1090 
1091 
1098  return m_rmsSigmaCoord3Stats;
1099  }
1100 
1101 
1107  double BundleResults::rmsRx() const {
1108  return m_rmsXResiduals;
1109  }
1110 
1111 
1117  double BundleResults::rmsRy() const {
1118  return m_rmsYResiduals;
1119  }
1120 
1121 
1127  double BundleResults::rmsRxy() const {
1128  return m_rmsXYResiduals;
1129  }
1130 
1131 
1138  return m_rejectionLimit;
1139  }
1140 
1141 
1149  }
1150 
1151 
1158  return m_numberObservations;
1159  }
1160 
1161 
1168  return m_numberImageParameters;
1169  }
1170 
1171 
1179  }
1180 
1181 
1189  }
1190 
1191 
1199  }
1200 
1201 
1209  }
1210 
1211 
1218  return m_degreesOfFreedom;
1219  }
1220 
1221 
1227  double BundleResults::sigma0() const {
1228  return m_sigma0;
1229  }
1230 
1231 
1238  return m_elapsedTime;
1239  }
1240 
1241 
1248  return m_elapsedTimeErrorProp;
1249  }
1250 
1251 
1258  return m_converged;
1259  }
1260 
1261 
1268  return m_bundleControlPoints;
1269  }
1270 
1271 
1280  if (!m_outNet) {
1282  "Output Control Network has not been set.",
1283  _FILEINFO_);
1284  }
1285  return m_outNet;
1286  }
1287 
1288 
1295  return m_iterations;
1296  }
1297 
1298 
1305  return m_observations;
1306  }
1307 
1308 
1315  return m_maximumLikelihoodFunctions.size();
1316  }
1317 
1318 
1325  return m_maximumLikelihoodIndex;
1326  }
1327 
1328 
1336  return *m_cumPro;
1337  }
1338 
1339 
1346  return *m_cumProRes;
1347  }
1348 
1349 
1357  }
1358 
1359 
1368  return m_maximumLikelihoodFunctions[modelIndex].first;
1369  }
1370 
1371 
1379  double BundleResults::maximumLikelihoodModelQuantile(int modelIndex) const {
1380  return m_maximumLikelihoodFunctions[modelIndex].second;
1381  }
1382 
1383 
1384 // QList< QPair< MaximumLikelihoodWFunctions, double > >
1385 // BundleResults::maximumLikelihoodModels() const {
1386 // return m_maximumLikelihoodFunctions;
1387 // }
1388 
1389 
1398  if (m_correlationMatrix) {
1399  return *m_correlationMatrix;
1400  }
1401  else {
1403  "Correlation matrix for this bundle is NULL.",
1404  _FILEINFO_);
1405  }
1406  }
1407 
1408 
1415  correlationMatrix();// throw error if null
1417  }
1418 
1419 
1426  correlationMatrix();// throw error if null
1428  }
1429 
1430 
1431  SurfacePoint::CoordinateType BundleResults::coordTypeReports() {
1432  // Get the coordinate type from the output net if it exists. Otherwise use the default.
1434 
1435  if (m_outNet) {
1436  type = outputControlNet()->GetCoordType();
1437  }
1438 
1439  return type;
1440  }
1441 
1442 
1449  void BundleResults::save(QXmlStreamWriter &stream, const Project *project) const {
1450  // Get the coordinate type from the output net if it exists. Otherwise use the default.
1452 
1453  if (m_outNet) {
1454  coordType = outputControlNet()->GetCoordType();
1455  }
1456 
1457  stream.writeStartElement("bundleResults");
1458  stream.writeStartElement("correlationMatrix");
1459  stream.writeAttribute("correlationFileName",
1460  correlationMatrix().correlationFileName().expanded());
1461  stream.writeAttribute("covarianceFileName",
1462  correlationMatrix().covarianceFileName().expanded());
1463  stream.writeStartElement("imagesAndParameters");
1464  QMapIterator<QString, QStringList> imgParamIt(*correlationMatrix().imagesAndParameters());
1465  while (imgParamIt.hasNext()) {
1466  imgParamIt.next();
1467  stream.writeStartElement("image");
1468  stream.writeAttribute("id", imgParamIt.key());
1469  QStringList parameters = imgParamIt.value();
1470  for (int i = 0; i < parameters.size(); i++) {
1471  stream.writeTextElement("parameter", parameters[i]);
1472  }
1473  stream.writeEndElement(); // end image
1474 
1475  }
1476  stream.writeEndElement(); // end images and parameters
1477  stream.writeEndElement(); // end correlationMatrix
1478 
1479  stream.writeStartElement("generalStatisticsValues");
1480  stream.writeTextElement("numberFixedPoints", toString(numberFixedPoints()));
1481  stream.writeTextElement("numberIgnoredPoints", toString(numberIgnoredPoints()));
1482  stream.writeTextElement("numberHeldImages", toString(numberHeldImages()));
1483  stream.writeTextElement("rejectionLimit", toString(rejectionLimit()));
1484  stream.writeTextElement("numberRejectedObservations", toString(numberRejectedObservations()));
1485  stream.writeTextElement("numberObservations", toString(numberObservations()));
1486  stream.writeTextElement("numberImageParameters", toString(numberImageParameters()));
1487  stream.writeTextElement("numberConstrainedPointParameters",
1489  stream.writeTextElement("numberConstrainedImageParameters",
1491  stream.writeTextElement("numberConstrainedTargetParameters",
1493  stream.writeTextElement("numberUnknownParameters", toString(numberUnknownParameters()));
1494  stream.writeTextElement("degreesOfFreedom", toString(degreesOfFreedom()));
1495  stream.writeTextElement("sigma0", toString(sigma0()));
1496  stream.writeTextElement("converged", toString(converged()));
1497  stream.writeEndElement(); // end generalStatisticsValues
1498 
1499  stream.writeStartElement("rms");
1500  stream.writeStartElement("residuals");
1501  stream.writeAttribute("x", toString(rmsRx()));
1502  stream.writeAttribute("y", toString(rmsRy()));
1503  stream.writeAttribute("xy", toString(rmsRxy()));
1504  stream.writeEndElement(); // end residuals element
1505  stream.writeStartElement("sigmas");
1506 
1507  // Set the label based of the coordinate type set for reports
1508  switch (coordType) {
1510  stream.writeAttribute("lat", toString(sigmaCoord1StatisticsRms()));
1511  stream.writeAttribute("lon", toString(sigmaCoord2StatisticsRms()));
1512  stream.writeAttribute("rad", toString(sigmaCoord3StatisticsRms()));
1513  break;
1515  stream.writeAttribute("x", toString(sigmaCoord1StatisticsRms()));
1516  stream.writeAttribute("y", toString(sigmaCoord2StatisticsRms()));
1517  stream.writeAttribute("z", toString(sigmaCoord3StatisticsRms()));
1518  break;
1519  default:
1520  IString msg ="Unknown surface point coordinate type enum [" + toString(coordType) + "]." ;
1522  }
1523  stream.writeEndElement(); // end sigmas element
1524 
1525  stream.writeStartElement("imageResidualsLists");
1526  stream.writeStartElement("residualsList");
1527  stream.writeAttribute("listSize", toString(rmsImageResiduals().size()));
1528  for (int i = 0; i < m_rmsImageResiduals.size(); i++) {
1529  stream.writeStartElement("statisticsItem");
1530  m_rmsImageResiduals[i].save(stream, project);
1531  stream.writeEndElement(); // end statistics item
1532  }
1533  stream.writeEndElement(); // end residuals list
1534  stream.writeStartElement("sampleList");
1535  stream.writeAttribute("listSize", toString(rmsImageSampleResiduals().size()));
1536  for (int i = 0; i < m_rmsImageSampleResiduals.size(); i++) {
1537  stream.writeStartElement("statisticsItem");
1538  m_rmsImageSampleResiduals[i].save(stream, project);
1539  stream.writeEndElement(); // end statistics item
1540  }
1541  stream.writeEndElement(); // end sample residuals list
1542 
1543  stream.writeStartElement("lineList");
1544  stream.writeAttribute("listSize", toString(rmsImageLineResiduals().size()));
1545  for (int i = 0; i < m_rmsImageLineResiduals.size(); i++) {
1546  stream.writeStartElement("statisticsItem");
1547  m_rmsImageLineResiduals[i].save(stream, project);
1548  stream.writeEndElement(); // end statistics item
1549  }
1550  stream.writeEndElement(); // end line residuals list
1551  stream.writeEndElement(); // end image residuals lists
1552 
1553  stream.writeStartElement("imageSigmasLists");
1554  stream.writeStartElement("xSigmas");
1555  stream.writeAttribute("listSize", toString(rmsImageXSigmas().size()));
1556  for (int i = 0; i < m_rmsImageXSigmas.size(); i++) {
1557  stream.writeStartElement("statisticsItem");
1558  m_rmsImageXSigmas[i].save(stream, project);
1559  stream.writeEndElement(); // end statistics item
1560  }
1561 
1562  stream.writeEndElement(); // end x sigma list
1563 
1564  stream.writeStartElement("ySigmas");
1565  stream.writeAttribute("listSize", toString(rmsImageYSigmas().size()));
1566  for (int i = 0; i < m_rmsImageYSigmas.size(); i++) {
1567  stream.writeStartElement("statisticsItem");
1568  m_rmsImageYSigmas[i].save(stream, project);
1569  stream.writeEndElement(); // end statistics item
1570  }
1571  stream.writeEndElement(); // end y sigma list
1572 
1573  stream.writeStartElement("zSigmas");
1574  stream.writeAttribute("listSize", toString(rmsImageZSigmas().size()));
1575  for (int i = 0; i < m_rmsImageZSigmas.size(); i++) {
1576  stream.writeStartElement("statisticsItem");
1577  m_rmsImageZSigmas[i].save(stream, project);
1578  stream.writeEndElement(); // end statistics item
1579  }
1580  stream.writeEndElement(); // end z sigma list
1581 
1582  stream.writeStartElement("raSigmas");
1583  stream.writeAttribute("listSize", toString(rmsImageRASigmas().size()));
1584  for (int i = 0; i < m_rmsImageRASigmas.size(); i++) {
1585  stream.writeStartElement("statisticsItem");
1586  m_rmsImageRASigmas[i].save(stream, project);
1587  stream.writeEndElement(); // end statistics item
1588  }
1589  stream.writeEndElement(); // end ra sigma list
1590 
1591  stream.writeStartElement("decSigmas");
1592  stream.writeAttribute("listSize", toString(rmsImageDECSigmas().size()));
1593  for (int i = 0; i < m_rmsImageDECSigmas.size(); i++) {
1594  stream.writeStartElement("statisticsItem");
1595  m_rmsImageDECSigmas[i].save(stream, project);
1596  stream.writeEndElement(); // end statistics item
1597  }
1598  stream.writeEndElement(); // end dec sigma list
1599 
1600  stream.writeStartElement("twistSigmas");
1601  stream.writeAttribute("listSize", toString(rmsImageTWISTSigmas().size()));
1602  for (int i = 0; i < m_rmsImageTWISTSigmas.size(); i++) {
1603  stream.writeStartElement("statisticsItem");
1604  m_rmsImageTWISTSigmas[i].save(stream, project);
1605  stream.writeEndElement(); // end statistics item
1606  }
1607  stream.writeEndElement(); // end twist sigma list
1608  stream.writeEndElement(); // end sigmas lists
1609  stream.writeEndElement(); // end rms
1610 
1611  stream.writeStartElement("elapsedTime");
1612  stream.writeAttribute("time", toString(elapsedTime()));
1613  stream.writeAttribute("errorProp", toString(elapsedTimeErrorProp()));
1614  stream.writeEndElement(); // end elapsed time
1615 
1616  stream.writeStartElement("minMaxSigmas");
1617 
1618  // Write the labels corresponding to the coordinate type set for reports
1619  switch (coordType) {
1621  stream.writeStartElement("minLat");
1622  stream.writeAttribute("value", toString(minSigmaCoord1Distance().meters()));
1623  stream.writeAttribute("pointId", minSigmaCoord1PointId());
1624  stream.writeEndElement();
1625  stream.writeStartElement("maxLat");
1626  stream.writeAttribute("value", toString(maxSigmaCoord1Distance().meters()));
1627  stream.writeAttribute("pointId", maxSigmaCoord1PointId());
1628  stream.writeEndElement();
1629  stream.writeStartElement("minLon");
1630  stream.writeAttribute("value", toString(minSigmaCoord2Distance().meters()));
1631  stream.writeAttribute("pointId", minSigmaCoord2PointId());
1632  stream.writeEndElement();
1633  stream.writeStartElement("maxLon");
1634  stream.writeAttribute("value", toString(maxSigmaCoord2Distance().meters()));
1635  stream.writeAttribute("pointId", maxSigmaCoord2PointId());
1636  stream.writeEndElement();
1637  stream.writeStartElement("minRad");
1638  stream.writeAttribute("value", toString(minSigmaCoord3Distance().meters()));
1639  stream.writeAttribute("pointId", minSigmaCoord3PointId());
1640  stream.writeEndElement();
1641  stream.writeStartElement("maxRad");
1642  stream.writeAttribute("value", toString(maxSigmaCoord3Distance().meters()));
1643  stream.writeAttribute("pointId", maxSigmaCoord3PointId());
1644  stream.writeEndElement();
1645  break;
1647  stream.writeStartElement("minX");
1648  stream.writeAttribute("value", toString(minSigmaCoord1Distance().meters()));
1649  stream.writeAttribute("pointId", minSigmaCoord1PointId());
1650  stream.writeEndElement();
1651  stream.writeStartElement("maxX");
1652  stream.writeAttribute("value", toString(maxSigmaCoord1Distance().meters()));
1653  stream.writeAttribute("pointId", maxSigmaCoord1PointId());
1654  stream.writeEndElement();
1655  stream.writeStartElement("minY");
1656  stream.writeAttribute("value", toString(minSigmaCoord2Distance().meters()));
1657  stream.writeAttribute("pointId", minSigmaCoord2PointId());
1658  stream.writeEndElement();
1659  stream.writeStartElement("maxY");
1660  stream.writeAttribute("value", toString(maxSigmaCoord2Distance().meters()));
1661  stream.writeAttribute("pointId", maxSigmaCoord2PointId());
1662  stream.writeEndElement();
1663  stream.writeStartElement("minZ");
1664  stream.writeAttribute("value", toString(minSigmaCoord3Distance().meters()));
1665  stream.writeAttribute("pointId", minSigmaCoord3PointId());
1666  stream.writeEndElement();
1667  stream.writeStartElement("maxZ");
1668  stream.writeAttribute("value", toString(maxSigmaCoord3Distance().meters()));
1669  stream.writeAttribute("pointId", maxSigmaCoord3PointId());
1670  stream.writeEndElement();
1671  break;
1672  default:
1673  IString msg ="Unknown surface point coordinate type enum [" + toString(coordType) + "]." ;
1675  }
1676  stream.writeEndElement(); // end minMaxSigmas
1677 
1678  // call max likelihood setup from startElement to fill the rest of these values...
1679  stream.writeStartElement("maximumLikelihoodEstimation");
1680  stream.writeAttribute("numberModels", toString(numberMaximumLikelihoodModels()));
1681  stream.writeAttribute("maximumLikelihoodIndex", toString(maximumLikelihoodModelIndex()));
1682  stream.writeAttribute("maximumLikelihoodMedianR2Residuals",
1684 
1685  stream.writeStartElement("cumulativeProbabilityCalculator");
1686  // cumulativeProbabilityDistribution().save(stream, project);
1687  stream.writeEndElement(); // end cumulativeProbabilityCalculator
1688 
1689  stream.writeStartElement("residualsCumulativeProbabilityCalculator");
1690  // residualsCumulativeProbabilityDistribution().save(stream, project);
1691  stream.writeEndElement(); // end residualsCumulativeProbabilityCalculator
1692 
1693  for (int i = 0; i < numberMaximumLikelihoodModels(); i++) {
1694  stream.writeStartElement("model");
1695  stream.writeAttribute("modelNumber", toString(i+1));
1696  stream.writeAttribute("modelSelection",
1698  stream.writeAttribute("tweakingConstant",
1699  toString(m_maximumLikelihoodFunctions[i].first.tweakingConstant()));
1700  stream.writeAttribute("quantile", toString(m_maximumLikelihoodFunctions[i].second));
1701  stream.writeEndElement(); // end this model
1702  }
1703  stream.writeEndElement(); // end maximumLikelihoodEstimation
1704  stream.writeEndElement(); // end bundleResults
1705  }
1706 
1707 
1715  // TODO: does xml stuff need project???
1716  m_xmlHandlerCumProCalc = NULL;
1717  m_xmlHandlerBundleResults = NULL;
1718  m_xmlHandlerProject = NULL;
1719 
1720  m_xmlHandlerBundleResults = statistics;
1721  m_xmlHandlerProject = project; // TODO: does xml stuff need project???
1722  m_xmlHandlerCharacters = "";
1723 
1724  m_xmlHandlerResidualsListSize = 0;
1725  m_xmlHandlerSampleResidualsListSize = 0;
1726  m_xmlHandlerLineResidualsListSize = 0;
1727  m_xmlHandlerXSigmasListSize = 0;
1728  m_xmlHandlerYSigmasListSize = 0;
1729  m_xmlHandlerZSigmasListSize = 0;
1730  m_xmlHandlerRASigmasListSize = 0;
1731  m_xmlHandlerDECSigmasListSize = 0;
1732  m_xmlHandlerTWISTSigmasListSize = 0;
1733  m_xmlHandlerStatisticsList.clear();
1734 
1735  }
1736 
1737 
1742  // do not delete this pointer... we don't own it, do we???
1743  // passed into StatCumProbDistDynCalc constructor as pointer
1744  // delete m_xmlHandlerProject; // TODO: does xml stuff need project???
1745  m_xmlHandlerProject = NULL;
1746 
1747  // delete m_xmlHandlerBundleResults;
1748  // m_xmlHandlerBundleResults = NULL;
1749 
1750  }
1751 
1752 
1764  bool BundleResults::XmlHandler::startElement(const QString &namespaceURI,
1765  const QString &localName,
1766  const QString &qName,
1767  const QXmlAttributes &atts) {
1768  m_xmlHandlerCharacters = "";
1769 
1770  if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
1771 
1772  if (qName == "correlationMatrix") {
1773  m_xmlHandlerBundleResults->m_correlationMatrix = NULL;
1774  m_xmlHandlerBundleResults->m_correlationMatrix = new CorrelationMatrix();
1775 
1776  QString correlationFileName = atts.value("correlationFileName");
1777  if (!correlationFileName.isEmpty()) {
1778  FileName correlationFile(correlationFileName);
1779  m_xmlHandlerBundleResults->m_correlationMatrix->setCorrelationFileName(correlationFile);
1780  }
1781 
1782  QString covarianceFileName = atts.value("covarianceFileName");
1783  if (!covarianceFileName.isEmpty()) {
1784  FileName covarianceFile(covarianceFileName);
1785  m_xmlHandlerBundleResults->m_correlationMatrix->setCovarianceFileName(covarianceFile);
1786  }
1787  }
1788  else if (qName == "image") {
1789  QString correlationMatrixImageId = atts.value("id");
1790  if (!correlationMatrixImageId.isEmpty()) {
1791  m_xmlHandlerCorrelationImageId = correlationMatrixImageId;
1792  }
1793  }
1794  else if (qName == "residuals") {
1795  QString rx = atts.value("x");
1796  if (!rx.isEmpty()) {
1797  m_xmlHandlerBundleResults->m_rmsXResiduals = toDouble(rx);
1798  }
1799 
1800  QString ry = atts.value("y");
1801  if (!ry.isEmpty()) {
1802  m_xmlHandlerBundleResults->m_rmsYResiduals = toDouble(ry);
1803  }
1804 
1805  QString rxy = atts.value("xy");
1806  if (!rxy.isEmpty()) {
1807  m_xmlHandlerBundleResults->m_rmsXYResiduals = toDouble(rxy);
1808  }
1809  }
1810  else if (qName == "sigmas") {
1811  QString lat = atts.value("lat");
1812  if (!lat.isEmpty()) {
1813  m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(lat);
1814  }
1815  QString lon = atts.value("lon");
1816  if (!lon.isEmpty()) {
1817  m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(lon);
1818  }
1819  QString rad = atts.value("rad");
1820  if (!rad.isEmpty()) {
1821  m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(rad);
1822  }
1823  QString x = atts.value("x");
1824  if (!x.isEmpty()) {
1825  m_xmlHandlerBundleResults->m_rmsSigmaCoord1Stats = toDouble(x);
1826  }
1827  QString y = atts.value("y");
1828  if (!y.isEmpty()) {
1829  m_xmlHandlerBundleResults->m_rmsSigmaCoord2Stats = toDouble(y);
1830  }
1831  QString z = atts.value("z");
1832  if (!z.isEmpty()) {
1833  m_xmlHandlerBundleResults->m_rmsSigmaCoord3Stats = toDouble(z);
1834  }
1835  }
1836  else if (qName == "residualsList") {
1837  QString listSizeStr = atts.value("listSize");
1838  if (!listSizeStr.isEmpty()) {
1839  m_xmlHandlerResidualsListSize = toInt(listSizeStr);
1840  }
1841  }
1842  else if (qName == "sampleList") {
1843  QString listSizeStr = atts.value("listSize");
1844  if (!listSizeStr.isEmpty()) {
1845  m_xmlHandlerSampleResidualsListSize = toInt(listSizeStr);
1846  }
1847  }
1848  else if (qName == "lineList") {
1849  QString listSizeStr = atts.value("listSize");
1850  if (!listSizeStr.isEmpty()) {
1851  m_xmlHandlerLineResidualsListSize = toInt(listSizeStr);
1852  }
1853  }
1854  else if (qName == "xSigmas") {
1855  QString listSizeStr = atts.value("listSize");
1856  if (!listSizeStr.isEmpty()) {
1857  m_xmlHandlerXSigmasListSize = toInt(listSizeStr);
1858  }
1859  }
1860  else if (qName == "ySigmas") {
1861  QString listSizeStr = atts.value("listSize");
1862  if (!listSizeStr.isEmpty()) {
1863  m_xmlHandlerYSigmasListSize = toInt(listSizeStr);
1864  }
1865  }
1866  else if (qName == "zSigmas") {
1867  QString listSizeStr = atts.value("listSize");
1868  if (!listSizeStr.isEmpty()) {
1869  m_xmlHandlerZSigmasListSize = toInt(listSizeStr);
1870  }
1871  }
1872  else if (qName == "raSigmas") {
1873  QString listSizeStr = atts.value("listSize");
1874  if (!listSizeStr.isEmpty()) {
1875  m_xmlHandlerRASigmasListSize = toInt(listSizeStr);
1876  }
1877 
1878  }
1879  else if (qName == "decSigmas") {
1880  QString listSizeStr = atts.value("listSize");
1881  if (!listSizeStr.isEmpty()) {
1882  m_xmlHandlerDECSigmasListSize = toInt(listSizeStr);
1883  }
1884  }
1885  else if (qName == "twistSigmas") {
1886  QString listSizeStr = atts.value("listSize");
1887  if (!listSizeStr.isEmpty()) {
1888  m_xmlHandlerTWISTSigmasListSize = toInt(listSizeStr);
1889  }
1890  }
1891  else if (qName == "statisticsItem") {
1892  // add statistics object to the xml handler's current statistics list.
1893  m_xmlHandlerStatisticsList.append(
1894  new Statistics(m_xmlHandlerProject, reader()));
1895  }
1896  else if (qName == "elapsedTime") {
1897  QString time = atts.value("time");
1898  if (!time.isEmpty()) {
1899  m_xmlHandlerBundleResults->m_elapsedTime = toDouble(time);
1900  }
1901 
1902  QString errorProp = atts.value("errorProp");
1903  if (!errorProp.isEmpty()) {
1904  m_xmlHandlerBundleResults->m_elapsedTimeErrorProp = toDouble(errorProp);
1905  }
1906 
1907  }
1908 // ??? else if (qName == "minMaxSigmaDistances") {
1909 // ??? QString units = atts.value("units");
1910 // ??? if (!QString::compare(units, "meters", Qt::CaseInsensitive)) {
1911 // ??? QString msg = "Unable to read BundleResults xml. Sigma distances must be "
1912 // ??? "provided in meters.";
1913 // ??? throw IException(IException::Io, msg, _FILEINFO_);
1914 // ??? }
1915 // ??? }
1916  else if (qName == "minLat") {
1917  QString minLat = atts.value("value");
1918  if (!minLat.isEmpty()) {
1919  m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minLat));
1920  }
1921 
1922  QString minLatPointId = atts.value("pointId");
1923  if (!minLatPointId.isEmpty()) {
1924  m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minLatPointId;
1925  }
1926 
1927  }
1928  else if (qName == "minX") {
1929  QString minX = atts.value("value");
1930  if (!minX.isEmpty()) {
1931  m_xmlHandlerBundleResults->m_minSigmaCoord1Distance.setMeters(toDouble(minX));
1932  }
1933 
1934  QString minXPointId = atts.value("pointId");
1935  if (!minXPointId.isEmpty()) {
1936  m_xmlHandlerBundleResults->m_minSigmaCoord1PointId = minXPointId;
1937  }
1938  }
1939  else if (qName == "maxLat") {
1940  QString maxLat = atts.value("value");
1941  if (!maxLat.isEmpty()) {
1942  m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxLat));
1943  }
1944 
1945  QString maxLatPointId = atts.value("pointId");
1946  if (!maxLatPointId.isEmpty()) {
1947  m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxLatPointId;
1948  }
1949 
1950  }
1951  else if (qName == "maxX") {
1952 
1953  QString maxX = atts.value("value");
1954  if (!maxX.isEmpty()) {
1955  m_xmlHandlerBundleResults->m_maxSigmaCoord1Distance.setMeters(toDouble(maxX));
1956  }
1957 
1958  QString maxXPointId = atts.value("pointId");
1959  if (!maxXPointId.isEmpty()) {
1960  m_xmlHandlerBundleResults->m_maxSigmaCoord1PointId = maxXPointId;
1961  }
1962 
1963  }
1964  else if (qName == "minLon") {
1965 
1966  QString minLon = atts.value("value");
1967  if (!minLon.isEmpty()) {
1968  m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minLon));
1969  }
1970 
1971  QString minLonPointId = atts.value("pointId");
1972  if (!minLonPointId.isEmpty()) {
1973  m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minLonPointId;
1974  }
1975 
1976  }
1977  else if (qName == "minY") {
1978 
1979  QString minY = atts.value("value");
1980  if (!minY.isEmpty()) {
1981  m_xmlHandlerBundleResults->m_minSigmaCoord2Distance.setMeters(toDouble(minY));
1982  }
1983 
1984  QString minYPointId = atts.value("pointId");
1985  if (!minYPointId.isEmpty()) {
1986  m_xmlHandlerBundleResults->m_minSigmaCoord2PointId = minYPointId;
1987  }
1988 
1989  }
1990  else if (qName == "maxLon") {
1991 
1992  QString maxLon = atts.value("value");
1993  if (!maxLon.isEmpty()) {
1994  m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxLon));
1995  }
1996 
1997  QString maxLonPointId = atts.value("pointId");
1998  if (!maxLonPointId.isEmpty()) {
1999  m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxLonPointId;
2000  }
2001 
2002  }
2003  else if (qName == "maxY") {
2004  QString maxY = atts.value("value");
2005  if (!maxY.isEmpty()) {
2006  m_xmlHandlerBundleResults->m_maxSigmaCoord2Distance.setMeters(toDouble(maxY));
2007  }
2008 
2009  QString maxYPointId = atts.value("pointId");
2010  if (!maxYPointId.isEmpty()) {
2011  m_xmlHandlerBundleResults->m_maxSigmaCoord2PointId = maxYPointId;
2012  }
2013 
2014  }
2015  else if (qName == "minRad") {
2016 
2017  QString minRad = atts.value("value");
2018  if (!minRad.isEmpty()) {
2019  m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minRad));
2020  }
2021 
2022  QString minRadPointId = atts.value("pointId");
2023  if (!minRadPointId.isEmpty()) {
2024  m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minRadPointId;
2025  }
2026 
2027  }
2028  else if (qName == "minZ") {
2029 
2030  QString minZ = atts.value("value");
2031  if (!minZ.isEmpty()) {
2032  m_xmlHandlerBundleResults->m_minSigmaCoord3Distance.setMeters(toDouble(minZ));
2033  }
2034 
2035  QString minZPointId = atts.value("pointId");
2036  if (!minZPointId.isEmpty()) {
2037  m_xmlHandlerBundleResults->m_minSigmaCoord3PointId = minZPointId;
2038  }
2039 
2040  }
2041  else if (qName == "maxRad") {
2042 
2043  QString maxRad = atts.value("value");
2044  if (!maxRad.isEmpty()) {
2045  m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxRad));
2046  }
2047 
2048  QString maxRadPointId = atts.value("pointId");
2049  if (!maxRadPointId.isEmpty()) {
2050  m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxRadPointId;
2051  }
2052 
2053  }
2054  else if (qName == "maxZ") {
2055 
2056  QString maxZ = atts.value("value");
2057  if (!maxZ.isEmpty()) {
2058  m_xmlHandlerBundleResults->m_maxSigmaCoord3Distance.setMeters(toDouble(maxZ));
2059  }
2060 
2061  QString maxZPointId = atts.value("pointId");
2062  if (!maxZPointId.isEmpty()) {
2063  m_xmlHandlerBundleResults->m_maxSigmaCoord3PointId = maxZPointId;
2064  }
2065 
2066  }
2067  else if (qName == "maximumLikelihoodEstimation") {
2068  QString maximumLikelihoodIndex = atts.value("maximumLikelihoodIndex");
2069  if (!maximumLikelihoodIndex.isEmpty()) {
2070  m_xmlHandlerBundleResults->m_maximumLikelihoodIndex = toInt(maximumLikelihoodIndex);
2071  }
2072 
2074  atts.value("maximumLikelihoodMedianR2Residuals");
2075  if (!maximumLikelihoodMedianR2Residuals.isEmpty()) {
2076  m_xmlHandlerBundleResults->m_maximumLikelihoodMedianR2Residuals =
2078  }
2079  }
2080  else if (qName == "model") {
2081  QString model = atts.value("modelSelection");
2082  QString tweakingConstant = atts.value("tweakingConstant");
2083  QString quantile = atts.value("quantile");
2084  bool validModel = true;
2085  if (model.isEmpty()) validModel = false;
2086  if (tweakingConstant.isEmpty()) validModel = false;
2087  if (quantile.isEmpty()) validModel = false;
2088  if (validModel) {
2089  m_xmlHandlerBundleResults->m_maximumLikelihoodFunctions.append(
2090  qMakePair(MaximumLikelihoodWFunctions(
2091  MaximumLikelihoodWFunctions::stringToModel(model),
2092  toDouble(tweakingConstant)),
2093  toDouble(quantile)));
2094  }
2095  }
2096  else if (qName == "cumulativeProbabilityCalculator") {
2097  m_xmlHandlerBundleResults->m_cumPro = NULL;
2098  m_xmlHandlerBundleResults->m_cumPro =
2099  new StatCumProbDistDynCalc(m_xmlHandlerProject, reader());
2100  }
2101  else if (qName == "residualsCumulativeProbabilityCalculator") {
2102  m_xmlHandlerBundleResults->m_cumProRes = NULL;
2103  m_xmlHandlerBundleResults->m_cumProRes = new StatCumProbDistDynCalc(m_xmlHandlerProject,
2104  reader());
2105  }
2106  }
2107  return true;
2108  }
2109 
2110 
2118  bool BundleResults::XmlHandler::characters(const QString &ch) {
2119  m_xmlHandlerCharacters += ch;
2120  return XmlStackedHandler::characters(ch);
2121  }
2122 
2123 
2133  bool BundleResults::XmlHandler::endElement(const QString &namespaceURI, const QString &localName,
2134  const QString &qName) {
2135 
2136  if (!m_xmlHandlerCharacters.isEmpty()) {
2137  if (qName == "parameter") {
2138  // add the parameter to the current list
2139  m_xmlHandlerCorrelationParameterList.append(m_xmlHandlerCharacters);
2140  }
2141  if (qName == "image") {
2142  // add this image and its parameters to the map
2143  if (m_xmlHandlerCorrelationImageId != "") {
2144  m_xmlHandlerCorrelationMap.insert(m_xmlHandlerCorrelationImageId,
2145  m_xmlHandlerCorrelationParameterList);
2146  }
2147  m_xmlHandlerCorrelationImageId = "";
2148  m_xmlHandlerCorrelationParameterList.clear();
2149 
2150  }
2151  if (qName == "imagesAndParameters") {
2152  // set the map after all images and parameters have been added
2153  if (!m_xmlHandlerCorrelationMap.isEmpty()) {
2154  m_xmlHandlerBundleResults->setCorrMatImgsAndParams(m_xmlHandlerCorrelationMap);
2155  }
2156  }
2157  else if (qName == "numberFixedPoints") {
2158  m_xmlHandlerBundleResults->m_numberFixedPoints = toInt(m_xmlHandlerCharacters);
2159  }
2160  else if (qName == "numberIgnoredPoints") {
2161  m_xmlHandlerBundleResults->m_numberIgnoredPoints = toInt(m_xmlHandlerCharacters);
2162  }
2163  else if (qName == "numberHeldImages") {
2164  m_xmlHandlerBundleResults->m_numberHeldImages = toInt(m_xmlHandlerCharacters);
2165  }
2166  else if (qName == "rejectionLimit") {
2167  m_xmlHandlerBundleResults->m_rejectionLimit = toDouble(m_xmlHandlerCharacters);
2168  }
2169  else if (qName == "numberRejectedObservations") {
2170  m_xmlHandlerBundleResults->m_numberRejectedObservations = toInt(m_xmlHandlerCharacters);
2171  }
2172  else if (qName == "numberObservations") {
2173  m_xmlHandlerBundleResults->m_numberObservations = toInt(m_xmlHandlerCharacters);
2174  }
2175  else if (qName == "numberImageParameters") {
2176  m_xmlHandlerBundleResults->m_numberImageParameters = toInt(m_xmlHandlerCharacters);
2177  }
2178  else if (qName == "numberConstrainedPointParameters") {
2179  m_xmlHandlerBundleResults->m_numberConstrainedPointParameters =
2180  toInt(m_xmlHandlerCharacters);
2181  }
2182  else if (qName == "numberConstrainedImageParameters") {
2183  m_xmlHandlerBundleResults->m_numberConstrainedImageParameters =
2184  toInt(m_xmlHandlerCharacters);
2185  }
2186  else if (qName == "numberConstrainedTargetParameters") {
2187  m_xmlHandlerBundleResults->m_numberConstrainedTargetParameters =
2188  toInt(m_xmlHandlerCharacters);
2189  }
2190  else if (qName == "numberUnknownParameters") {
2191  m_xmlHandlerBundleResults->m_numberUnknownParameters = toInt(m_xmlHandlerCharacters);
2192  }
2193  else if (qName == "degreesOfFreedom") {
2194  m_xmlHandlerBundleResults->m_degreesOfFreedom = toInt(m_xmlHandlerCharacters);
2195  }
2196  else if (qName == "sigma0") {
2197  m_xmlHandlerBundleResults->m_sigma0 = toDouble(m_xmlHandlerCharacters);
2198  }
2199  else if (qName == "converged") {
2200  m_xmlHandlerBundleResults->m_converged = toBool(m_xmlHandlerCharacters);
2201  }
2202  // copy the xml handler's statistics list to the appropriate bundle statistics list
2203  else if (qName == "residualsList") {
2204  if (m_xmlHandlerResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2206  "Unable to read xml file. Invalid residualsList", _FILEINFO_);
2207  }
2208  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2209  m_xmlHandlerBundleResults->m_rmsImageResiduals.append(m_xmlHandlerStatisticsList[i]);
2210  }
2211  m_xmlHandlerStatisticsList.clear();
2212  }
2213  else if (qName == "sampleList") {
2214  if (m_xmlHandlerSampleResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2216  "Unable to read xml file. Invalid sampleList", _FILEINFO_);
2217  }
2218  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2219  m_xmlHandlerBundleResults->m_rmsImageSampleResiduals.append(
2220  m_xmlHandlerStatisticsList[i]);
2221  }
2222  m_xmlHandlerStatisticsList.clear();
2223  }
2224  else if (qName == "lineList") {
2225  if (m_xmlHandlerLineResidualsListSize != m_xmlHandlerStatisticsList.size()) {
2227  "Unable to read xml file. Invalid lineList", _FILEINFO_);
2228  }
2229  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2230  m_xmlHandlerBundleResults->m_rmsImageLineResiduals.append(m_xmlHandlerStatisticsList[i]);
2231  }
2232  m_xmlHandlerStatisticsList.clear();
2233  }
2234  else if (qName == "xSigmas") {
2235  if (m_xmlHandlerXSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2237  "Unable to read xml file. Invalid xSigmas", _FILEINFO_);
2238  }
2239  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2240  m_xmlHandlerBundleResults->m_rmsImageXSigmas.append(m_xmlHandlerStatisticsList[i]);
2241  }
2242  m_xmlHandlerStatisticsList.clear();
2243  }
2244  else if (qName == "ySigmas") {
2245  if (m_xmlHandlerYSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2247  "Unable to read xml file. Invalid ySigmas", _FILEINFO_);
2248  }
2249  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2250  m_xmlHandlerBundleResults->m_rmsImageYSigmas.append(m_xmlHandlerStatisticsList[i]);
2251  }
2252  m_xmlHandlerStatisticsList.clear();
2253  }
2254  else if (qName == "zSigmas") {
2255  if (m_xmlHandlerZSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2257  "Unable to read xml file. Invalid zSigmas", _FILEINFO_);
2258  }
2259  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2260  m_xmlHandlerBundleResults->m_rmsImageZSigmas.append(m_xmlHandlerStatisticsList[i]);
2261  }
2262  m_xmlHandlerStatisticsList.clear();
2263  }
2264  else if (qName == "raSigmas") {
2265  if (m_xmlHandlerRASigmasListSize != m_xmlHandlerStatisticsList.size()) {
2267  "Unable to read xml file. Invalid raSigmas", _FILEINFO_);
2268  }
2269  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2270  m_xmlHandlerBundleResults->m_rmsImageRASigmas.append(m_xmlHandlerStatisticsList[i]);
2271  }
2272  m_xmlHandlerStatisticsList.clear();
2273  }
2274  else if (qName == "decSigmas") {
2275  if (m_xmlHandlerDECSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2277  "Unable to read xml file. Invalid decSigmas", _FILEINFO_);
2278  }
2279  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2280  m_xmlHandlerBundleResults->m_rmsImageDECSigmas.append(m_xmlHandlerStatisticsList[i]);
2281  }
2282  m_xmlHandlerStatisticsList.clear();
2283  }
2284  else if (qName == "twistSigmas") {
2285  if (m_xmlHandlerTWISTSigmasListSize != m_xmlHandlerStatisticsList.size()) {
2287  "Unable to read xml file. Invalid twistSigmas", _FILEINFO_);
2288  }
2289  for (int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2290  m_xmlHandlerBundleResults->m_rmsImageTWISTSigmas.append(m_xmlHandlerStatisticsList[i]);
2291  }
2292  m_xmlHandlerStatisticsList.clear();
2293  }
2294  }
2295  m_xmlHandlerCharacters = "";
2296  return XmlStackedHandler::endElement(namespaceURI, localName, qName);
2297  }
2298 }
QString m_maxSigmaCoord3PointId
The maximum sigma coordinate 3 point id.
void setObservations(BundleObservationVector observations)
Sets the vector of BundleObservations.
This class is a container class for BundleObservations.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
virtual bool characters(const QString &ch)
Adds a QString to the XmlHandler&#39;s internal character data.
BundleObservationVector m_observations
The vector of BundleObservations from BundleAdjust.
Distance m_maxSigmaCoord3Distance
The maximum sigma radius distance.
Distance minSigmaCoord2Distance() const
Returns the minimum sigma distance for coordinate 2.
void incrementFixedPoints()
Increase the number of &#39;fixed&#39; (ground) points.
void setSigmaCoord1Range(Distance minCoord1Dist, Distance maxCoord1Dist, QString minCoord1PointId, QString maxCoord1PointId)
Sets the min and max sigma distances and point ids for coordinate 1.
QString m_maxSigmaCoord2PointId
The maximum sigma coordinate2 point id.
QString maxSigmaCoord3PointId() const
Returns the maximum sigma point id for coordinate 3.
The main project for ipce.
Definition: Project.h:289
void setElapsedTime(double time)
Sets the elapsed time for the bundle adjustment.
QVector< Statistics > m_rmsImageYSigmas
< The root mean square image y sigmas.
int numberObservations() const
Returns the number of observations.
void setNumberImageParameters(int numberParameters)
Sets the number of image parameters.
StatCumProbDistDynCalc * m_cumProRes
This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels)...
void setCorrMatCovFileName(FileName name)
Set the covariance file name for the matrix used to calculate the correlation matrix.
const BundleObservationVector & observations() const
Returns a reference to the observations used by the BundleAdjust.
void setSigmaCoord3Range(Distance minCoord3Dist, Distance maxCoord3Dist, QString minCoord3PointId, QString maxCoord3PointId)
Sets the min and max sigma distances and point ids for coordinate 3.
This is a container for the correlation matrix that comes from a bundle adjust.
File name manipulation and expansion.
Definition: FileName.h:116
void resetNumberConstrainedPointParameters()
Resets the number of contrained point parameters to 0.
void save(QXmlStreamWriter &stream, const Project *project) const
Saves the BundleResults object to an XML file.
void printMaximumLikelihoodTierInformation()
Prints out information about which tier the solution is in and the status of the residuals.
double m_rmsSigmaCoord1Stats
rms of adjusted Latitude sigmas
XmlHandler(BundleResults *statistics, Project *project)
Constructs an XmlHandler used to save a BundleResults object.
QVector< Statistics > rmsImageDECSigmas() const
Returns the list of RMS image declination sigma statistics.
void incrementNumberConstrainedImageParameters(int incrementAmount)
Increase the number of constrained image parameters.
Distance m_maxSigmaCoord2Distance
The maximum sigma longitude distance.
ControlNetQsp m_outNet
The output control net from BundleAdjust.
double sigmaCoord1StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 1.
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
int m_numberHeldImages
number of &#39;held&#39; images (define)
void setRmsImageResidualLists(QList< Statistics > rmsImageLineResiduals, QList< Statistics > rmsImageSampleResiduals, QList< Statistics > rmsImageResiduals)
Sets the root mean square image residual Statistics lists.
QString m_minSigmaCoord3PointId
The minimum sigma coordinate 3 point id.
int m_numberConstrainedImageParameters
number of constrained image parameters
double sigmaCoord3StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 3.
QVector< Statistics > rmsImageZSigmas() const
Returns the list of RMS image z sigma statistics.
QList< Statistics > m_rmsImageSampleResiduals
List of RMS image sample residual statistics for each image in the bundle.
int toInt(const QString &string)
Global function to convert from a string to an integer.
Definition: IString.cpp:108
Distance m_minSigmaCoord1Distance
The minimum sigma latitude distance.
void addProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of |R^2 residuals|.
QString minSigmaCoord1PointId() const
Returns the minimum sigma point id for coordinate 1.
void setRmsFromSigmaStatistics(double rmsFromSigmaCoord1Stats, double rmsFromSigmaCoord2Stats, double rmsFromSigmaCoord3Stats)
Sets the root mean square values of the adjusted sigmas for all three coordinates.
double rejectionLimit() const
Returns the rejection limit.
void setImagesAndParameters(QMap< QString, QStringList > imagesAndParameters)
Set the qmap of images and parameters.
QVector< BundleControlPointQsp > m_bundleControlPoints
The vector of BundleControlPoints from BundleAdjust.
QVector< Statistics > m_rmsImageRASigmas
< The root mean square image right ascension sigmas.
double m_rmsYResiduals
rms of y residuals
void resetNumberConstrainedImageParameters()
Resets the number of constrained image parameters to 0.
void maximumLikelihoodSetUp(QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles)
This method steps up the maximum likelihood estimation solution.
double m_rmsSigmaCoord3Stats
rms of adjusted Radius sigmas
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Definition: IString.cpp:226
int numberFixedPoints() const
Returns the number of &#39;fixed&#39; (ground) points.
void setOutputControlNet(ControlNetQsp outNet)
Sets the output ControlNet.
void setNumberUnknownParameters(int numberParameters)
Sets the total number of parameters to solve for.
QString m_minSigmaCoord1PointId
The minimum sigma coordinate 1 point id.
void setElapsedTimeErrorProp(double time)
Sets the elapsed time for error propegation.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double toDouble(const QString &string)
Global function to convert from a string to a double.
Definition: IString.cpp:164
This error is for when a programmer made an API call that was illegal.
Definition: IException.h:162
A type of error that occurred when performing an actual I/O operation.
Definition: IException.h:171
int maximumLikelihoodModelIndex() const
Returns which step the bundle adjustment is on.
QString maxSigmaCoord1PointId() const
Returns the maximum sigma point id for coordinate 1.
Distance measurement, usually in meters.
Definition: Distance.h:47
BundleResults & operator=(const BundleResults &src)
Assignment operator for BundleResults.
double m_rejectionLimit
current rejection limit
Distance maxSigmaCoord3Distance() const
Returns the maximum sigma distance for coordinate 3.
ControlNetQsp outputControlNet() const
Returns a shared pointer to the output control network.
int numberHeldImages() const
Returns the number of &#39;held&#39; images.
StatCumProbDistDynCalc cumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the |R^2 residuals|.
void computeDegreesOfFreedom()
Computes the degrees of freedom of the bundle adjustment and stores it internally.
QVector< Statistics > m_rmsImageDECSigmas
< The root mean square image declination sigmas.
QVector< BundleControlPointQsp > & bundleControlPoints()
Returns a reference to the BundleControlPoint vector.
double m_rmsXYResiduals
rms of all x and y residuals
QVector< Statistics > rmsImageYSigmas() const
Returns the list of RMS image y sigma statistics.
StatCumProbDistDynCalc * m_cumPro
This class will be used to calculate the cumulative probability distribution of |R^2 residuals|...
Planetocentric latitudinal (lat/lon/rad) coordinates.
Definition: SurfacePoint.h:156
MaximumLikelihoodWFunctions maximumLikelihoodModelWFunc(int modelIndex) const
Returns the maximum likelihood model at the given index.
double rmsRx() const
Returns the RMS of the x residuals.
void setMeters(double distanceInMeters)
Set the distance in meters.
Definition: Distance.cpp:108
void setRejectionLimit(double rejectionLimit)
Sets the rejection limit.
int m_numberIgnoredPoints
number of ignored points
This class is used to accumulate statistics on double arrays.
Definition: Statistics.h:107
double m_elapsedTime
elapsed time for bundle
double elapsedTime() const
Returns the elapsed time for the bundle adjustment.
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
void setSigmaCoord2Range(Distance minCoord2Dist, Distance maxCoord2Dist, QString minCoord2PointId, QString maxCoord2PointId)
Sets the min and max sigma distances and point ids for coordinate 2.
StatCumProbDistDynCalc residualsCumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the residuals used for reporting.
int m_numberObservations
number of image coordinate observations
int numberConstrainedImageParameters() const
Returns the number of constrained image parameters.
Distance minSigmaCoord3Distance() const
Returns the minimum sigma distance for coordinate 3.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Handle end tags for the BundleResults serialized XML.
void setBundleControlPoints(QVector< BundleControlPointQsp > controlPoints)
Sets the bundle control point vector.
Distance m_minSigmaCoord2Distance
The minimum sigma longitude distance.
double sigmaCoord2StatisticsRms() const
Returns the RMS of the adjusted sigmas for coordinate 2.
All parameter corrections will be used to determine that the bundle adjustment has converged...
int m_numberConstrainedTargetParameters
number of constrained target parameters
void incrementIgnoredPoints()
Increase the number of ignored points.
double m_rmsXResiduals
rms of x residuals
This class is an XmlHandler used to read and write BundleResults objects from and to XML files...
double m_rmsSigmaCoord2Stats
rms of adjusted Longitude sigmas
double maximumLikelihoodModelQuantile(int modelIndex) const
Returns the quantile of the maximum likelihood model at the given index.
void incrementNumberConstrainedPointParameters(int incrementAmount)
Increase the number of contrained point parameters.
#define _FILEINFO_
Macro for the filename and line number.
Definition: IException.h:40
QList< Statistics > rmsImageSampleResiduals() const
Returns the list of RMS image sample residuals statistics.
double m_elapsedTimeErrorProp
elapsed time for error propagation
int m_numberConstrainedPointParameters
number of constrained point parameters
CorrelationMatrix correlationMatrix() const
Returns the Correlation Matrix.
virtual void pushContentHandler(XmlStackedHandler *newHandler)
Push a contentHandler and maybe continue parsing...
double m_maximumLikelihoodMedianR2Residuals
Median of R^2 residuals.
A type of error that cannot be classified as any of the other error types.
Definition: IException.h:134
void addResidualsProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of residuals used for reporting...
int m_numberRejectedObservations
number of rejected image coordinate observations
void resizeSigmaStatisticsVectors(int numberImages)
Resizes all image sigma vectors.
QVector< Statistics > rmsImageRASigmas() const
Returns the list of RMS image right ascension sigma statistics.
void computeSigma0(double dvtpv, BundleSettings::ConvergenceCriteria criteria)
Computes the sigma0 and stores it internally.
Class provides maximum likelihood estimation functions for robust parameter estimation, e.g.
void setNumberRejectedObservations(int numberObservations)
Sets the number of rejected observations.
QString minSigmaCoord2PointId() const
Returns the minimum sigma point id for coordinate 2.
QList< Statistics > rmsImageResiduals() const
Returns the list of RMS image residuals statistics.
BundleResults(QObject *parent=0)
Constructs a BundleResults object.
Distance minSigmaCoord1Distance() const
Returns the minimum sigma distance for coordinate 1.
QVector< Statistics > rmsImageXSigmas() const
Returns the list of RMS image x sigma statistics.
bool converged() const
Returns whether or not the bundle adjustment converged.
double elapsedTimeErrorProp() const
Returns the elapsed time for error propagation.
QList< QPair< MaximumLikelihoodWFunctions, double > > m_maximumLikelihoodFunctions
< The maximum likelihood models and their quantiles.
void initializeResidualsProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of residuals used for reporting...
int m_iterations
The number of iterations taken by BundleAdjust.
int m_numberUnknownParameters
total number of parameters to solve for
double rmsRxy() const
Returns the RMS of the x and y residuals.
Body-fixed rectangular x/y/z coordinates.
Definition: SurfacePoint.h:157
void setCorrMatImgsAndParams(QMap< QString, QStringList > imgsAndParams)
Set the images and their associated parameters of the correlation matrix.
double maximumLikelihoodMedianR2Residuals() const
Returns the median of the |R^2 residuals|.
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
Definition: SurfacePoint.h:155
CorrelationMatrix * m_correlationMatrix
The correlation matrix from the BundleAdjust.
void initializeProbabilityDistribution(unsigned int nodes=20)
Initializes or resets the cumulative probability distribution of |R^2 residuals|. ...
Distance m_maxSigmaCoord1Distance
The maximum sigma latitude distance.
int m_numberFixedPoints
number of &#39;fixed&#39; (ground) points (define)
int numberRejectedObservations() const
Returns the number of observation that were rejected.
QString m_maxSigmaCoord1PointId
The maximum sigma coordinate 1 point id.
QList< Statistics > rmsImageLineResiduals() const
Returns the list of RMS image line residuals statistics.
int numberMaximumLikelihoodModels() const
Returns how many maximum likelihood models were used in the bundle adjustment.
void setCovarianceFileName(FileName covarianceFileName)
Set the qmap of images and parameters.
QString minSigmaCoord3PointId() const
Returns the minimum sigma point id for coordinate 3.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double rmsRy() const
Returns the RMS of the y residuals.
void setNumberObservations(int numberObservations)
Sets the number of observations.
int m_maximumLikelihoodIndex
This count keeps track of which stage of the maximum likelihood adjustment the bundle is currently on...
QVector< Statistics > m_rmsImageZSigmas
< The root mean square image z sigmas.
int m_degreesOfFreedom
degrees of freedom
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
Definition: IString.cpp:53
int numberConstrainedTargetParameters() const
Return the number of constrained target parameters.
Distance m_minSigmaCoord3Distance
The minimum sigma radius distance.
QVector< Statistics > rmsImageTWISTSigmas() const
Returns the list of RMS image twist sigma statistics.
QList< Statistics > m_rmsImageLineResiduals
List of RMS image line residual statistics for each image in the bundle.
~XmlHandler()
Destroys an XmlHandler.
void addObs(double obs)
Values for the estimated quantile positions are update as observations are added. ...
void setRmsXYResiduals(double rx, double ry, double rxy)
Sets the root mean square of the x and y residuals.
Isis exception class.
Definition: IException.h:107
void initialize()
Initializes the BundleResults to a default state where all numeric members are set to 0 or another de...
void incrementMaximumLikelihoodModelIndex()
Increases the value that indicates which stage the maximum likelihood adjustment is currently on...
Adds specific functionality to C++ strings.
Definition: IString.h:181
~BundleResults()
Destroys this BundleResults object.
Namespace for ISIS/Bullet specific routines.
Definition: Apollo.h:31
void incrementHeldImages()
Increases the number of &#39;held&#39; images.
A container class for statistical results from a BundleAdjust solution.
Definition: BundleResults.h:96
Distance maxSigmaCoord2Distance() const
Returns the maximum sigma distance for coordinate 2.
void resetNumberConstrainedTargetParameters()
Resets the number of constrained target parameters to 0.
QString m_minSigmaCoord2PointId
The minimum sigma coordinate 2 point id.
void setSigma0(double sigma0)
Sets the sigma0.
int numberConstrainedPointParameters() const
Returns the number of constrained point parameters.
int iterations() const
Returns the number of iterations taken by the BundleAdjust.
QString maxSigmaCoord2PointId() const
Returns the maximum sigma point id for coordinate 2.
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum...
int m_numberImageParameters
number of image parameters
void incrementNumberConstrainedTargetParameters(int incrementAmount)
Increases the number of constrained target parameters.
int degreesOfFreedom() const
Returns the degrees of freedom.
void setConverged(bool converged)
Sets if the bundle adjustment converged.
void setIterations(int iterations)
Sets the number of iterations taken by the BundleAdjust.
int numberImageParameters() const
Returns the total number of image parameters.
double m_sigma0
std deviation of unit weight
Manage a stack of content handlers for reading XML files.
QList< Statistics > m_rmsImageResiduals
RMS image sample and line residual statistics for each image in the bundle.
double sigma0() const
Returns the Sigma0 of the bundle adjustment.
Distance maxSigmaCoord1Distance() const
Returns the maximum sigma distance for coordinate 1.
int numberUnknownParameters() const
Returns the number of unknown parameters.
int numberIgnoredPoints() const
Returns the number of ignored points.
ConvergenceCriteria
This enum defines the options for the bundle adjustment&#39;s convergence.
void setDegreesOfFreedom(double degreesOfFreedom)
Sets the degrees of freedom.
QVector< Statistics > m_rmsImageTWISTSigmas
< The root mean square image twist sigmas.