10 #include <QXmlStreamWriter>
11 #include <QXmlInputSource>
25 #include "XmlStackedHandlerReader.h"
39 m_id =
new QUuid(QUuid::createUuid());
58 m_observationSolveSettings.append(defaultSolveSettings);
103 xmlReader->pushContentHandler(
new XmlHandler(
this, project));
104 xmlReader->setErrorHandler(
new XmlHandler(
this, project));
127 QString xmlPath = xmlFile.expanded();
128 QFile qXmlFile(xmlPath);
129 if (!qXmlFile.open(QFile::ReadOnly) ) {
131 QString(
"Unable to open xml file, [%1], with read access").arg(xmlPath),
135 QXmlInputSource xmlInputSource(&qXmlFile);
137 xmlReader->pushContentHandler(
new XmlHandler(
this, project));
138 xmlReader->setErrorHandler(
new XmlHandler(
this, project));
139 bool success = xmlReader->parse(xmlInputSource);
142 QString(
"Failed to parse xml file, [%1]").arg(xmlPath),
154 xmlReader->pushContentHandler(
new XmlHandler(
this));
155 xmlReader->setErrorHandler(
new XmlHandler(
this));
174 : m_id(new QUuid(other.m_id->
toString())),
175 m_validateNetwork(other.m_validateNetwork),
176 m_solveObservationMode(other.m_solveObservationMode),
177 m_solveRadius(other.m_solveRadius),
178 m_updateCubeLabel(other.m_updateCubeLabel),
179 m_errorPropagation(other.m_errorPropagation),
180 m_createInverseMatrix(other.m_createInverseMatrix),
181 m_outlierRejection(other.m_outlierRejection),
182 m_outlierRejectionMultiplier(other.m_outlierRejectionMultiplier),
183 m_globalLatitudeAprioriSigma(other.m_globalLatitudeAprioriSigma),
184 m_globalLongitudeAprioriSigma(other.m_globalLongitudeAprioriSigma),
185 m_globalRadiusAprioriSigma(other.m_globalRadiusAprioriSigma),
186 m_observationSolveSettings(other.m_observationSolveSettings),
187 m_convergenceCriteria(other.m_convergenceCriteria),
188 m_convergenceCriteriaThreshold(other.m_convergenceCriteriaThreshold),
189 m_convergenceCriteriaMaximumIterations(other.m_convergenceCriteriaMaximumIterations),
190 m_maximumLikelihood(other.m_maximumLikelihood),
191 m_solveTargetBody(other.m_solveTargetBody),
192 m_bundleTargetBody(other.m_bundleTargetBody),
193 m_outputFilePrefix(other.m_outputFilePrefix){
215 if (&other !=
this) {
218 m_id =
new QUuid(other.
m_id->toString());
231 m_observationSolveSettings = other.m_observationSolveSettings;
294 bool updateCubeLabel,
295 bool errorPropagation,
297 double globalLatitudeAprioriSigma,
298 double globalLongitudeAprioriSigma,
299 double globalRadiusAprioriSigma) {
305 if (globalLatitudeAprioriSigma > 0.0) {
312 if (globalLongitudeAprioriSigma > 0.0) {
355 m_observationSolveSettings = obsSolveSettingsList;
500 return m_observationSolveSettings.size();
521 if (m_observationSolveSettings[i].observationNumbers().contains(observationNumber)) {
522 return m_observationSolveSettings[i];
525 QString msg =
"Unable to find BundleObservationSolveSettings for observation number ["
526 + observationNumber +
"].";
546 return m_observationSolveSettings[n];
548 QString msg =
"Unable to find BundleObservationSolveSettings with index = ["
575 if (criteria.compare(
"SIGMA0", Qt::CaseInsensitive) == 0) {
578 else if (criteria.compare(
"PARAMETERCORRECTIONS", Qt::CaseInsensitive) == 0) {
582 "Unknown bundle convergence criteria [" + criteria +
"].",
600 if (criteria ==
Sigma0)
return "Sigma0";
603 "Unknown convergence criteria enum [" +
toString(criteria) +
"].",
620 int maximumIterations) {
701 double maxModelCQuantile) {
704 QString msg =
"For bundle adjustments with multiple maximum likelihood estimators, the first "
705 "model must be of type HUBER or HUBER_MODIFIED.";
1042 pvl +=
PvlKeyword(
"GlobalLatitudeAprioriSigma",
"None");
1048 pvl +=
PvlKeyword(
"GlobalLongitudeAprioriSigma",
"None");
1055 pvl +=
PvlKeyword(
"GlobalRadiiAprioriSigma",
"None");
1062 pvl +=
PvlKeyword(
"ConvergenceCriteriaMaximumIterations",
1082 PvlKeyword models(
"MaximumLikelihoodModels");
1087 PvlKeyword quantiles(
"MaximumLikelihoodQuantiles",
1106 pvl += bundleObsSolveSettingsPvl;
1123 stream.writeStartElement(
"bundleSettings");
1125 stream.writeStartElement(
"globalSettings");
1127 stream.writeTextElement(
"id",
m_id->toString());
1130 stream.writeStartElement(
"solveOptions");
1136 stream.writeEndElement();
1138 stream.writeStartElement(
"aprioriSigmas");
1140 stream.writeAttribute(
"latitude",
"N/A");
1146 stream.writeAttribute(
"longitude",
"N/A");
1152 stream.writeAttribute(
"radius",
"N/A");
1157 stream.writeEndElement();
1159 stream.writeStartElement(
"outlierRejectionOptions");
1165 stream.writeAttribute(
"multiplier",
"N/A");
1167 stream.writeEndElement();
1169 stream.writeStartElement(
"convergenceCriteriaOptions");
1170 stream.writeAttribute(
"convergenceCriteria",
1172 stream.writeAttribute(
"threshold",
1174 stream.writeAttribute(
"maximumIterations",
1176 stream.writeEndElement();
1178 stream.writeStartElement(
"maximumLikelihoodEstimation");
1180 stream.writeStartElement(
"model");
1181 stream.writeAttribute(
"type",
1184 stream.writeEndElement();
1186 stream.writeEndElement();
1188 stream.writeStartElement(
"outputFileOptions");
1190 stream.writeEndElement();
1192 stream.writeEndElement();
1194 if (!m_observationSolveSettings.isEmpty()) {
1195 stream.writeStartElement(
"observationSolveSettingsList");
1196 for (
int i = 0; i < m_observationSolveSettings.size(); i++) {
1197 m_observationSolveSettings[i].save(stream, project);
1199 stream.writeEndElement();
1210 stream.writeStartDocument(
"1.0");
1212 stream.writeStartElement(
"globalSettings");
1214 stream.writeTextElement(
"id",
m_id->toString());
1217 stream.writeStartElement(
"solveOptions");
1222 stream.writeEndElement();
1224 stream.writeStartElement(
"aprioriSigmas");
1231 stream.writeTextElement(
"radius",
"N/A");
1233 stream.writeEndElement();
1235 stream.writeStartElement(
"outlierRejectionOptions");
1241 stream.writeTextElement(
"multiplier",
"N/A");
1243 stream.writeEndElement();
1245 stream.writeStartElement(
"convergenceCriteriaOptions");
1249 stream.writeEndElement();
1251 stream.writeStartElement(
"maximumLikelihoodEstimation");
1253 stream.writeStartElement(
"model");
1254 stream.writeAttribute(
"type",
1257 stream.writeEndElement();
1259 stream.writeEndElement();
1261 stream.writeStartElement(
"outputFileOptions");
1263 stream.writeEndElement();
1265 stream.writeEndElement();
1267 stream.writeStartElement(
"observationSolveSettingsList");
1269 for (
int i = 0; i < m_observationSolveSettings.size(); i++) {
1270 stream.writeStartElement(
"observationSolveSettings");
1271 m_observationSolveSettings[i].save(stream, project);
1272 stream.writeEndElement();
1274 stream.writeEndElement();
1276 stream.writeEndElement();
1289 m_xmlHandlerBundleSettings = bundleSettings;
1290 m_xmlHandlerProject = project;
1291 m_xmlHandlerCharacters =
"";
1292 m_xmlHandlerObservationSettings.clear();
1323 m_xmlHandlerProject = NULL;
1337 const QString &localName,
1338 const QString &qName,
1339 const QXmlAttributes &attributes) {
1340 m_xmlHandlerCharacters =
"";
1342 if (XmlStackedHandler::startElement(namespaceURI, localName, qName, attributes)) {
1344 if (localName ==
"solveOptions") {
1346 QString solveObservationModeStr = attributes.value(
"solveObservationMode");
1347 if (!solveObservationModeStr.isEmpty()) {
1348 m_xmlHandlerBundleSettings->m_solveObservationMode =
toBool(solveObservationModeStr);
1351 QString solveRadiusStr = attributes.value(
"solveRadius");
1352 if (!solveRadiusStr.isEmpty()) {
1353 m_xmlHandlerBundleSettings->m_solveRadius =
toBool(solveRadiusStr);
1356 QString updateCubeLabelStr = attributes.value(
"updateCubeLabel");
1357 if (!updateCubeLabelStr.isEmpty()) {
1358 m_xmlHandlerBundleSettings->m_updateCubeLabel =
toBool(updateCubeLabelStr);
1361 QString errorPropagationStr = attributes.value(
"errorPropagation");
1362 if (!errorPropagationStr.isEmpty()) {
1363 m_xmlHandlerBundleSettings->m_errorPropagation =
toBool(errorPropagationStr);
1366 QString createInverseMatrixStr = attributes.value(
"createInverseMatrix");
1367 if (!createInverseMatrixStr.isEmpty()) {
1368 m_xmlHandlerBundleSettings->m_createInverseMatrix =
toBool(createInverseMatrixStr);
1371 else if (localName ==
"aprioriSigmas") {
1373 QString globalLatitudeAprioriSigmaStr = attributes.value(
"latitude");
1374 m_xmlHandlerBundleSettings->m_globalLatitudeAprioriSigma =
Isis::Null;
1376 if (!globalLatitudeAprioriSigmaStr.isEmpty()) {
1377 if (globalLatitudeAprioriSigmaStr ==
"N/A") {
1378 m_xmlHandlerBundleSettings->m_globalLatitudeAprioriSigma =
Isis::Null;
1381 m_xmlHandlerBundleSettings->m_globalLatitudeAprioriSigma
1382 =
toDouble(globalLatitudeAprioriSigmaStr);
1386 QString globalLongitudeAprioriSigmaStr = attributes.value(
"longitude");
1387 if (!globalLongitudeAprioriSigmaStr.isEmpty()) {
1388 if (globalLongitudeAprioriSigmaStr ==
"N/A") {
1389 m_xmlHandlerBundleSettings->m_globalLongitudeAprioriSigma =
Isis::Null;
1392 m_xmlHandlerBundleSettings->m_globalLongitudeAprioriSigma
1393 =
toDouble(globalLongitudeAprioriSigmaStr);
1397 QString globalRadiusAprioriSigmaStr = attributes.value(
"radius");
1398 if (!globalRadiusAprioriSigmaStr.isEmpty()) {
1399 if (globalRadiusAprioriSigmaStr ==
"N/A") {
1400 m_xmlHandlerBundleSettings->m_globalRadiusAprioriSigma =
Isis::Null;
1403 m_xmlHandlerBundleSettings->m_globalRadiusAprioriSigma
1404 =
toDouble(globalRadiusAprioriSigmaStr);
1408 else if (localName ==
"outlierRejectionOptions") {
1409 QString outlierRejectionStr = attributes.value(
"rejection");
1410 if (!outlierRejectionStr.isEmpty()) {
1411 m_xmlHandlerBundleSettings->m_outlierRejection =
toBool(outlierRejectionStr);
1414 QString outlierRejectionMultiplierStr = attributes.value(
"multiplier");
1415 if (!outlierRejectionMultiplierStr.isEmpty()) {
1416 if (outlierRejectionMultiplierStr !=
"N/A") {
1417 m_xmlHandlerBundleSettings->m_outlierRejectionMultiplier
1418 =
toDouble(outlierRejectionMultiplierStr);
1421 m_xmlHandlerBundleSettings->m_outlierRejectionMultiplier = 1.0;
1425 else if (localName ==
"convergenceCriteriaOptions") {
1427 QString convergenceCriteriaStr = attributes.value(
"convergenceCriteria");
1428 if (!convergenceCriteriaStr.isEmpty()) {
1429 m_xmlHandlerBundleSettings->m_convergenceCriteria
1433 QString convergenceCriteriaThresholdStr = attributes.value(
"threshold");
1434 if (!convergenceCriteriaThresholdStr.isEmpty()) {
1435 m_xmlHandlerBundleSettings->m_convergenceCriteriaThreshold
1436 =
toDouble(convergenceCriteriaThresholdStr);
1439 QString convergenceCriteriaMaximumIterationsStr = attributes.value(
"maximumIterations");
1440 if (!convergenceCriteriaMaximumIterationsStr.isEmpty()) {
1441 m_xmlHandlerBundleSettings->m_convergenceCriteriaMaximumIterations
1442 =
toInt(convergenceCriteriaMaximumIterationsStr);
1445 else if (localName ==
"model") {
1446 QString type = attributes.value(
"type");
1447 QString quantile = attributes.value(
"quantile");
1448 if (!type.isEmpty() && !quantile.isEmpty()) {
1449 m_xmlHandlerBundleSettings->m_maximumLikelihood.append(
1450 qMakePair(MaximumLikelihoodWFunctions::stringToModel(type),
1454 else if (localName ==
"outputFileOptions") {
1455 QString outputFilePrefixStr = attributes.value(
"fileNamePrefix");
1456 if (!outputFilePrefixStr.isEmpty()) {
1457 m_xmlHandlerBundleSettings->m_outputFilePrefix = outputFilePrefixStr;
1460 else if (localName ==
"bundleObservationSolveSettings") {
1461 m_xmlHandlerObservationSettings.append(
1477 m_xmlHandlerCharacters += ch;
1478 return XmlStackedHandler::characters(ch);
1490 const QString &qName) {
1491 if (!m_xmlHandlerCharacters.isEmpty()) {
1492 if (localName ==
"id") {
1493 m_xmlHandlerBundleSettings->m_id = NULL;
1494 m_xmlHandlerBundleSettings->m_id =
new QUuid(m_xmlHandlerCharacters);
1496 else if (localName ==
"validateNetwork") {
1497 m_xmlHandlerBundleSettings->m_validateNetwork =
toBool(m_xmlHandlerCharacters);
1499 else if (localName ==
"observationSolveSettingsList") {
1500 for (
int i = 0; i < m_xmlHandlerObservationSettings.size(); i++) {
1501 m_xmlHandlerBundleSettings->m_observationSolveSettings.append(
1502 *m_xmlHandlerObservationSettings[i]);
1504 m_xmlHandlerObservationSettings.clear();
1507 m_xmlHandlerCharacters =
"";
1509 return XmlStackedHandler::endElement(namespaceURI, localName, qName);
1521 qDebug() <<
"Parse error at line " << exception.lineNumber()
1522 <<
", " <<
"column " << exception.columnNumber() <<
": "
1523 << qPrintable(exception.message());
1538 stream <<
m_id->toString()
1550 << m_observationSolveSettings
1587 >> m_observationSolveSettings
1588 >> convergenceCriteria
1590 >> convergenceCriteriaMaximumIterations
1596 m_id =
new QUuid(
id);
1614 return settings.
write(stream);
1627 return settings.
read(stream);
1649 void BundleSettings::createH5Group(H5::CommonFG &locationObject, QString locationName)
const {
1660 QString settingsGroupName = locationName +
"/BundleSettings";
1661 H5::Group settingsGroup = locationObject.createGroup(settingsGroupName.toLatin1());
1667 hsize_t dims[1] = {2};
1668 H5::DataSpace simple1x2Space(1, dims);
1670 H5::DataSpace simple1DSpace(1, dims);
1672 hsize_t dims2D[2] = {{2}, {2}};
1673 H5::DataSpace simple2x2Space(2, dims);
1675 H5::DataSpace simple2x1Space(2, dims);
1682 att = settingsGroup.createAttribute(
"validateNetwork", PredType::NATIVE_HBOOL, spc);
1683 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1686 att = settingsGroup.createAttribute(
"solveObservationMode", PredType::NATIVE_HBOOL, spc);
1687 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1690 att = settingsGroup.createAttribute(
"solveRadius", PredType::NATIVE_HBOOL, spc);
1691 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1694 att = settingsGroup.createAttribute(
"updateCubeLabel", PredType::NATIVE_HBOOL, spc);
1695 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1698 att = settingsGroup.createAttribute(
"errorPropagation", PredType::NATIVE_HBOOL, spc);
1699 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1702 att = settingsGroup.createAttribute(
"createInverseMatrix", PredType::NATIVE_HBOOL, spc);
1703 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1706 att = settingsGroup.createAttribute(
"outlierRejection", PredType::NATIVE_HBOOL, spc);
1707 att.write(PredType::NATIVE_HBOOL, &intFromBool);
1712 QString enumToStringValue =
"";
1714 H5::StrType strDataType;
1717 stringSize = enumToStringValue.length();
1718 strDataType = H5::StrType(PredType::C_S1, stringSize);
1719 att = settingsGroup.createAttribute(
"convergenceCriteria", strDataType, spc);
1720 att.write(strDataType, enumToStringValue.toStdString());
1726 strDataType = H5::StrType(PredType::C_S1, stringSize);
1727 att = settingsGroup.createAttribute(
"outputFilePrefix", strDataType, spc);
1733 att = settingsGroup.createAttribute(
"outlierRejectionMultiplier",
1734 PredType::NATIVE_DOUBLE,
1738 att = settingsGroup.createAttribute(
"globalLatitudeAprioriSigma",
1739 PredType::NATIVE_DOUBLE,
1743 att = settingsGroup.createAttribute(
"globalLongitudeAprioriSigma",
1744 PredType::NATIVE_DOUBLE,
1748 att = settingsGroup.createAttribute(
"globalRadiusAprioriSigma",
1749 PredType::NATIVE_DOUBLE,
1753 att = settingsGroup.createAttribute(
"convergenceCriteriaThreshold",
1754 PredType::NATIVE_DOUBLE,
1761 att = settingsGroup.createAttribute(
"convergenceCriteriaMaximumIterations",
1762 PredType::NATIVE_INT,
1773 catch ( H5::AttributeIException error ) {
1774 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1776 msg =
"H5 ATTRIBUTE exception handler has detected an error when invoking the function "
1777 + QString::fromStdString(error.getFuncName()) +
".";
1781 catch ( H5::DataSetIException error ) {
1782 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1784 msg =
"H5 DATA SET exception handler has detected an error when invoking the function "
1785 + QString::fromStdString(error.getFuncName()) +
".";
1789 catch ( H5::DataSpaceIException error ) {
1790 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1792 msg =
"H5 DATA SPACE exception handler has detected an error when invoking the function "
1793 + QString::fromStdString(error.getFuncName()) +
".";
1797 catch ( H5::DataTypeIException error ) {
1798 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1800 msg =
"H5 DATA TYPE exception handler has detected an error when invoking the function "
1801 + QString::fromStdString(error.getFuncName()) +
".";
1805 catch ( H5::FileIException error ) {
1806 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1808 msg =
"H5 FILE exception handler has detected an error when invoking the function "
1809 + QString::fromStdString(error.getFuncName()) +
".";
1813 catch ( H5::GroupIException error ) {
1814 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1816 msg =
"H5 GROUP exception handler has detected an error when invoking the function "
1817 + QString::fromStdString(error.getFuncName()) +
".";
1820 catch (H5::Exception error) {
1821 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1823 msg =
"H5 GENERAL exception handler has detected an error when invoking the function "
1824 + QString::fromStdString(error.getFuncName()) +
".";
1831 "Unable to save bundle settings information to an HDF5 group.",
1866 QString settingsGroupName = locationName +
"/BundleSettings";
1867 H5::Group settingsGroup = locationObject.openGroup(settingsGroupName.toLatin1());
1874 int boolAttValue = 0;
1875 att = settingsGroup.openAttribute(
"validateNetwork");
1876 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1879 att = settingsGroup.openAttribute(
"solveObservationMode");
1880 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1883 att = settingsGroup.openAttribute(
"solveRadius");
1884 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1887 att = settingsGroup.openAttribute(
"updateCubeLabel");
1888 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1891 att = settingsGroup.openAttribute(
"errorPropagation");
1892 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1895 att = settingsGroup.openAttribute(
"createInverseMatrix");
1896 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1899 att = settingsGroup.openAttribute(
"outlierRejection");
1900 att.read(PredType::NATIVE_HBOOL, &boolAttValue);
1906 H5std_string strAttValue;
1907 H5::StrType strDataType;
1909 att = settingsGroup.openAttribute(
"convergenceCriteria");
1910 strDataType = H5::StrType(PredType::C_S1, att.getStorageSize());
1911 att.read(strDataType, strAttValue);
1917 att = settingsGroup.openAttribute(
"outputFilePrefix");
1918 strDataType = H5::StrType(PredType::C_S1, att.getStorageSize());
1919 att.read(strDataType, strAttValue);
1925 att = settingsGroup.openAttribute(
"outlierRejectionMultiplier");
1928 att = settingsGroup.openAttribute(
"globalLatitudeAprioriSigma");
1931 att = settingsGroup.openAttribute(
"globalLongitudeAprioriSigma");
1934 att = settingsGroup.openAttribute(
"globalRadiusAprioriSigma");
1937 att = settingsGroup.openAttribute(
"convergenceCriteriaThreshold");
1943 att = settingsGroup.openAttribute(
"convergenceCriteriaMaximumIterations");
1952 catch ( H5::AttributeIException error ) {
1953 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1955 msg =
"H5 ATTRIBUTE exception handler has detected an error when invoking the function "
1956 + QString::fromStdString(error.getFuncName()) +
".";
1960 catch ( H5::DataSetIException error ) {
1961 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1963 msg =
"H5 DATA SET exception handler has detected an error when invoking the function "
1964 + QString::fromStdString(error.getFuncName()) +
".";
1968 catch ( H5::DataSpaceIException error ) {
1969 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1971 msg =
"H5 DATA SPACE exception handler has detected an error when invoking the function "
1972 + QString::fromStdString(error.getFuncName()) +
".";
1976 catch ( H5::DataTypeIException error ) {
1977 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1979 msg =
"H5 DATA TYPE exception handler has detected an error when invoking the function "
1980 + QString::fromStdString(error.getFuncName()) +
".";
1984 catch ( H5::FileIException error ) {
1985 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1987 msg =
"H5 FILE exception handler has detected an error when invoking the function "
1988 + QString::fromStdString(error.getFuncName()) +
".";
1992 catch ( H5::GroupIException error ) {
1993 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
1995 msg =
"H5 GROUP exception handler has detected an error when invoking the function "
1996 + QString::fromStdString(error.getFuncName()) +
".";
1999 catch (H5::Exception error) {
2000 QString msg =
"H5 Exception Message: " + QString::fromStdString(error.getDetailMsg());
2002 msg =
"H5 GENERAL exception handler has detected an error when invoking the function "
2003 + QString::fromStdString(error.getFuncName()) +
".";
2010 "Unable to read bundle settings information from an HDF5 group.",
BundleTargetBodyQsp bundleTargetBody() const
Retrieves a pointer to target body information for the bundle adjustment.
double m_globalLongitudeAprioriSigma
The global a priori sigma for longitude.
bool m_createInverseMatrix
Indicates whether to create the inverse matrix file.
BundleTargetBodyQsp m_bundleTargetBody
A pointer to the target body settings and information.
const double Null
Value for an Isis Null pixel.
ConvergenceCriteria convergenceCriteria() const
Retrieves the convergence criteria to be used to solve the bundle adjustment.
The value of sigma0 will be used to determine that the bundle adjustment has converged.
The main project for cnetsuite.
bool solveMeanRadius() const
This method is used to determine whether the bundle adjustment will solve for target body mean radius...
void openH5Group(H5::CommonFG &locationObject, QString locationName)
HDF5 - TBD.
void setObservationSolveOptions(QList< BundleObservationSolveSettings > obsSolveSettingsList)
Add the list of solve options for each observation.
File name manipulation and expansion.
bool m_solveObservationMode
Indicates whether to solve for observation mode.
void setSolveOptions(bool solveObservationMode=false, bool updateCubeLabel=false, bool errorPropagation=false, bool solveRadius=false, double globalLatitudeAprioriSigma=Isis::Null, double globalLongitudeAprioriSigma=Isis::Null, double globalRadiusAprioriSigma=Isis::Null)
Set the solve options for the bundle adjustment.
int numberTargetBodyParameters() const
This method is used to determine whether the bundle adjustment will solve for target body pole positi...
static QString convergenceCriteriaToString(ConvergenceCriteria criteria)
Converts the given BundleSettings::ConvergenceCriteria enumeration to a string.
bool solveTargetBody() const
This method is used to determine whether the bundle adjustment will solve for target body...
void setOutputFilePrefix(QString outputFilePrefix)
Set the output file prefix for the bundle adjustment.
int toInt(const QString &string)
Global function to convert from a string to an integer.
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > maximumLikelihoodEstimatorModels() const
Retrieves the list of maximum likelihood estimator (MLE) models with their corresponding C-Quantiles...
ConvergenceCriteria m_convergenceCriteria
Enumeration used to indicate what criteria to use to determine bundle adjustment convergence.
void setConvergenceCriteria(ConvergenceCriteria criteria, double threshold, int maximumIterations)
Set the convergence criteria options for the bundle adjustment.
QSharedPointer< BundleTargetBody > BundleTargetBodyQsp
Definition for BundleTargetBodyQsp, a QSharedPointer to a BundleTargetBody.
double m_outlierRejectionMultiplier
The multiplier value for outlier rejection.
bool solvePMVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
double globalLongitudeAprioriSigma() const
Retrieves the global a priori sigma longitude value for this bundle adjustment.
virtual bool characters(const QString &ch)
XML - TBD.
int numberSolveSettings() const
Retrieves the number of observation solve settings.
QString m_outputFilePrefix
The prefix for all output files.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
Model
The supported maximum likelihood estimation models.
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.
bool m_validateNetwork
Indicates whether the network should be validated.
bool solvePoleRA() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
bool fatalError(const QXmlParseException &exception)
XML - TBD.
void setCreateInverseMatrix(bool createMatrix)
Turn the creation of the inverse correlation matrix file on or off.
virtual bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
XML - TBD.
A modification to Huber's method propsed by William J.J.
bool updateCubeLabel() const
This method is used to determine whether this bundle adjustment will update the cube labels...
~BundleSettings()
Destroys the BundleSettings object.
virtual bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName, const QXmlAttributes &atts)
Handle an XML start element.
BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const
Retrieves solve settings for the observation corresponding to the given observation number...
double globalRadiusAprioriSigma() const
Retrieves the global a priori sigma radius value for this bundle adjustment.
QDataStream & read(QDataStream &stream)
Reads BundleSettings object from a binary data stream.
XmlHandler(BundleSettings *bundleSettings, Project *project)
Create an XML Handler (reader) that can populate the BundleSettings class data.
double outlierRejectionMultiplier() const
Retrieves the outlier rejection multiplier for the bundle adjustment.
void setBundleTargetBody(BundleTargetBodyQsp bundleTargetBody)
Sets the target body for the bundle adjustment.
void addMaximumLikelihoodEstimatorModel(MaximumLikelihoodWFunctions::Model model, double cQuantile)
Add a maximum likelihood estimator (MLE) model to the bundle adjustment.
bool m_updateCubeLabel
Indicates whether to update cubes.
bool solvePoleDecVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
BundleSettings()
Constructs a BundleSettings object.
int convergenceCriteriaMaximumIterations() const
Retrieves the maximum number of iterations allowed to solve the bundle adjustment.
QList< QPair< MaximumLikelihoodWFunctions::Model, double > > m_maximumLikelihood
Model and C-Quantile for each of the three maximum likelihood estimations.
All parameter corrections will be used to determine that the bundle adjustment has converged...
#define _FILEINFO_
Macro for the filename and line number.
std::istream & operator>>(std::istream &is, CSVReader &csv)
Input read operator for input stream sources.
PvlObject pvlObject(QString name="") const
Serializes this BundleObservationSolveSettings into a PvlObject.
A single keyword-value pair.
Container class for BundleAdjustment settings.
A type of error that cannot be classified as any of the other error types.
QString outputFilePrefix() const
Retrieve the output file prefix.
void setValidateNetwork(bool validate)
Sets the internal flag to indicate whether to validate the network before the bundle adjustment...
bool solvePMAcceleration() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
BundleSettings & operator=(const BundleSettings &other)
Assignment operator to allow proper copying of the 'other' BundleSettings object to this one...
This class is needed to read/write BundleSettings from/to an XML formateed file.
bool IsSpecial(const double d)
Returns if the input pixel is special.
double m_convergenceCriteriaThreshold
Tolerance value corresponding to the selected convergence criteria.
QDataStream & write(QDataStream &stream) const
Writes BundleSettings object to a binary data stream.
void save(QXmlStreamWriter &stream, const Project *project) const
This method is used to write a BundleSettings object to an XML format.
bool solvePoleDec() const
This method is used to determine whether the bundle adjustment will solve for target body pole declin...
bool outlierRejection() const
This method is used to determine whether outlier rejection will be performed on this bundle adjustmen...
bool solvePM() const
This method is used to determine whether the bundle adjustment will solve for target body prime merid...
This class is used to modify and manage solve settings for 1 to many BundleObservations.
bool solveObservationMode() const
This method is used to determine whether this bundle adjustment will solve for observation mode...
bool validate(const NaifVertex &v)
Verifies that the given NaifVector or NaifVertex is 3 dimensional.
double m_globalLatitudeAprioriSigma
The global a priori sigma for latitude.
double convergenceCriteriaThreshold() const
Retrieves the convergence threshold to be used to solve the bundle adjustment.
static ConvergenceCriteria stringToConvergenceCriteria(QString criteria)
Converts the given string value to a BundleSettings::ConvergenceCriteria enumeration.
bool m_outlierRejection
Indicates whether to perform automatic outlier detection/rejection.
~XmlHandler()
Create an XML Handler (reader) that can populate the BundleSettings class data.
bool m_solveRadius
Indicates whether to solve for point radii.
int m_convergenceCriteriaMaximumIterations
Maximum number of iterations before quitting the bundle adjustment if it has not yet converged to the...
bool toBool(const QString &string)
Global function to convert from a string to a boolean.
double m_globalRadiusAprioriSigma
The global a priori sigma for radius.
bool solveRadius() const
This method is used to determine whether this bundle adjustment will solve for radius.
bool m_solveTargetBody
Indicates whether to solve for target body.
bool solvePoleRAVelocity() const
This method is used to determine whether the bundle adjustment will solve for target body pole right ...
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum...
PvlObject pvlObject(QString name="BundleSettings") const
Create PvlObject with the given name containing the BundleSettings information.
QDebug operator<<(QDebug debug, const Hillshade &hillshade)
Print this class out to a QDebug object.
Contains Pvl Groups and Pvl Objects.
void setOutlierRejection(bool outlierRejection, double multiplier=1.0)
Set the outlier rejection options for the bundle adjustment.
bool m_errorPropagation
Indicates whether to perform error propagation.
his enables stack-based XML parsing of XML files.
bool validateNetwork() const
This method is used to determine whether to validate the network before the bundle adjustment...
bool createInverseMatrix() const
Indicates if the settings will allow the inverse correlation matrix to be created.
double globalLatitudeAprioriSigma() const
Retrieves the global a priori sigma latitude value for this bundle adjustment.
QUuid * m_id
A unique ID for this BundleSettings object.
bool solveTriaxialRadii() const
This method is used to determine whether the bundle adjustment will solve for target body triaxial ra...
ConvergenceCriteria
This enum defines the options for the bundle adjustment's convergence.
void addValue(QString value, QString unit="")
Adds a value with units.
bool errorPropagation() const
This method is used to determine whether this bundle adjustment will perform error propagation...