8 #include <QXmlStreamWriter>
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>
33 #include "XmlStackedHandlerReader.h"
35 using namespace boost::numeric::ublas;
48 m_id =
new QUuid(QUuid::createUuid());
74 xmlReader->pushContentHandler(
new XmlHandler(
this, project));
75 xmlReader->setErrorHandler(
new XmlHandler(
this, project));
100 : m_id(new QUuid(src.m_id->
toString())),
102 m_numberFixedPoints(src.m_numberFixedPoints),
103 m_numberIgnoredPoints(src.m_numberIgnoredPoints),
104 m_numberHeldImages(src.m_numberHeldImages),
105 m_rmsXResiduals(src.m_rmsXResiduals),
106 m_rmsYResiduals(src.m_rmsYResiduals),
107 m_rmsXYResiduals(src.m_rmsXYResiduals),
108 m_rejectionLimit(src.m_rejectionLimit),
109 m_numberObservations(src.m_numberObservations),
110 m_numberRejectedObservations(src.m_numberRejectedObservations),
111 m_numberUnknownParameters(src.m_numberUnknownParameters),
112 m_numberImageParameters(src.m_numberImageParameters),
113 m_numberConstrainedImageParameters(src.m_numberConstrainedImageParameters),
114 m_numberConstrainedPointParameters(src.m_numberConstrainedPointParameters),
115 m_numberConstrainedTargetParameters(src.m_numberConstrainedTargetParameters),
116 m_degreesOfFreedom(src.m_degreesOfFreedom),
117 m_sigma0(src.m_sigma0),
118 m_elapsedTime(src.m_elapsedTime),
119 m_elapsedTimeErrorProp(src.m_elapsedTimeErrorProp),
120 m_radiansToMeters(src.m_radiansToMeters),
121 m_converged(src.m_converged),
122 m_bundleControlPoints(src.m_bundleControlPoints),
123 m_outNet(src.m_outNet),
124 m_iterations(src.m_iterations),
125 m_observations(src.m_observations),
126 m_rmsImageSampleResiduals(src.m_rmsImageSampleResiduals),
127 m_rmsImageLineResiduals(src.m_rmsImageLineResiduals),
128 m_rmsImageResiduals(src.m_rmsImageResiduals),
129 m_rmsImageXSigmas(src.m_rmsImageXSigmas),
130 m_rmsImageYSigmas(src.m_rmsImageYSigmas),
131 m_rmsImageZSigmas(src.m_rmsImageZSigmas),
132 m_rmsImageRASigmas(src.m_rmsImageRASigmas),
133 m_rmsImageDECSigmas(src.m_rmsImageDECSigmas),
134 m_rmsImageTWISTSigmas(src.m_rmsImageTWISTSigmas),
135 m_minSigmaLatitudeDistance(src.m_minSigmaLatitudeDistance),
136 m_maxSigmaLatitudeDistance(src.m_maxSigmaLatitudeDistance),
137 m_minSigmaLongitudeDistance(src.m_minSigmaLongitudeDistance),
138 m_maxSigmaLongitudeDistance(src.m_maxSigmaLongitudeDistance),
139 m_minSigmaRadiusDistance(src.m_minSigmaRadiusDistance),
140 m_maxSigmaRadiusDistance(src.m_maxSigmaRadiusDistance),
141 m_minSigmaLatitudePointId(src.m_minSigmaLatitudePointId),
142 m_maxSigmaLatitudePointId(src.m_maxSigmaLatitudePointId),
143 m_minSigmaLongitudePointId(src.m_minSigmaLongitudePointId),
144 m_maxSigmaLongitudePointId(src.m_maxSigmaLongitudePointId),
145 m_minSigmaRadiusPointId(src.m_minSigmaRadiusPointId),
146 m_maxSigmaRadiusPointId(src.m_maxSigmaRadiusPointId),
147 m_rmsSigmaLatitudeStats(src.m_rmsSigmaLatitudeStats),
148 m_rmsSigmaLongitudeStats(src.m_rmsSigmaLongitudeStats),
149 m_rmsSigmaRadiusStats(src.m_rmsSigmaRadiusStats),
150 m_maximumLikelihoodFunctions(src.m_maximumLikelihoodFunctions),
151 m_maximumLikelihoodIndex(src.m_maximumLikelihoodIndex),
154 m_maximumLikelihoodMedianR2Residuals(src.m_maximumLikelihoodMedianR2Residuals) {
190 m_id =
new QUuid(src.
m_id->toString());
193 m_correlationMatrix = NULL;
215 m_converged = src.m_converged;
223 m_rmsImageXSigmas = src.m_rmsImageXSigmas;
281 m_rmsImageXSigmas.clear();
360 m_rmsImageXSigmas.resize(numberImages);
406 QString minLatPointId, QString maxLatPointId) {
423 QString minLonPointId, QString maxLonPointId) {
440 QString minRadPointId, QString maxRadPointId) {
457 double rmsFromSigmaLonStats,
458 double rmsFromSigmaRadStats) {
487 for (
int i = 0; i < modelsWithQuantiles.size(); i++) {
500 modelsWithQuantiles[i].second));
938 return m_rmsImageXSigmas;
1332 "Output Control Network has not been set.",
1462 pvl +=
PvlKeyword(
"NumberConstrainedPointParameters",
1464 pvl +=
PvlKeyword(
"NumberConstrainedImageParameters",
1466 pvl +=
PvlKeyword(
"NumberConstrainedTargetParameters",
1505 PvlKeyword models(
"MaximumLikelihoodModels");
1506 PvlKeyword quantiles(
"MaximumLikelihoodQuantiles");
1515 pvl +=
PvlKeyword(
"MaximumLikelihoodMedianR2Residuals",
1523 pvl +=
PvlKeyword(
"CorrelationMatrix",
"None");
1543 "Correlation matrix for this bundle is NULL.",
1580 stream.writeStartElement(
"bundleResults");
1581 stream.writeTextElement(
"id",
m_id->toString());
1585 stream.writeStartElement(
"correlationMatrix");
1586 stream.writeAttribute(
"correlationFileName",
1588 stream.writeAttribute(
"covarianceFileName",
1590 stream.writeStartElement(
"imagesAndParameters");
1591 QMapIterator<QString, QStringList> imgParamIt(*
correlationMatrix().imagesAndParameters());
1592 while (imgParamIt.hasNext()) {
1594 stream.writeStartElement(
"image");
1595 stream.writeAttribute(
"id", imgParamIt.key());
1597 for (
int i = 0; i < parameters.size(); i++) {
1598 stream.writeTextElement(
"parameter", parameters[i]);
1600 stream.writeEndElement();
1603 stream.writeEndElement();
1604 stream.writeEndElement();
1606 stream.writeStartElement(
"generalStatisticsValues");
1614 stream.writeTextElement(
"numberConstrainedPointParameters",
1616 stream.writeTextElement(
"numberConstrainedImageParameters",
1618 stream.writeTextElement(
"numberConstrainedTargetParameters",
1624 stream.writeEndElement();
1626 stream.writeStartElement(
"rms");
1627 stream.writeStartElement(
"residuals");
1631 stream.writeEndElement();
1632 stream.writeStartElement(
"sigmas");
1636 stream.writeEndElement();
1638 stream.writeStartElement(
"imageResidualsLists");
1639 stream.writeStartElement(
"residualsList");
1642 stream.writeStartElement(
"statisticsItem");
1644 stream.writeEndElement();
1646 stream.writeEndElement();
1647 stream.writeStartElement(
"sampleList");
1650 stream.writeStartElement(
"statisticsItem");
1652 stream.writeEndElement();
1654 stream.writeEndElement();
1656 stream.writeStartElement(
"lineList");
1659 stream.writeStartElement(
"statisticsItem");
1661 stream.writeEndElement();
1663 stream.writeEndElement();
1664 stream.writeEndElement();
1666 stream.writeStartElement(
"imageSigmasLists");
1667 stream.writeStartElement(
"xSigmas");
1669 for (
int i = 0; i < m_rmsImageXSigmas.size(); i++) {
1670 stream.writeStartElement(
"statisticsItem");
1671 m_rmsImageXSigmas[i].save(stream, project);
1672 stream.writeEndElement();
1675 stream.writeEndElement();
1677 stream.writeStartElement(
"ySigmas");
1680 stream.writeStartElement(
"statisticsItem");
1682 stream.writeEndElement();
1684 stream.writeEndElement();
1686 stream.writeStartElement(
"zSigmas");
1689 stream.writeStartElement(
"statisticsItem");
1691 stream.writeEndElement();
1693 stream.writeEndElement();
1695 stream.writeStartElement(
"raSigmas");
1698 stream.writeStartElement(
"statisticsItem");
1700 stream.writeEndElement();
1702 stream.writeEndElement();
1704 stream.writeStartElement(
"decSigmas");
1707 stream.writeStartElement(
"statisticsItem");
1709 stream.writeEndElement();
1711 stream.writeEndElement();
1713 stream.writeStartElement(
"twistSigmas");
1716 stream.writeStartElement(
"statisticsItem");
1718 stream.writeEndElement();
1720 stream.writeEndElement();
1721 stream.writeEndElement();
1722 stream.writeEndElement();
1724 stream.writeStartElement(
"elapsedTime");
1727 stream.writeEndElement();
1729 stream.writeStartElement(
"minMaxSigmas");
1730 stream.writeStartElement(
"minLat");
1733 stream.writeEndElement();
1734 stream.writeStartElement(
"maxLat");
1737 stream.writeEndElement();
1738 stream.writeStartElement(
"minLon");
1741 stream.writeEndElement();
1742 stream.writeStartElement(
"maxLon");
1745 stream.writeEndElement();
1746 stream.writeStartElement(
"minRad");
1749 stream.writeEndElement();
1750 stream.writeStartElement(
"maxRad");
1753 stream.writeEndElement();
1754 stream.writeEndElement();
1757 stream.writeStartElement(
"maximumLikelihoodEstimation");
1760 stream.writeAttribute(
"maximumLikelihoodMedianR2Residuals",
1763 stream.writeStartElement(
"cumulativeProbabilityCalculator");
1765 stream.writeEndElement();
1767 stream.writeStartElement(
"residualsCumulativeProbabilityCalculator");
1769 stream.writeEndElement();
1772 stream.writeStartElement(
"model");
1773 stream.writeAttribute(
"modelNumber",
toString(i+1));
1774 stream.writeAttribute(
"modelSelection",
1776 stream.writeAttribute(
"tweakingConstant",
1779 stream.writeEndElement();
1781 stream.writeEndElement();
1782 stream.writeEndElement();
1794 m_xmlHandlerBundleResults = NULL;
1795 m_xmlHandlerProject = NULL;
1797 m_xmlHandlerBundleResults = statistics;
1798 m_xmlHandlerProject = project;
1799 m_xmlHandlerCharacters =
"";
1801 m_xmlHandlerResidualsListSize = 0;
1802 m_xmlHandlerSampleResidualsListSize = 0;
1803 m_xmlHandlerLineResidualsListSize = 0;
1804 m_xmlHandlerXSigmasListSize = 0;
1805 m_xmlHandlerYSigmasListSize = 0;
1806 m_xmlHandlerZSigmasListSize = 0;
1807 m_xmlHandlerRASigmasListSize = 0;
1808 m_xmlHandlerDECSigmasListSize = 0;
1809 m_xmlHandlerTWISTSigmasListSize = 0;
1810 m_xmlHandlerStatisticsList.clear();
1822 m_xmlHandlerProject = NULL;
1841 const QString &localName,
1842 const QString &qName,
1843 const QXmlAttributes &atts) {
1844 m_xmlHandlerCharacters =
"";
1846 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, atts)) {
1848 if (qName ==
"correlationMatrix") {
1850 m_xmlHandlerBundleResults->m_correlationMatrix = NULL;
1853 QString correlationFileName = atts.value(
"correlationFileName");
1854 if (!correlationFileName.isEmpty()) {
1855 FileName correlationFile(correlationFileName);
1856 m_xmlHandlerBundleResults->m_correlationMatrix->setCorrelationFileName(correlationFile);
1859 QString covarianceFileName = atts.value(
"covarianceFileName");
1860 if (!covarianceFileName.isEmpty()) {
1861 FileName covarianceFile(covarianceFileName);
1862 m_xmlHandlerBundleResults->m_correlationMatrix->setCovarianceFileName(covarianceFile);
1866 else if (qName ==
"image") {
1867 QString correlationMatrixImageId = atts.value(
"id");
1868 if (!correlationMatrixImageId.isEmpty()) {
1869 m_xmlHandlerCorrelationImageId = correlationMatrixImageId;
1872 else if (qName ==
"residuals") {
1874 QString rx = atts.value(
"x");
1875 if (!rx.isEmpty()) {
1876 m_xmlHandlerBundleResults->m_rmsXResiduals =
toDouble(rx);
1879 QString ry = atts.value(
"y");
1880 if (!ry.isEmpty()) {
1881 m_xmlHandlerBundleResults->m_rmsYResiduals =
toDouble(ry);
1884 QString rxy = atts.value(
"xy");
1885 if (!rxy.isEmpty()) {
1886 m_xmlHandlerBundleResults->m_rmsXYResiduals =
toDouble(rxy);
1890 else if (qName ==
"sigmas") {
1892 QString lat = atts.value(
"lat");
1893 if (!lat.isEmpty()) {
1894 m_xmlHandlerBundleResults->m_rmsSigmaLatitudeStats =
toDouble(lat);
1897 QString lon = atts.value(
"lon");
1898 if (!lon.isEmpty()) {
1899 m_xmlHandlerBundleResults->m_rmsSigmaLongitudeStats =
toDouble(lon);
1902 QString rad = atts.value(
"rad");
1903 if (!rad.isEmpty()) {
1904 m_xmlHandlerBundleResults->m_rmsSigmaRadiusStats =
toDouble(rad);
1908 else if (qName ==
"residualsList") {
1910 QString listSizeStr = atts.value(
"listSize");
1911 if (!listSizeStr.isEmpty()) {
1912 m_xmlHandlerResidualsListSize =
toInt(listSizeStr);
1916 else if (qName ==
"sampleList") {
1918 QString listSizeStr = atts.value(
"listSize");
1919 if (!listSizeStr.isEmpty()) {
1920 m_xmlHandlerSampleResidualsListSize =
toInt(listSizeStr);
1924 else if (qName ==
"lineList") {
1926 QString listSizeStr = atts.value(
"listSize");
1927 if (!listSizeStr.isEmpty()) {
1928 m_xmlHandlerLineResidualsListSize =
toInt(listSizeStr);
1932 else if (qName ==
"xSigmas") {
1934 QString listSizeStr = atts.value(
"listSize");
1935 if (!listSizeStr.isEmpty()) {
1936 m_xmlHandlerXSigmasListSize =
toInt(listSizeStr);
1940 else if (qName ==
"ySigmas") {
1942 QString listSizeStr = atts.value(
"listSize");
1943 if (!listSizeStr.isEmpty()) {
1944 m_xmlHandlerYSigmasListSize =
toInt(listSizeStr);
1948 else if (qName ==
"zSigmas") {
1950 QString listSizeStr = atts.value(
"listSize");
1951 if (!listSizeStr.isEmpty()) {
1952 m_xmlHandlerZSigmasListSize =
toInt(listSizeStr);
1956 else if (qName ==
"raSigmas") {
1958 QString listSizeStr = atts.value(
"listSize");
1959 if (!listSizeStr.isEmpty()) {
1960 m_xmlHandlerRASigmasListSize =
toInt(listSizeStr);
1964 else if (qName ==
"decSigmas") {
1966 QString listSizeStr = atts.value(
"listSize");
1967 if (!listSizeStr.isEmpty()) {
1968 m_xmlHandlerDECSigmasListSize =
toInt(listSizeStr);
1972 else if (qName ==
"twistSigmas") {
1974 QString listSizeStr = atts.value(
"listSize");
1975 if (!listSizeStr.isEmpty()) {
1976 m_xmlHandlerTWISTSigmasListSize =
toInt(listSizeStr);
1980 else if (qName ==
"statisticsItem") {
1982 m_xmlHandlerStatisticsList.append(
1983 new Statistics(m_xmlHandlerProject, reader()));
1985 else if (qName ==
"elapsedTime") {
1987 QString time = atts.value(
"time");
1988 if (!time.isEmpty()) {
1989 m_xmlHandlerBundleResults->m_elapsedTime =
toDouble(time);
1992 QString errorProp = atts.value(
"errorProp");
1993 if (!errorProp.isEmpty()) {
1994 m_xmlHandlerBundleResults->m_elapsedTimeErrorProp =
toDouble(errorProp);
2006 else if (qName ==
"minLat") {
2008 QString minLat = atts.value(
"value");
2009 if (!minLat.isEmpty()) {
2010 m_xmlHandlerBundleResults->m_minSigmaLatitudeDistance.setMeters(
toDouble(minLat));
2013 QString minLatPointId = atts.value(
"pointId");
2014 if (!minLatPointId.isEmpty()) {
2015 m_xmlHandlerBundleResults->m_minSigmaLatitudePointId = minLatPointId;
2019 else if (qName ==
"maxLat") {
2021 QString maxLat = atts.value(
"value");
2022 if (!maxLat.isEmpty()) {
2023 m_xmlHandlerBundleResults->m_maxSigmaLatitudeDistance.setMeters(
toDouble(maxLat));
2026 QString maxLatPointId = atts.value(
"pointId");
2027 if (!maxLatPointId.isEmpty()) {
2028 m_xmlHandlerBundleResults->m_maxSigmaLatitudePointId = maxLatPointId;
2032 else if (qName ==
"minLon") {
2034 QString minLon = atts.value(
"value");
2035 if (!minLon.isEmpty()) {
2036 m_xmlHandlerBundleResults->m_minSigmaLongitudeDistance.setMeters(
toDouble(minLon));
2039 QString minLonPointId = atts.value(
"pointId");
2040 if (!minLonPointId.isEmpty()) {
2041 m_xmlHandlerBundleResults->m_minSigmaLongitudePointId = minLonPointId;
2045 else if (qName ==
"maxLon") {
2047 QString maxLon = atts.value(
"value");
2048 if (!maxLon.isEmpty()) {
2049 m_xmlHandlerBundleResults->m_maxSigmaLongitudeDistance.setMeters(
toDouble(maxLon));
2052 QString maxLonPointId = atts.value(
"pointId");
2053 if (!maxLonPointId.isEmpty()) {
2054 m_xmlHandlerBundleResults->m_maxSigmaLongitudePointId = maxLonPointId;
2058 else if (qName ==
"minRad") {
2060 QString minRad = atts.value(
"value");
2061 if (!minRad.isEmpty()) {
2062 m_xmlHandlerBundleResults->m_minSigmaRadiusDistance.setMeters(
toDouble(minRad));
2065 QString minRadPointId = atts.value(
"pointId");
2066 if (!minRadPointId.isEmpty()) {
2067 m_xmlHandlerBundleResults->m_minSigmaRadiusPointId = minRadPointId;
2071 else if (qName ==
"maxRad") {
2073 QString maxRad = atts.value(
"value");
2074 if (!maxRad.isEmpty()) {
2075 m_xmlHandlerBundleResults->m_maxSigmaRadiusDistance.setMeters(
toDouble(maxRad));
2078 QString maxRadPointId = atts.value(
"pointId");
2079 if (!maxRadPointId.isEmpty()) {
2080 m_xmlHandlerBundleResults->m_maxSigmaRadiusPointId = maxRadPointId;
2084 else if (qName ==
"maximumLikelihoodEstimation") {
2086 QString maximumLikelihoodIndex = atts.value(
"maximumLikelihoodIndex");
2087 if (!maximumLikelihoodIndex.isEmpty()) {
2088 m_xmlHandlerBundleResults->m_maximumLikelihoodIndex =
toInt(maximumLikelihoodIndex);
2092 atts.value(
"maximumLikelihoodMedianR2Residuals");
2093 if (!maximumLikelihoodMedianR2Residuals.isEmpty()) {
2094 m_xmlHandlerBundleResults->m_maximumLikelihoodMedianR2Residuals =
2095 toDouble(maximumLikelihoodMedianR2Residuals);
2099 else if (qName ==
"model") {
2100 QString model = atts.value(
"modelSelection");
2101 QString tweakingConstant = atts.value(
"tweakingConstant");
2102 QString quantile = atts.value(
"quantile");
2103 bool validModel =
true;
2104 if (model.isEmpty()) validModel =
false;
2105 if (tweakingConstant.isEmpty()) validModel =
false;
2106 if (quantile.isEmpty()) validModel =
false;
2108 m_xmlHandlerBundleResults->m_maximumLikelihoodFunctions.append(
2110 MaximumLikelihoodWFunctions::stringToModel(model),
2115 else if (qName ==
"cumulativeProbabilityCalculator") {
2116 m_xmlHandlerBundleResults->m_cumPro = NULL;
2117 m_xmlHandlerBundleResults->m_cumPro =
2120 else if (qName ==
"residualsCumulativeProbabilityCalculator") {
2121 m_xmlHandlerBundleResults->m_cumProRes = NULL;
2138 m_xmlHandlerCharacters += ch;
2139 return XmlStackedHandler::characters(ch);
2153 const QString &qName) {
2155 if (!m_xmlHandlerCharacters.isEmpty()) {
2156 if (qName ==
"id") {
2157 m_xmlHandlerBundleResults->m_id = NULL;
2158 m_xmlHandlerBundleResults->m_id =
new QUuid(m_xmlHandlerCharacters);
2163 if (qName ==
"parameter") {
2165 m_xmlHandlerCorrelationParameterList.append(m_xmlHandlerCharacters);
2167 if (qName ==
"image") {
2169 if (m_xmlHandlerCorrelationImageId !=
"") {
2170 m_xmlHandlerCorrelationMap.insert(m_xmlHandlerCorrelationImageId,
2171 m_xmlHandlerCorrelationParameterList);
2173 m_xmlHandlerCorrelationImageId =
"";
2174 m_xmlHandlerCorrelationParameterList.clear();
2177 if (qName ==
"imagesAndParameters") {
2179 if (!m_xmlHandlerCorrelationMap.isEmpty()) {
2180 m_xmlHandlerBundleResults->setCorrMatImgsAndParams(m_xmlHandlerCorrelationMap);
2183 else if (qName ==
"numberFixedPoints") {
2184 m_xmlHandlerBundleResults->m_numberFixedPoints =
toInt(m_xmlHandlerCharacters);
2186 else if (qName ==
"numberIgnoredPoints") {
2187 m_xmlHandlerBundleResults->m_numberIgnoredPoints =
toInt(m_xmlHandlerCharacters);
2189 else if (qName ==
"numberHeldImages") {
2190 m_xmlHandlerBundleResults->m_numberHeldImages =
toInt(m_xmlHandlerCharacters);
2192 else if (qName ==
"rejectionLimit") {
2193 m_xmlHandlerBundleResults->m_rejectionLimit =
toDouble(m_xmlHandlerCharacters);
2195 else if (qName ==
"numberRejectedObservations") {
2196 m_xmlHandlerBundleResults->m_numberRejectedObservations =
toInt(m_xmlHandlerCharacters);
2198 else if (qName ==
"numberObservations") {
2199 m_xmlHandlerBundleResults->m_numberObservations =
toInt(m_xmlHandlerCharacters);
2201 else if (qName ==
"numberImageParameters") {
2202 m_xmlHandlerBundleResults->m_numberImageParameters =
toInt(m_xmlHandlerCharacters);
2204 else if (qName ==
"numberConstrainedPointParameters") {
2205 m_xmlHandlerBundleResults->m_numberConstrainedPointParameters =
2206 toInt(m_xmlHandlerCharacters);
2208 else if (qName ==
"numberConstrainedImageParameters") {
2209 m_xmlHandlerBundleResults->m_numberConstrainedImageParameters =
2210 toInt(m_xmlHandlerCharacters);
2212 else if (qName ==
"numberConstrainedTargetParameters") {
2213 m_xmlHandlerBundleResults->m_numberConstrainedTargetParameters =
2214 toInt(m_xmlHandlerCharacters);
2216 else if (qName ==
"numberUnknownParameters") {
2217 m_xmlHandlerBundleResults->m_numberUnknownParameters =
toInt(m_xmlHandlerCharacters);
2219 else if (qName ==
"degreesOfFreedom") {
2220 m_xmlHandlerBundleResults->m_degreesOfFreedom =
toInt(m_xmlHandlerCharacters);
2222 else if (qName ==
"sigma0") {
2223 m_xmlHandlerBundleResults->m_sigma0 =
toDouble(m_xmlHandlerCharacters);
2225 else if (qName ==
"converged") {
2226 m_xmlHandlerBundleResults->m_converged =
toBool(m_xmlHandlerCharacters);
2229 else if (qName ==
"residualsList") {
2235 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2236 m_xmlHandlerBundleResults->m_rmsImageResiduals.append(m_xmlHandlerStatisticsList[i]);
2238 m_xmlHandlerStatisticsList.clear();
2240 else if (qName ==
"sampleList") {
2245 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2246 m_xmlHandlerBundleResults->m_rmsImageSampleResiduals.append(
2247 m_xmlHandlerStatisticsList[i]);
2249 m_xmlHandlerStatisticsList.clear();
2251 else if (qName ==
"lineList") {
2256 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2257 m_xmlHandlerBundleResults->m_rmsImageLineResiduals.append(m_xmlHandlerStatisticsList[i]);
2259 m_xmlHandlerStatisticsList.clear();
2261 else if (qName ==
"xSigmas") {
2266 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2267 m_xmlHandlerBundleResults->m_rmsImageXSigmas.append(m_xmlHandlerStatisticsList[i]);
2269 m_xmlHandlerStatisticsList.clear();
2271 else if (qName ==
"ySigmas") {
2276 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2277 m_xmlHandlerBundleResults->m_rmsImageYSigmas.append(m_xmlHandlerStatisticsList[i]);
2279 m_xmlHandlerStatisticsList.clear();
2281 else if (qName ==
"zSigmas") {
2286 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2287 m_xmlHandlerBundleResults->m_rmsImageZSigmas.append(m_xmlHandlerStatisticsList[i]);
2289 m_xmlHandlerStatisticsList.clear();
2291 else if (qName ==
"raSigmas") {
2296 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2297 m_xmlHandlerBundleResults->m_rmsImageRASigmas.append(m_xmlHandlerStatisticsList[i]);
2299 m_xmlHandlerStatisticsList.clear();
2301 else if (qName ==
"decSigmas") {
2306 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2307 m_xmlHandlerBundleResults->m_rmsImageDECSigmas.append(m_xmlHandlerStatisticsList[i]);
2309 m_xmlHandlerStatisticsList.clear();
2311 else if (qName ==
"twistSigmas") {
2316 for (
int i = 0; i < m_xmlHandlerStatisticsList.size(); i++) {
2317 m_xmlHandlerBundleResults->m_rmsImageTWISTSigmas.append(m_xmlHandlerStatisticsList[i]);
2319 m_xmlHandlerStatisticsList.clear();
2322 m_xmlHandlerCharacters =
"";
2323 return XmlStackedHandler::endElement(namespaceURI, localName, qName);
2336 stream <<
m_id->toString()
2414 stream >> m_converged;
2433 stream >> maximumLikelihoodIndex;
2434 stream >> cumPro >> cumProRes;
2438 m_id =
new QUuid(
id);
2484 return bundleResults.
write(stream);
2499 return bundleResults.
read(stream);
2513 void BundleResults::createH5Group(H5::CommonFG &locationObject, QString locationName)
const {
2524 QString resultsGroupName = locationName +
"/BundleResults";
2525 H5::Group resultsGroup = locationObject.createGroup(resultsGroupName.toLatin1());
2528 H5::DataSpace spc(H5S_SCALAR);
2534 H5::StrType strDataType;
2541 stringSize = qMax(correlationFileName.length(), 1);
2542 strDataType = H5::StrType(H5::PredType::C_S1, stringSize);
2543 att = resultsGroup.createAttribute(
"correlationFileName", strDataType, spc);
2544 att.write(strDataType, correlationFileName.toStdString());
2547 stringSize = qMax(covarianceFileName.length(), 1);
2548 strDataType = H5::StrType(H5::PredType::C_S1, stringSize);
2549 att = resultsGroup.createAttribute(
"covarianceFileName", strDataType, spc);
2550 att.write(strDataType, covarianceFileName.toStdString());
2560 att = resultsGroup.createAttribute(
"numberFixedPoints",
2561 H5::PredType::NATIVE_INT,
2565 att = resultsGroup.createAttribute(
"numberIgnoredPoints",
2566 H5::PredType::NATIVE_INT,
2570 att = resultsGroup.createAttribute(
"numberHeldImages",
2571 H5::PredType::NATIVE_INT,
2575 att = resultsGroup.createAttribute(
"numberObservations",
2576 H5::PredType::NATIVE_INT,
2581 att = resultsGroup.createAttribute(
"numberRejectedObservations",
2582 H5::PredType::NATIVE_INT,
2586 att = resultsGroup.createAttribute(
"numberImageParameters",
2587 H5::PredType::NATIVE_INT,
2591 att = resultsGroup.createAttribute(
"numberConstrainedPointParameters",
2592 H5::PredType::NATIVE_INT,
2596 att = resultsGroup.createAttribute(
"numberConstrainedImageParameters",
2597 H5::PredType::NATIVE_INT,
2601 att = resultsGroup.createAttribute(
"numberUnknownParameters",
2602 H5::PredType::NATIVE_INT,
2606 att = resultsGroup.createAttribute(
"degreesOfFreedom",
2607 H5::PredType::NATIVE_INT,
2614 att = resultsGroup.createAttribute(
"rejectionLimit",
2615 H5::PredType::NATIVE_DOUBLE,
2619 att = resultsGroup.createAttribute(
"sigma0",
2620 H5::PredType::NATIVE_DOUBLE,
2622 att.write(H5::PredType::NATIVE_DOUBLE, &
m_sigma0);
2624 att = resultsGroup.createAttribute(
"elapsedTime",
2625 H5::PredType::NATIVE_DOUBLE,
2629 att = resultsGroup.createAttribute(
"elapsedTimeErrorProp",
2630 H5::PredType::NATIVE_DOUBLE,
2635 att = resultsGroup.createAttribute(
"rmsXResiduals",
2636 H5::PredType::NATIVE_DOUBLE,
2640 att = resultsGroup.createAttribute(
"rmsYResiduals",
2641 H5::PredType::NATIVE_DOUBLE,
2645 att = resultsGroup.createAttribute(
"rmsXYResiduals",
2646 H5::PredType::NATIVE_DOUBLE,
2650 att = resultsGroup.createAttribute(
"rmsSigmaLatitudeStats",
2651 H5::PredType::NATIVE_DOUBLE,
2655 att = resultsGroup.createAttribute(
"rmsSigmaLongitudeStats",
2656 H5::PredType::NATIVE_DOUBLE,
2660 att = resultsGroup.createAttribute(
"rmsSigmaRadiusStats",
2661 H5::PredType::NATIVE_DOUBLE,
2668 att = resultsGroup.createAttribute(
"converged",
2669 H5::PredType::NATIVE_HBOOL,
2672 att.write(H5::PredType::NATIVE_HBOOL, &converged);
2676 QString dataSetName;
2677 H5::DataSet dataSet;
2690 dims[0] = (hsize_t)listLength;
2691 H5::DataSpace dataSetSpace(1, dims);
2693 dataSetName = resultsGroupName +
"/RmsImageLineResidualsStatistics";
2694 dataSet = resultsGroup.createDataSet(dataSetName.toLatin1(),
2698 QByteArray byteArray;
2699 QDataStream stream(&byteArray, QIODevice::WriteOnly);
2700 stream.setByteOrder(QDataStream::LittleEndian);
2701 for (
int i = 0; i < listLength; i++) {
2704 char *buf = byteArray.data();
2705 dataSet.write(buf, compoundDataType);
2717 dims[0] = (hsize_t)listLength;
2718 H5::DataSpace dataSetSpace(1, dims);
2720 dataSetName = resultsGroupName +
"/RmsImageSampleResidualsStatistics";
2721 dataSet = resultsGroup.createDataSet(dataSetName.toLatin1(),
2725 QByteArray byteArray;
2726 QDataStream stream(&byteArray, QIODevice::WriteOnly);
2727 stream.setByteOrder(QDataStream::LittleEndian);
2728 for (
int i = 0; i < listLength; i++) {
2731 char *buf = byteArray.data();
2732 dataSet.write(buf, compoundDataType);
2744 dims[0] = (hsize_t)listLength;
2745 H5::DataSpace dataSetSpace(1, dims);
2747 dataSetName = resultsGroupName +
"/RmsImageResidualsStatistics";
2748 dataSet = resultsGroup.createDataSet(dataSetName.toLatin1(),
2752 QByteArray byteArray;
2753 QDataStream stream(&byteArray, QIODevice::WriteOnly);
2754 stream.setByteOrder(QDataStream::LittleEndian);
2755 for (
int i = 0; i < listLength; i++) {
2758 char *buf = byteArray.data();
2759 dataSet.write(buf, compoundDataType);
2765 catch ( H5::AttributeIException error ) {
2766 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2768 msg =
"H5 ATTRIBUTE exception handler has detected an error when invoking the function "
2769 + QString::fromStdString(error.getFuncName()) +
".";
2773 catch ( H5::DataSetIException error ) {
2774 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2776 msg =
"H5 DATA SET exception handler has detected an error when invoking the function "
2777 + QString::fromStdString(error.getFuncName()) +
".";
2781 catch ( H5::DataSpaceIException error ) {
2782 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2784 msg =
"H5 DATA SPACE exception handler has detected an error when invoking the function "
2785 + QString::fromStdString(error.getFuncName()) +
".";
2789 catch ( H5::DataTypeIException error ) {
2790 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2792 msg =
"H5 DATA TYPE exception handler has detected an error when invoking the function "
2793 + QString::fromStdString(error.getFuncName()) +
".";
2797 catch ( H5::FileIException error ) {
2798 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2800 msg =
"H5 FILE exception handler has detected an error when invoking the function "
2801 + QString::fromStdString(error.getFuncName()) +
".";
2805 catch ( H5::GroupIException error ) {
2806 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2808 msg =
"H5 GROUP exception handler has detected an error when invoking the function "
2809 + QString::fromStdString(error.getFuncName()) +
".";
2813 catch ( H5::Exception error ) {
2814 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2816 msg =
"H5 GENERAL exception handler has detected an error when invoking the function "
2817 + QString::fromStdString(error.getFuncName()) +
".";
2824 "Unable to save bundle results information to an HDF5 group.",
2852 QString resultsGroupName = locationName +
"/BundleResults";
2853 H5::Group resultsGroup = locationObject.openGroup(resultsGroupName.toLatin1());
2864 H5::StrType strDataType;
2865 H5std_string strAttValue;
2867 att = resultsGroup.openAttribute(
"correlationFileName");
2868 strDataType = H5::StrType(H5::PredType::C_S1, att.getStorageSize());
2869 att.read(strDataType, strAttValue);
2872 att = resultsGroup.openAttribute(
"covarianceFileName");
2873 strDataType = H5::StrType(H5::PredType::C_S1, att.getStorageSize());
2874 att.read(strDataType, strAttValue);
2886 att = resultsGroup.openAttribute(
"numberFixedPoints");
2889 att = resultsGroup.openAttribute(
"numberIgnoredPoints");
2892 att = resultsGroup.openAttribute(
"numberHeldImages");
2895 att = resultsGroup.openAttribute(
"numberObservations");
2898 att = resultsGroup.openAttribute(
"numberRejectedObservations");
2901 att = resultsGroup.openAttribute(
"numberImageParameters");
2904 att = resultsGroup.openAttribute(
"numberConstrainedImageParameters");
2907 att = resultsGroup.openAttribute(
"numberConstrainedPointParameters");
2910 att = resultsGroup.openAttribute(
"numberUnknownParameters");
2913 att = resultsGroup.openAttribute(
"degreesOfFreedom");
2919 att = resultsGroup.openAttribute(
"rejectionLimit");
2922 att = resultsGroup.openAttribute(
"sigma0");
2923 att.read(H5::PredType::NATIVE_DOUBLE, &
m_sigma0);
2925 att = resultsGroup.openAttribute(
"elapsedTime");
2928 att = resultsGroup.openAttribute(
"elapsedTimeErrorProp");
2932 att = resultsGroup.openAttribute(
"rmsXResiduals");
2935 att = resultsGroup.openAttribute(
"rmsYResiduals");
2938 att = resultsGroup.openAttribute(
"rmsXYResiduals");
2941 att = resultsGroup.openAttribute(
"rmsSigmaLatitudeStats");
2944 att = resultsGroup.openAttribute(
"rmsSigmaLongitudeStats");
2947 att = resultsGroup.openAttribute(
"rmsSigmaRadiusStats");
2953 int boolAttValue = 0;
2954 att = resultsGroup.openAttribute(
"converged");
2955 att.read(H5::PredType::NATIVE_HBOOL, &boolAttValue);
2956 m_converged = (bool)boolAttValue;
2961 QString dataSetName =
"";
2962 H5::DataSet dataSet;
2967 dataSetName = resultsGroupName +
"/RmsImageLineResidualsStatistics";
2968 herr_t status = H5Gget_objinfo(resultsGroup.getId(), dataSetName.toLatin1(), 0, NULL);
2971 qDebug() <<
"didn't find or couldn't read stats list.";
2977 resultsGroup.getObjinfo(dataSetName.toLatin1(), info);
2979 dataSet = resultsGroup.openDataSet(dataSetName.toLatin1());
2980 H5::DataSpace dataSetSpace = dataSet.getSpace();
2982 char statsList[dataSet.getStorageSize()];
2983 dataSet.read(statsList, compoundDataType);
2985 int listLength = dataSetSpace.getSimpleExtentNpoints();
2986 int statsSize = compoundDataType.getSize();
2987 for (
int i = 0; i < listLength; i++) {
2988 QByteArray byteArray(&(statsList[i*statsSize]), statsSize);
2989 QDataStream stream(&byteArray, QIODevice::ReadOnly);
2990 stream.setByteOrder(QDataStream::LittleEndian);
2993 stream >> tempStats;
2998 catch (H5::GroupIException groupError) {
3005 dataSetName = resultsGroupName +
"/RmsImageSampleResidualsStatistics";
3006 herr_t status = H5Gget_objinfo(resultsGroup.getId(), dataSetName.toLatin1(), 0, NULL);
3009 qDebug() <<
"didn't find or couldn't read stats list.";
3015 resultsGroup.getObjinfo(dataSetName.toLatin1(), info);
3017 dataSet = resultsGroup.openDataSet(dataSetName.toLatin1());
3018 H5::DataSpace dataSetSpace = dataSet.getSpace();
3020 char statsList[dataSet.getStorageSize()];
3021 dataSet.read(statsList, compoundDataType);
3023 int listLength = dataSetSpace.getSimpleExtentNpoints();
3024 int statsSize = compoundDataType.getSize();
3025 for (
int i = 0; i < listLength; i++) {
3026 QByteArray byteArray(&(statsList[i*statsSize]), statsSize);
3027 QDataStream stream(&byteArray, QIODevice::ReadOnly);
3028 stream.setByteOrder(QDataStream::LittleEndian);
3031 stream >> tempStats;
3036 catch (H5::GroupIException groupError) {
3042 dataSetName = resultsGroupName +
"/RmsImageResidualsStatistics";
3043 herr_t status = H5Gget_objinfo(resultsGroup.getId(), dataSetName.toLatin1(), 0, NULL);
3046 qDebug() <<
"didn't find or couldn't read stats list.";
3052 resultsGroup.getObjinfo(dataSetName.toLatin1(), info);
3054 dataSet = resultsGroup.openDataSet(dataSetName.toLatin1());
3055 H5::DataSpace dataSetSpace = dataSet.getSpace();
3057 char statsList[dataSet.getStorageSize()];
3058 dataSet.read(statsList, compoundDataType);
3060 int listLength = dataSetSpace.getSimpleExtentNpoints();
3061 int statsSize = compoundDataType.getSize();
3062 for (
int i = 0; i < listLength; i++) {
3063 QByteArray byteArray(&(statsList[i*statsSize]), statsSize);
3064 QDataStream stream(&byteArray, QIODevice::ReadOnly);
3065 stream.setByteOrder(QDataStream::LittleEndian);
3068 stream >> tempStats;
3073 catch (H5::GroupIException groupError) {
3078 catch (H5::Exception error) {
3079 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
3081 msg =
"H5 GENERAL exception handler has detected an error when invoking the function "
3082 + QString::fromStdString(error.getFuncName()) +
".";
3089 "Unable to read bundle results information to an HDF5 group.",
QDataStream & read(QDataStream &stream)
Reads the data from a QDataStream into the BundleResults object.
void save(QXmlStreamWriter &stream, const Project *project) const
Saves the BundleResults object to an XML file.
void setObservations(BundleObservationVector observations)
Sets the vector of BundleObservations.
double sigmaLongitudeStatisticsRms() const
Returns the RMS of the adjusted longitude sigmas.
This class is a container class for BundleObservations.
double rmsRy() const
Returns the RMS of the y residuals.
int numberHeldImages() const
Returns the number of 'held' images.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Writes a starting XML element.
virtual bool characters(const QString &ch)
Adds a QString to the XmlHandler's internal character data.
BundleObservationVector m_observations
The vector of BundleObservations from BundleAdjust.
QString minSigmaRadiusPointId() const
Returns the minimum sigma radius point id.
void incrementFixedPoints()
Increase the number of 'fixed' (ground) points.
Distance m_minSigmaLongitudeDistance
The minimum sigma longitude distance.
The main project for cnetsuite.
void setElapsedTime(double time)
Sets the elapsed time for the bundle adjustment.
QVector< Statistics > m_rmsImageYSigmas
< The root mean square image y sigmas.
void setNumberImageParameters(int numberParameters)
Sets the number of image parameters.
int iterations() const
Returns the number of iterations taken by the BundleAdjust.
void setRmsFromSigmaStatistics(double rmsFromSigmaLatStats, double rmsFromSigmaLonStats, double rmsFromSigmaRadStats)
Sets the root mean square values of the adjusted latitiude sigmas, adjusted longitude sigmas...
StatCumProbDistDynCalc * m_cumProRes
This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels)...
QString m_maxSigmaLongitudePointId
The maximum sigma longitude point id.
void setCorrMatCovFileName(FileName name)
Set the covariance file name for the matrix used to calculate the correlation matrix.
This is a container for the correlation matrix that comes from a bundle adjust.
static H5::CompType compoundH5DataType()
H5 compound data type uses the offesets from the QDataStream returned by the write(QDataStream &strea...
FileName covarianceFileName()
Public access for the covariance matrix file name.
File name manipulation and expansion.
void resetNumberConstrainedPointParameters()
Resets the number of contrained point parameters to 0.
QString minSigmaLongitudePointId() const
Returns the minimum sigma longitude point id.
Distance m_minSigmaRadiusDistance
The minimum sigma radius distance.
QSharedPointer< ControlNet > ControlNetQsp
This typedef is for future implementation of target body.
const BundleObservationVector & observations() const
Returns a reference to the observations used by the BundleAdjust.
QString maxSigmaRadiusPointId() const
Returns the maximum sigma radius point id.
void printMaximumLikelihoodTierInformation()
Prints out information about which tier the solution is in and the status of the residuals.
void setCorrelationFileName(FileName correlationFileName)
Set the qmap of images and parameters.
QString m_minSigmaLongitudePointId
The minimum sigma longitude point id.
XmlHandler(BundleResults *statistics, Project *project)
Constructs an XmlHandler used to save a BundleResults object.
Distance m_maxSigmaLatitudeDistance
The maximum sigma latitude distance.
void incrementNumberConstrainedImageParameters(int incrementAmount)
Increase the number of constrained image parameters.
FileName correlationFileName()
Public access for the correlation matrix file name.
ControlNetQsp m_outNet
The output control net from BundleAdjust.
QString maxSigmaLongitudePointId() const
Returns the maximum sigma longitude point id.
double value(double cumProb)
Provides the value of the variable that has the given cumulative probility (according the current est...
int numberConstrainedTargetParameters() const
Return the number of constrained target parameters.
double m_rmsSigmaRadiusStats
rms of adjusted Radius sigmas
QVector< Statistics > rmsImageDECSigmas() const
Returns the list of RMS image declination sigma statistics.
int m_numberHeldImages
number of 'held' images (define)
void setRmsImageResidualLists(QList< Statistics > rmsImageLineResiduals, QList< Statistics > rmsImageSampleResiduals, QList< Statistics > rmsImageResiduals)
Sets the root mean square image residual Statistics lists.
QString m_maxSigmaLatitudePointId
The maximum sigma latitude point id.
int m_numberConstrainedImageParameters
number of constrained image parameters
double m_radiansToMeters
radian to meters conversion factor for the body
CorrelationMatrix correlationMatrix() const
Returns the Correlation Matrix.
Distance minSigmaLatitudeDistance() const
Returns the minimum sigma latitude distance.
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.
void addProbabilityDistributionObservation(double obsValue)
Adds an observation to the cumulative probability distribution of |R^2 residuals|.
void setImagesAndParameters(QMap< QString, QStringList > imagesAndParameters)
Set the qmap of images and parameters.
QString m_maxSigmaRadiusPointId
The maximum sigma radius point id.
QVector< BundleControlPointQsp > m_bundleControlPoints
The vector of BundleControlPoints from BundleAdjust.
QVector< Statistics > m_rmsImageRASigmas
< The root mean square image right ascension sigmas.
void setSigmaLongitudeRange(Distance minLonDist, Distance maxLonDist, QString minLonPointId, QString maxLonPointId)
Sets the min and max sigma longitude distances and point ids.
double sigma0() const
Returns the Sigma0 of the bundle adjustment.
double m_rmsYResiduals
rms of y residuals
int numberImageParameters() const
Returns the total number of image parameters.
void resetNumberConstrainedImageParameters()
Resets the number of constrained image parameters to 0.
int numberIgnoredPoints() const
Returns the number of ignored points.
void maximumLikelihoodSetUp(QList< QPair< MaximumLikelihoodWFunctions::Model, double > > modelsWithQuantiles)
This method steps up the maximum likelihood estimation solution.
QString m_minSigmaRadiusPointId
The minimum sigma radius point id.
double sigmaLatitudeStatisticsRms() const
Returns the RMS of the adjusted latitude sigmas.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
void setOutputControlNet(ControlNetQsp outNet)
Sets the output ControlNet.
void setNumberUnknownParameters(int numberParameters)
Sets the total number of parameters to solve for.
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.
This error is for when a programmer made an API call that was illegal.
A type of error that occurred when performing an actual I/O operation.
Distance measurement, usually in meters.
BundleResults & operator=(const BundleResults &src)
Assignment operator for BundleResults.
double m_rejectionLimit
current rejection limit
double rejectionLimit() const
Returns the rejection limit.
ControlNetQsp outputControlNet() const
Returns a shared pointer to the output control network.
void computeDegreesOfFreedom()
Computes the degrees of freedom of the bundle adjustment and stores it internally.
QVector< Statistics > rmsImageXSigmas() const
Returns the list of RMS image x sigma statistics.
double elapsedTimeErrorProp() const
Returns the elapsed time for error propagation.
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
StatCumProbDistDynCalc * m_cumPro
This class will be used to calculate the cumulative probability distribution of |R^2 residuals|...
int degreesOfFreedom() const
Returns the degrees of freedom.
StatCumProbDistDynCalc cumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the |R^2 residuals|.
PvlObject pvlObject()
This method creates a Pvl group with the information necessary to recreate this correlation matrix...
QVector< Statistics > rmsImageTWISTSigmas() const
Returns the list of RMS image twist sigma statistics.
void setMeters(double distanceInMeters)
Set the distance in meters.
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.
double m_elapsedTime
elapsed time for bundle
This class is used to approximate cumulative probibility distributions of a stream of observations wi...
double meters() const
Get the distance in meters.
int numberRejectedObservations() const
Returns the number of observation that were rejected.
int m_numberObservations
number of image coordinate observations
int maximumLikelihoodModelIndex() const
Returns which step the bundle adjustment is on.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
Writes an ending XML element.
void setBundleControlPoints(QVector< BundleControlPointQsp > controlPoints)
Sets the bundle control point vector.
StatCumProbDistDynCalc residualsCumulativeProbabilityDistribution() const
Returns the cumulative probability distribution of the residuals used for reporting.
All parameter corrections will be used to determine that the bundle adjustment has converged...
QVector< Statistics > rmsImageYSigmas() const
Returns the list of RMS image y sigma statistics.
int numberFixedPoints() const
Returns the number of 'fixed' (ground) points.
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 maximumLikelihoodMedianR2Residuals() const
Returns the median of the |R^2 residuals|.
void incrementNumberConstrainedPointParameters(int incrementAmount)
Increase the number of contrained point parameters.
#define _FILEINFO_
Macro for the filename and line number.
double m_elapsedTimeErrorProp
elapsed time for error propagation
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
int m_numberConstrainedPointParameters
number of constrained point parameters
QList< Statistics > rmsImageResiduals() const
Returns the list of RMS image residuals statistics.
A single keyword-value pair.
double m_maximumLikelihoodMedianR2Residuals
Median of R^2 residuals.
A type of error that cannot be classified as any of the other error types.
QVector< Statistics > rmsImageZSigmas() const
Returns the list of RMS image z sigma statistics.
QString maxSigmaLatitudePointId() const
Returns the maximum sigma latitude point id.
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
Distance m_minSigmaLatitudeDistance
The minimum sigma latitude distance.
void resizeSigmaStatisticsVectors(int numberImages)
Resizes all image sigma vectors.
double sigmaRadiusStatisticsRms() const
Returns the RMS of the adjusted raidus sigmas.
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.
Distance m_maxSigmaRadiusDistance
The maximum sigma radius distance.
BundleResults(QObject *parent=0)
Constructs a BundleSettings object.
Distance minSigmaRadiusDistance() const
Returns the minimum sigma redius distance.
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
void openH5Group(H5::CommonFG &locationObject, QString locationName)
Reads from an hdf5 group.
void setCorrMatImgsAndParams(QMap< QString, QStringList > imgsAndParams)
Set the images and their associated parameters of the correlation matrix.
QDataStream & write(QDataStream &stream) const
Writes the BundleResults object to a QDataStream.
QString minSigmaLatitudePointId() const
Returns the minimum sigma latitude point id.
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|. ...
int m_numberFixedPoints
number of 'fixed' (ground) points (define)
bool converged() const
Returns whether or not the bundle adjustment converged.
int numberObservations() const
Returns the number of observations.
void setCovarianceFileName(FileName covarianceFileName)
Set the qmap of images and parameters.
Distance maxSigmaLongitudeDistance() const
Returns the maximum sigma longitude distance.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
int numberConstrainedImageParameters() const
Returns the number of constrained image parameters.
QVector< Statistics > rmsImageRASigmas() const
Returns the list of RMS image right ascension sigma statistics.
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...
QString m_minSigmaLatitudePointId
The minimum sigma latitude point id.
QVector< Statistics > m_rmsImageZSigmas
< The root mean square image z sigmas.
Distance maxSigmaLatitudeDistance() const
Returns the maximum sigma latitude distance.
int m_degreesOfFreedom
degrees of freedom
void setSigmaLatitudeRange(Distance minLatDist, Distance maxLatDist, QString minLatPointId, QString maxLatPointId)
Sets the min and max sigma latitude distances and point ids.
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
void setRadiansToMeters(double rtm)
Sets the radians to meters conversion constant for the target body.
QList< Statistics > m_rmsImageLineResiduals
List of RMS image line residual statistics for each image in the bundle.
int numberUnknownParameters() const
Returns the number of unknown parameters.
~XmlHandler()
Destroys an XmlHandler.
QList< Statistics > rmsImageSampleResiduals() const
Returns the list of RMS image sample residuals statistics.
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.
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...
double m_rmsSigmaLatitudeStats
rms of adjusted Latitude sigmas
~BundleResults()
Destroys this BundleResults object.
void incrementHeldImages()
Increases the number of 'held' images.
A container class for statistical results from a BundleAdjust solution.
Distance maxSigmaRadiusDistance() const
Returns the maximum sigma redius distance.
void resetNumberConstrainedTargetParameters()
Resets the number of constrained target parameters to 0.
PvlObject pvlObject(QString name="BundleResults") const
Saves the BundleResults object as a PvlObject.
double elapsedTime() const
Returns the elapsed time for the bundle adjustment.
QList< Statistics > rmsImageLineResiduals() const
Returns the list of RMS image line residuals statistics.
void setSigmaRadiusRange(Distance minRadDist, Distance maxRadDist, QString minRadPointId, QString maxRadPointId)
Sets the min and max sigma radius distances and point ids.
double rmsRx() const
Returns the RMS of the x residuals.
void setSigma0(double sigma0)
Sets the sigma0.
double m_rmsSigmaLongitudeStats
rms of adjusted Longitude sigmas
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum...
Distance minSigmaLongitudeDistance() const
Returns the minimum sigma longitude distance.
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
int m_numberImageParameters
number of image parameters
void incrementNumberConstrainedTargetParameters(int incrementAmount)
Increases the number of constrained target parameters.
void setConverged(bool converged)
Sets if the bundle adjustment converged.
Contains Pvl Groups and Pvl Objects.
void setIterations(int iterations)
Sets the number of iterations taken by the BundleAdjust.
int numberConstrainedPointParameters() const
Returns the number of constrained point parameters.
double radiansToMeters() const
Returns the radians to meters conversion factor for the target body.
Distance m_maxSigmaLongitudeDistance
The maximum sigma longitude distance.
double m_sigma0
std deviation of unit weight
his enables stack-based XML parsing of XML files.
QList< Statistics > m_rmsImageResiduals
RMS image sample and line residual statistics for each image in the bundle.
double rmsRxy() const
Returns the RMS of the x and y residuals.
MaximumLikelihoodWFunctions maximumLikelihoodModelWFunc(int modelIndex) const
Returns the maximum likelihood model at the given index.
QUuid * m_id
A unique ID for this object (useful for others to reference this object when saving to disk)...
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
void setDegreesOfFreedom(double degreesOfFreedom)
Sets the degrees of freedom.
void addValue(QString value, QString unit="")
Adds a value with units.
QVector< Statistics > m_rmsImageTWISTSigmas
< The root mean square image twist sigmas.
int numberMaximumLikelihoodModels() const
Returns how many maximum likelihood models were used in the bundle adjustment.
double maximumLikelihoodModelQuantile(int modelIndex) const
Returns the quantile of the maximum likelihood model at the given index.