9#include "BundleSolutionInfo.h"
18#include <QXmlStreamWriter>
19#include <QXmlStreamReader>
21#include "BundleLidarRangeConstraint.h"
22#include "BundleResults.h"
24#include "ControlList.h"
25#include "ControlMeasure.h"
26#include "ControlNet.h"
27#include "ControlPoint.h"
33#include "PvlKeyword.h"
35#include "StatCumProbDistDynCalc.h"
36#include "Statistics.h"
53 m_id =
new QUuid(QUuid::createUuid());
58 m_outputControlName=
"";
82 m_id =
new QUuid(QUuid::createUuid());
87 m_outputControlName=
"";
108 QXmlStreamReader *xmlReader,
111 m_id =
new QUuid(QUuid::createUuid());
116 m_outputControlName =
"";
124 m_xmlHandlerProject = project;
127 readBundleSolutionInfo(xmlReader);
130 void BundleSolutionInfo::readBundleSolutionInfo(QXmlStreamReader *xmlReader) {
132 if (m_xmlHandlerProject) {
133 projectRoot = m_xmlHandlerProject->
projectRoot() +
"/";
138 Q_ASSERT(xmlReader->name() ==
"bundleSolutionInfo");
139 while(xmlReader->readNextStartElement()) {
140 if (xmlReader->qualifiedName() ==
"generalAttributes") {
141 while (xmlReader->readNextStartElement()) {
142 if (xmlReader->qualifiedName() ==
"id") {
143 m_id =
new QUuid(xmlReader->readElementText());
145 else if (xmlReader->qualifiedName() ==
"name") {
146 m_name = xmlReader->readElementText();
148 else if (xmlReader->qualifiedName() ==
"runTime") {
149 m_runTime = xmlReader->readElementText();
151 else if (xmlReader->qualifiedName() ==
"inputFileName") {
154 else if (xmlReader->qualifiedName() ==
"bundleOutTXT") {
155 m_txtBundleOutputFilename = projectRoot + xmlReader->readElementText();
157 else if (xmlReader->qualifiedName() ==
"imagesCSV") {
158 m_csvSavedImagesFilename = projectRoot + xmlReader->readElementText();
160 else if (xmlReader->qualifiedName() ==
"pointsCSV") {
161 m_csvSavedPointsFilename = projectRoot + xmlReader->readElementText();
163 else if (xmlReader->qualifiedName() ==
"residualsCSV") {
164 m_csvSavedResidualsFilename = projectRoot + xmlReader->readElementText();
167 xmlReader->skipCurrentElement();
171 else if (xmlReader->name() ==
"bundleSettings") {
173 BundleSettings *settings =
new BundleSettings();
174 settings->readBundleSettings(xmlReader);
177 else if (xmlReader->name() ==
"bundleResults") {
183 xmlReader->skipCurrentElement();
229 return m_txtBundleOutputFilename;
239 return m_csvSavedImagesFilename;
249 return m_csvSavedPointsFilename;
259 return m_csvSavedResidualsFilename;
303 oldInputFileName.
dir().dirName() +
"/" + oldInputFileName.
name());
308 oldOutputFileName.
dir().dirName() +
"/" + oldOutputFileName.
name());
314 m_outputControlName = newOutputFileName.
expanded();
335 return m_id->toString().remove(QRegExp(
"[{}]"));
391 return m_outputControlName;
421 m_outputControlName =
name;
431 return m_outputControlName;
467 "Results for this bundle is NULL.",
524 std::vector<QString> outputColumns;
526 outputColumns.push_back(
"Image,");
527 outputColumns.push_back(
"rms,");
528 outputColumns.push_back(
"rms,");
529 outputColumns.push_back(
"rms,");
531 QStringList observationParameters = observation->parameterList();
533 for (
int i = 0; i < observationParameters.size(); i++) {
534 for (
int j = 0; j < 5; j++) {
535 outputColumns.push_back(observationParameters[i] +
",");
540 int ncolumns = outputColumns.size();
541 for (
int i = 0; i < ncolumns; i++) {
542 QString str = outputColumns.at(i);
543 snprintf(buf,
sizeof(buf),
"%s", (
const char*)str.toLatin1().data());
546 snprintf(buf,
sizeof(buf),
"\n");
549 outputColumns.clear();
551 outputColumns.push_back(
"Filename,");
552 outputColumns.push_back(
"sample res,");
553 outputColumns.push_back(
"line res,");
554 outputColumns.push_back(
"total res,");
556 for (
int i = 0; i < observationParameters.size(); i++) {
557 outputColumns.push_back(
"Initial,");
558 outputColumns.push_back(
"Correction,");
559 outputColumns.push_back(
"Final,");
560 outputColumns.push_back(
"Apriori Sigma,");
561 outputColumns.push_back(
"Adj Sigma,");
565 ncolumns = outputColumns.size();
566 for (
int i = 0; i < ncolumns; i++) {
567 QString str = outputColumns.at(i);
568 snprintf(buf,
sizeof(buf),
"%s", (
const char*)str.toLatin1().data());
571 snprintf(buf,
sizeof(buf),
"\n");
602 for (
int i = 0; i < numObservations; i++) {
607 int numValidLidarPoints = 0;
609 numValidLidarPoints = lidarData->numberLidarPoints();
612 int numInnerConstraints = 0;
613 int numDistanceConstraints = 0;
616 int convergenceCriteria = 1;
618 snprintf(buf,
sizeof(buf),
"JIGSAW: BUNDLE ADJUSTMENT\n=========================\n");
620 snprintf(buf,
sizeof(buf),
"\n Run Time: %s",
623 snprintf(buf,
sizeof(buf),
"\n Network Filename: %s",
627 snprintf(buf,
sizeof(buf),
"\n Cube List: %s",
628 m_settings->cubeList().toStdString().c_str() );
632 snprintf(buf,
sizeof(buf),
"\n Output Network Filename: %s",
635 snprintf(buf,
sizeof(buf),
"\n Output File Prefix: %s",
636 m_settings->outputFilePrefix().toStdString().c_str() );
639 snprintf(buf,
sizeof(buf),
"\n Network Id: %s",
642 snprintf(buf,
sizeof(buf),
"\n Network Description: %s",\
646 snprintf(buf,
sizeof(buf),
"\n Lidar Data Filename: %s",
650 snprintf(buf,
sizeof(buf),
"\n Target: %s",
653 snprintf(buf,
sizeof(buf),
"\n\n Linear Units: kilometers");
655 snprintf(buf,
sizeof(buf),
"\n Angular Units: decimal degrees");
657 snprintf(buf,
sizeof(buf),
"\n\nINPUT: SOLVE OPTIONS\n====================\n");
661 snprintf(buf,
sizeof(buf),
"\n OBSERVATIONS: ON"):
662 snprintf(buf,
sizeof(buf),
"\n OBSERVATIONS: OFF");
667 snprintf(buf,
sizeof(buf),
"\n RADIUS: ON"):
668 snprintf(buf,
sizeof(buf),
"\n RADIUS: OFF");
671 snprintf(buf,
sizeof(buf),
"\n RADIUS: N/A");
676 snprintf(buf,
sizeof(buf),
"\n TARGET BODY: ON"):
677 snprintf(buf,
sizeof(buf),
"\n TARGET BODY: OFF");
681 snprintf(buf,
sizeof(buf),
"\n UPDATE: YES"):
682 snprintf(buf,
sizeof(buf),
"\n UPDATE: NO");
686 snprintf(buf,
sizeof(buf),
"\n ERROR PROPAGATION: ON"):
687 snprintf(buf,
sizeof(buf),
"\n ERROR PROPAGATION: OFF");
691 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: LATITUDINAL"):
692 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: RECTANGULAR");
696 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: LATITUDINAL"):
697 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: RECTANGULAR");
701 snprintf(buf,
sizeof(buf),
"\n OUTLIER REJECTION: ON");
703 snprintf(buf,
sizeof(buf),
"\n REJECTION MULTIPLIER: %lf",
709 snprintf(buf,
sizeof(buf),
"\n OUTLIER REJECTION: OFF");
711 snprintf(buf,
sizeof(buf),
"\n REJECTION MULTIPLIER: N/A");
716 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR REPORTS: %s",
720 snprintf(buf,
sizeof(buf),
"\n CONTROL POINT COORDINATE TYPE FOR BUNDLE: %s",
723 snprintf(buf,
sizeof(buf),
"\n\nMAXIMUM LIKELIHOOD ESTIMATION\n============================\n");
726 for (
int tier = 0; tier < 3; tier++) {
727 if (tier < m_statisticsResults->numberMaximumLikelihoodModels()) {
728 snprintf(buf,
sizeof(buf),
"\n Tier %d Enabled: TRUE", tier);
730 snprintf(buf,
sizeof(buf),
"\n Maximum Likelihood Model: %s",
733 maximumLikelihoodModelWFunc(tier).model()).toLatin1().data());
735 snprintf(buf,
sizeof(buf),
"\n Quantile used for tweaking constant: %lf",
738 snprintf(buf,
sizeof(buf),
"\n Quantile weighted R^2 Residual value: %lf",
741 snprintf(buf,
sizeof(buf),
"\n Approx. weighted Residual cutoff: %s",
743 .weightedResidualCutoff().toLatin1().data());
745 if (tier != 2) fpOut <<
"\n";
748 snprintf(buf,
sizeof(buf),
"\n Tier %d Enabled: FALSE", tier);
753 snprintf(buf,
sizeof(buf),
"\n\nINPUT: CONVERGENCE CRITERIA\n===========================\n");
755 snprintf(buf,
sizeof(buf),
"\n SIGMA0: %e",
758 snprintf(buf,
sizeof(buf),
"\n MAXIMUM ITERATIONS: %d",
759 m_settings->convergenceCriteriaMaximumIterations());
773 snprintf(buf,
sizeof(buf),
"\n\nINPUT: CAMERA POINTING OPTIONS\n==============================\n");
775 switch (pointingSolveDegree) {
777 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: NONE");
780 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES");
783 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES, VELOCITIES");
786 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ANGLES, VELOCITIES, ACCELERATIONS");
789 snprintf(buf,
sizeof(buf),
"\n CAMSOLVE: ALL POLYNOMIAL COEFFICIENTS (%d)"
791 "\n CKSOLVEDEGREE: %d",
799 snprintf(buf,
sizeof(buf),
"\n TWIST: ON"):
800 snprintf(buf,
sizeof(buf),
"\n TWIST: OFF");
803 snprintf(buf,
sizeof(buf),
"\n POLYNOMIAL OVER EXISTING POINTING: ON"):
804 snprintf(buf,
sizeof(buf),
"\nPOLYNOMIAL OVER EXISTING POINTING : OFF");
807 snprintf(buf,
sizeof(buf),
"\n\nINPUT: SPACECRAFT OPTIONS\n=========================\n");
809 switch (positionSolveDegree) {
811 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: NONE");
814 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION");
817 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION, VELOCITIES");
820 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: POSITION, VELOCITIES, ACCELERATIONS");
823 snprintf(buf,
sizeof(buf),
"\n SPSOLVE: ALL POLYNOMIAL COEFFICIENTS (%d)"
825 "\n SPKSOLVEDEGREE: %d",
833 snprintf(buf,
sizeof(buf),
"\n POLYNOMIAL OVER HERMITE SPLINE: ON"):
834 snprintf(buf,
sizeof(buf),
"\nPOLYNOMIAL OVER HERMITE SPLINE : OFF");
837 snprintf(buf,
sizeof(buf),
"\n\nINPUT: GLOBAL IMAGE PARAMETER UNCERTAINTIES\n===========================================\n");
841 switch (
m_settings->controlPointCoordTypeBundle()) {
843 coord1Str =
" POINT LATITUDE";
844 coord2Str =
" POINT LONGITUDE";
845 coord3Str =
" POINT RADIUS";
848 coord1Str =
" POINT X";
849 coord2Str =
" POINT Y";
850 coord3Str =
" POINT Z";
853 IString msg =
"Unknown surface point coordinate type enum ["
862 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: N/A", coord1Str.toLatin1().data()):
863 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: %lf (meters)", coord1Str.toLatin1().data(),
868 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: N/A", coord2Str.toLatin1().data()):
869 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: %lf (meters)", coord2Str.toLatin1().data(),
874 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: N/A", coord3Str.toLatin1().data()):
875 snprintf(buf,
sizeof(buf),
"\n%s SIGMA: %lf (meters)", coord3Str.toLatin1().data(),
878 (positionSolveDegree < 1 || positionSigmas[0] ==
Isis::Null) ?
879 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT POSITION SIGMA: N/A"):
880 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT POSITION SIGMA: %lf (meters)",
884 (positionSolveDegree < 2 || positionSigmas[1] ==
Isis::Null) ?
885 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT VELOCITY SIGMA: N/A"):
886 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT VELOCITY SIGMA: %lf (m/s)",
890 (positionSolveDegree < 3 || positionSigmas[2] ==
Isis::Null) ?
891 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT ACCELERATION SIGMA: N/A"):
892 snprintf(buf,
sizeof(buf),
"\n SPACECRAFT ACCELERATION SIGMA: %lf (m/s/s)",
896 (pointingSolveDegree < 1 || pointingSigmas[0] ==
Isis::Null) ?
897 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGLES SIGMA: N/A"):
898 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGLES SIGMA: %lf (dd)",
902 (pointingSolveDegree < 2 || pointingSigmas[1] ==
Isis::Null) ?
903 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR VELOCITY SIGMA: N/A"):
904 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR VELOCITY SIGMA: %lf (dd/s)",
908 (pointingSolveDegree < 3 || pointingSigmas[2] ==
Isis::Null) ?
909 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR ACCELERATION SIGMA: N/A"):
910 snprintf(buf,
sizeof(buf),
"\n CAMERA ANGULAR ACCELERATION SIGMA: %lf (dd/s/s)",
915 snprintf(buf,
sizeof(buf),
"\n\nINPUT: TARGET BODY OPTIONS\n==============================\n");
919 snprintf(buf,
sizeof(buf),
"\n POLE: RIGHT ASCENSION");
921 snprintf(buf,
sizeof(buf),
"\n : DECLINATION\n");
925 snprintf(buf,
sizeof(buf),
"\n POLE: RIGHT ASCENSION\n");
929 snprintf(buf,
sizeof(buf),
"\n POLE: DECLINATION\n");
935 snprintf(buf,
sizeof(buf),
"\n PRIME MERIDIAN: W0 (OFFSET)");
939 snprintf(buf,
sizeof(buf),
"\n : WDOT (SPIN RATE)");
943 snprintf(buf,
sizeof(buf),
"\n :W ACCELERATION");
950 snprintf(buf,
sizeof(buf),
"\n RADII: MEAN");
954 snprintf(buf,
sizeof(buf),
"\n RADII: TRIAXIAL");
960 snprintf(buf,
sizeof(buf),
"\n\nJIGSAW: RESULTS\n===============\n");
962 snprintf(buf,
sizeof(buf),
"\n Images: %6d",numImages);
964 snprintf(buf,
sizeof(buf),
"\n Points: %6d",numValidPoints);
967 if (numValidLidarPoints > 0) {
968 snprintf(buf,
sizeof(buf),
"\n Lidar Points: %6d",numValidLidarPoints);
972 snprintf(buf,
sizeof(buf),
"\n Total Measures: %6d",
977 snprintf(buf,
sizeof(buf),
"\n Total Observations: %6d",
982 snprintf(buf,
sizeof(buf),
"\n Good Observations: %6d",
986 snprintf(buf,
sizeof(buf),
"\n Rejected Observations: %6d",
991 snprintf(buf,
sizeof(buf),
"\n Constrained Point Parameters: %6d",
997 snprintf(buf,
sizeof(buf),
"\n Constrained Image Parameters: %6d",
1003 snprintf(buf,
sizeof(buf),
"\n Constrained Target Parameters: %6d",
1009 snprintf(buf,
sizeof(buf),
"\n Lidar Range Constraints: %6d",
1014 snprintf(buf,
sizeof(buf),
"\n Unknowns: %6d",
1018 if (numInnerConstraints > 0) {
1019 snprintf(buf,
sizeof(buf),
"\n Inner Constraints: %6d", numInnerConstraints);
1023 if (numDistanceConstraints > 0) {
1024 snprintf(buf,
sizeof(buf),
"\n Distance Constraints: %d", numDistanceConstraints);
1028 snprintf(buf,
sizeof(buf),
"\n Degrees of Freedom: %6d", numDegreesOfFreedom);
1031 snprintf(buf,
sizeof(buf),
"\n Convergence Criteria: %6.3g",
1035 if (convergenceCriteria == 1) {
1036 snprintf(buf,
sizeof(buf),
"(Sigma0)");
1044 snprintf(buf,
sizeof(buf),
"(Maximum reached)");
1050 snprintf(buf,
sizeof(buf),
" Error Propagation Elapsed Time: %6.4lf (seconds)\n",
1053 snprintf(buf,
sizeof(buf),
" Total Elapsed Time: %6.4lf (seconds)\n",
1059 snprintf(buf,
sizeof(buf),
"\n Residual Percentiles:\n");
1065 for (
int bin = 1;bin < 34;bin++) {
1066 double cumProb = double(bin) / 100.0;
1069 residualsCumulativeProbabilityDistribution().value(cumProb);
1072 residualsCumulativeProbabilityDistribution().value(cumProb + 0.33);
1075 residualsCumulativeProbabilityDistribution().value(cumProb + 0.66);
1076 snprintf(buf,
sizeof(buf),
" Percentile %3d: %+8.3lf"
1077 " Percentile %3d: %+8.3lf"
1078 " Percentile %3d: %+8.3lf\n",
1080 bin + 33, resValue33,
1081 bin + 66, resValue66);
1086 QString msg =
"Failed to output residual percentiles for bundleout";
1090 snprintf(buf,
sizeof(buf),
"\n Residual Box Plot:");
1092 snprintf(buf,
sizeof(buf),
"\n minimum: %+8.3lf",
1095 snprintf(buf,
sizeof(buf),
"\n Quartile 1: %+8.3lf",
1098 snprintf(buf,
sizeof(buf),
"\n Median: %+8.3lf",
1101 snprintf(buf,
sizeof(buf),
"\n Quartile 3: %+8.3lf",
1104 snprintf(buf,
sizeof(buf),
"\n maximum: %+8.3lf\n",
1109 QString msg =
"Failed to output residual box plot for bundleout";
1116 int filePadding = 0;
1118 for (
int i = 0; i < numObservations; i++) {
1122 for (
int j = 0; j < numImagesInObservation; j++) {
1125 if (bundleImage->fileName().length() > filePadding) {
1126 filePadding = bundleImage->fileName().length();
1131 snprintf(buf,
sizeof(buf),
"\nIMAGE MEASURES SUMMARY\n==========================\n\n");
1136 QString header(
"Measures RMS(pixels)");
1138 header +=
" Lidar RMS(pixels)";
1141 snprintf(buf,
sizeof(buf),
"%*s\n", header.length() + 11 + filePadding, header.toLatin1().data());
1144 QString dividers(
"*************************** *******************************************");
1146 dividers +=
" *******************************************";
1148 snprintf(buf,
sizeof(buf),
"%*s\n", dividers.length() + 1 + filePadding, dividers.toLatin1().data());
1151 QString fields(
"| Accepted | Total | | Samples | Lines | Total |");
1153 fields +=
" | Samples | Lines | Total |";
1155 snprintf(buf,
sizeof(buf),
"%*s\n", fields.length() + 1 + filePadding, fields.toLatin1().data());
1158 int numMeasures, numLidarMeasures;
1159 int numRejectedMeasures, numLidarRejectedMeasures;
1160 int numUsed, numLidarUsed;
1162 Statistics rmsSamplesTotal,rmsLinesTotal,rmsTotals;
1164 for (
int i = 0; i < numObservations; i++) {
1168 for (
int j = 0; j < numImagesInObservation; j++) {
1173 rmsImageSampleResiduals()[imageIndex].Rms();
1175 rmsImageLineResiduals()[imageIndex].Rms();
1177 rmsImageResiduals()[imageIndex].Rms();
1178 rmsSamplesTotal.
AddData(rmsSampleResiduals);
1179 rmsLinesTotal.
AddData(rmsLineResiduals);
1180 rmsTotals.
AddData(rmsLandSResiduals);
1183 (bundleImage->serialNumber());
1186 GetNumberOfJigsawRejectedMeasuresInImage(bundleImage->serialNumber());
1188 numUsed = numMeasures - numRejectedMeasures;
1190 QString filename = bundleImage->fileName();
1192 List = filename.split(
"/");
1194 snprintf(buf,
sizeof(buf),
"%-*s" ,filePadding + 1, bundleImage->fileName().toLatin1().data());
1197 snprintf(buf,
sizeof(buf),
" %12d %12d ", numUsed, numMeasures);
1200 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf",
1201 rmsSampleResiduals,rmsLineResiduals,rmsLandSResiduals);
1207 rmsLidarImageSampleResiduals()[imageIndex].Rms();
1209 rmsLidarImageLineResiduals()[imageIndex].Rms();
1211 rmsLidarImageResiduals()[imageIndex].Rms();
1214 GetNumberOfValidMeasuresInImage(bundleImage->serialNumber());
1217 GetNumberOfJigsawRejectedMeasuresInImage(bundleImage->serialNumber());
1219 numLidarUsed = numLidarMeasures - numLidarRejectedMeasures;
1221 snprintf(buf,
sizeof(buf),
" %12d %12d ", numLidarUsed, numLidarMeasures);
1224 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf",
1225 rmsLidarSampleResiduals,rmsLidarLineResiduals,rmsLidarLandSResiduals);
1230 snprintf(buf,
sizeof(buf),
" \n");
1238 snprintf(buf,
sizeof(buf),
"%*s", -(filePadding + 33),
"\nTotal RMS:");
1240 snprintf(buf,
sizeof(buf),
"%13.4lf %13.4lf %13.4lf\n",
1241 rmsSamplesTotal.
Rms(),rmsLinesTotal.
Rms(),rmsTotals.
Rms());
1267 bool errorProp =
false;
1275 if (instrumentIds.size() == 1) {
1276 QString ofname =
"bundleout_images.csv";
1277 ofname =
m_settings->outputFilePrefix() + ofname;
1278 m_csvSavedImagesFilename = ofname;
1279 outputCsvFileNames.push_back(ofname);
1283 for (
int i = 0; i < instrumentIds.size(); i++) {
1284 QString updatedInstrumentId = instrumentIds[i];
1288 updatedInstrumentId.replace(
"/",
"_").replace(
" ",
"_");
1289 QString ofname =
"bundleout_images_" + updatedInstrumentId +
".csv";
1290 ofname =
m_settings->outputFilePrefix() + ofname;
1291 m_csvSavedImagesFilename = ofname;
1292 outputCsvFileNames.push_back(ofname);
1296 for (
int i = 0; i < instrumentIds.size(); i++) {
1298 std::ofstream fpOut(outputCsvFileNames[i].toLatin1().data(), std::ios::out);
1306 int nObservations = observations.size();
1310 for (
int j = 0; j < nObservations; j++ ) {
1315 int observationIndex = observation->index();
1317 for (
int obsIndex = 0; obsIndex < observationIndex; obsIndex++) {
1325 int numImages = observation->size();
1327 for (
int k = 0; k < numImages; k++) {
1328 BundleImageQsp image = observation->at(k);
1330 snprintf(buf,
sizeof(buf),
"%s", image->fileName().toLatin1().data());
1332 snprintf(buf,
sizeof(buf),
",");
1335 fpOut <<
toString(rmsImageSampleResiduals[imgIndex].Rms()).toLatin1().data();
1336 snprintf(buf,
sizeof(buf),
",");
1339 fpOut <<
toString(rmsImageLineResiduals[imgIndex].Rms()).toLatin1().data();
1340 snprintf(buf,
sizeof(buf),
",");
1343 fpOut <<
toString(rmsImageResiduals[imgIndex].Rms()).toLatin1().data();
1344 snprintf(buf,
sizeof(buf),
",");
1347 QString observationString =
1348 observation->bundleOutputCSV(errorProp);
1351 if (observationString.right(1)==
",") {
1352 observationString.truncate(observationString.length()-1);
1355 fpOut << (
const char*) observationString.toLatin1().data();
1357 snprintf(buf,
sizeof(buf),
"\n");
1377 QString ofname =
"bundleout.txt";
1378 ofname =
m_settings->outputFilePrefix() + ofname;
1380 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1385 m_txtBundleOutputFilename = ofname;
1394 bool berrorProp =
false;
1401 snprintf(buf,
sizeof(buf),
"\nTARGET BODY\n==========================\n");
1404 snprintf(buf,
sizeof(buf),
"\n Target Initial Total "
1405 "Final Initial Final\n"
1406 "Parameter Value Correction "
1407 "Value Accuracy Accuracy\n");
1410 QString targetString =
1411 m_settings->bundleTargetBody()->formatBundleOutputString(berrorProp);
1412 fpOut << (
const char*)targetString.toLatin1().data();
1416 snprintf(buf,
sizeof(buf),
"\nIMAGE EXTERIOR ORIENTATION\n==========================\n");
1422 imagesAndParameters.insert(
"target",
m_settings->bundleTargetBody()->parameterList() );
1425 for (
int i = 0; i < nObservations; i++) {
1432 int numImages = observation->size();
1433 for (
int j = 0; j < numImages; j++) {
1434 BundleImageQsp image = observation->at(j);
1435 snprintf(buf,
sizeof(buf),
"\nImage Full File Name: %s\n", image->fileName().toLatin1().data());
1437 snprintf(buf,
sizeof(buf),
"\nImage Serial Number: %s\n", image->serialNumber().toLatin1().data());
1440 snprintf(buf,
sizeof(buf),
"Image Initial Total Final Accuracy\n");
1442 snprintf(buf,
sizeof(buf),
"Parameter Value Correction Value Initial Final Units\n");
1445 snprintf(buf,
sizeof(buf),
" "
1446 "***************************************\n");
1449 observation->bundleOutputString(fpOut,berrorProp);
1451 foreach ( QString image, observation->imageNames() ) {
1452 imagesAndParameters.insert( image, observation->parameterList() );
1465 snprintf(buf,
sizeof(buf),
"\n\n\nPOINTS UNCERTAINTY SUMMARY\n==========================\n\n");
1471 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1474 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1478 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n\n", coordName.toLatin1().data(),
1486 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1489 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1493 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n\n", coordName.toLatin1().data(),
1500 SurfacePoint::Three);
1505 snprintf(buf,
sizeof(buf),
" RMS Sigma Radius(m) N/A\n");
1507 snprintf(buf,
sizeof(buf),
" MIN Sigma Radius(m) N/A\n");
1509 snprintf(buf,
sizeof(buf),
" MAX Sigma Radius(m) N/A\n");
1513 snprintf(buf,
sizeof(buf),
"RMS Sigma %s(m)%20.8lf\n", coordName.toLatin1().data(),
1516 snprintf(buf,
sizeof(buf),
"MIN Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1520 snprintf(buf,
sizeof(buf),
"MAX Sigma %s(m)%20.8lf at %s\n", coordName.toLatin1().data(),
1529 snprintf(buf,
sizeof(buf),
"\n\nPOINTS SUMMARY\n==============\n%103s"
1530 "Sigma Sigma Sigma\n"
1531 " Label Status Rays RMS"
1532 " Latitude Longitude Radius"
1533 " Latitude Longitude Radius\n",
"");
1536 snprintf(buf,
sizeof(buf),
"\n\nPOINTS SUMMARY\n==============\n%103s"
1537 "Sigma Sigma Sigma\n"
1538 " Label Status Rays RMS"
1539 " Point X Point Y Point Z"
1540 " Point X Point Y Point Z\n",
"");
1545 for (
int i = 0; i < nPoints; i++) {
1548 QString pointSummaryString =
1549 bundleControlPoint->formatBundleOutputSummaryString(berrorProp);
1550 fpOut << (
const char*)pointSummaryString.toLatin1().data();
1554 for (
int i = 0; i < nLidarPoints; i++) {
1558 QString pointSummaryString =
1559 lidarControlPoint->formatBundleOutputSummaryString(berrorProp);
1560 fpOut << (
const char*)pointSummaryString.toLatin1().data();
1564 snprintf(buf,
sizeof(buf),
"\n\nPOINTS DETAIL\n=============\n\n");
1567 bool solveRadius =
m_settings->solveRadius();
1569 for (
int i = 0; i < nPoints; i++) {
1573 QString pointDetailString =
1574 bundleControlPoint->formatBundleOutputDetailString(berrorProp, solveRadius);
1575 fpOut << (
const char*)pointDetailString.toLatin1().data();
1578 for (
int i = 0; i < nLidarPoints; i++) {
1582 QString pointDetailString =
1583 bundleLidarControlPoint->formatBundleOutputDetailString(berrorProp, solveRadius);
1584 fpOut << (
const char*)pointDetailString.toLatin1().data();
1601 QString ofname =
"bundleout_points.csv";
1602 ofname =
m_settings->outputFilePrefix() + ofname;
1603 m_csvSavedPointsFilename = ofname;
1605 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1612 double dLat, dLon, dRadius;
1614 double dSigmaLat, dSigmaLong, dSigmaRadius;
1616 double cor_lat_dd = 0.0;
1617 double cor_lon_dd = 0.0;
1618 double cor_rad_km = 0.0;
1619 double cor_lat_m = 0.0;
1620 double cor_lon_m = 0.0;
1621 double cor_rad_m = 0.0;
1625 int numMeasures, numRejectedMeasures;
1626 double dResidualRms;
1630 snprintf(buf,
sizeof(buf),
",,,,,3-d,3-d,3-d,Sigma,Sigma,Sigma,Correction,Correction,Correction,Coordinate,"
1631 "Coordinate,Coordinate\nPoint,Point,Accepted,Rejected,Residual,Latitude,Longitude,"
1632 "Radius,Latitude,Longitude,Radius,Latitude,Longitude,Radius,X,Y,Z\nLabel,Status,"
1633 "Measures,Measures,RMS,(dd),(dd),(km),(m),(m),(m),(m),(m),(m),(km),(km),(km)\n");
1636 snprintf(buf,
sizeof(buf),
",,,,,3-d,3-d,3-d,Correction,Correction,Correction,Coordinate,Coordinate,"
1637 "Coordinate\nPoint,Point,Accepted,Rejected,Residual,Latitude,Longitude,Radius,"
1638 "Latitude,Longitude,Radius,X,Y,Z\nLabel,Status,Measures,Measures,RMS,(dd),(dd),(km),"
1639 "(m),(m),(m),(km),(km),(km)\n");
1643 for (
int i = 0; i < numPoints; i++) {
1646 if (!bundlecontrolpoint) {
1650 if (bundlecontrolpoint->isRejected()) {
1654 dLat = bundlecontrolpoint->adjustedSurfacePoint().GetLatitude().degrees();
1655 dLon = bundlecontrolpoint->adjustedSurfacePoint().GetLongitude().degrees();
1656 dRadius = bundlecontrolpoint->adjustedSurfacePoint().GetLocalRadius().kilometers();
1657 dX = bundlecontrolpoint->adjustedSurfacePoint().GetX().kilometers();
1658 dY = bundlecontrolpoint->adjustedSurfacePoint().GetY().kilometers();
1659 dZ = bundlecontrolpoint->adjustedSurfacePoint().GetZ().kilometers();
1660 numMeasures = bundlecontrolpoint->numberOfMeasures();
1661 numRejectedMeasures = bundlecontrolpoint->numberOfRejectedMeasures();
1662 dResidualRms = bundlecontrolpoint->residualRms();
1666 double rtm = dRadius * 1000.;
1669 boost::numeric::ublas::bounded_vector< double, 3 > corrections = bundlecontrolpoint->
1673 double xCor = corrections(0);
1674 double yCor = corrections(1);
1675 double zCor = corrections(2);
1687 cor_lat_dd = (dLat - latInit);
1688 cor_lat_m = cor_lat_dd *
DEG2RAD * rtm;
1691 cor_lon_dd = (dLon - lonInit);
1695 cor_rad_km = dRadius - radInit;
1696 cor_rad_m = cor_rad_km * 1000.;
1701 cor_lat_dd = corrections(0) *
RAD2DEG;
1702 cor_lon_dd = corrections(1) *
RAD2DEG;
1703 cor_rad_m = corrections(2) * 1000.0;
1705 cor_lat_m = bundlecontrolpoint->adjustedSurfacePoint().LatitudeToMeters(corrections(0));
1706 cor_lon_m = bundlecontrolpoint->adjustedSurfacePoint().LongitudeToMeters(corrections(1));
1707 cor_rad_km = corrections(2);
1710 latInit = dLat - cor_lat_dd;
1714 lonInit = dLon - cor_lon_dd;
1718 radInit = dRadius - corrections(2);
1723 strStatus =
"FIXED";
1726 strStatus =
"CONSTRAINED";
1732 strStatus =
"UNKNOWN";
1736 dSigmaLat = bundlecontrolpoint->adjustedSurfacePoint().GetLatSigmaDistance().meters();
1737 dSigmaLong = bundlecontrolpoint->adjustedSurfacePoint().GetLonSigmaDistance().meters();
1738 dSigmaRadius = bundlecontrolpoint->adjustedSurfacePoint().GetLocalRadiusSigma().meters();
1740 snprintf(buf,
sizeof(buf),
"%s,%s,%d,%d,%6.2lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,"
1741 "%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1742 bundlecontrolpoint->id().toLatin1().data(), strStatus.toLatin1().data(),
1743 numMeasures, numRejectedMeasures, dResidualRms, dLat, dLon, dRadius, dSigmaLat,
1744 dSigmaLong, dSigmaRadius, cor_lat_m, cor_lon_m, cor_rad_m, dX, dY, dZ);
1747 snprintf(buf,
sizeof(buf),
"%s,%s,%d,%d,%6.2lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,"
1748 "%16.8lf,%16.8lf\n",
1749 bundlecontrolpoint->id().toLatin1().data(), strStatus.toLatin1().data(),
1750 numMeasures, numRejectedMeasures, dResidualRms, dLat, dLon, dRadius, cor_lat_m,
1751 cor_lon_m, cor_rad_m, dX, dY, dZ);
1770 QString ofname =
"bundleout_lidar.csv";
1771 ofname =
m_settings->outputFilePrefix() + ofname;
1772 m_csvSavedPointsFilename = ofname;
1774 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1787 snprintf(buf,
sizeof(buf),
",,measured,a priori,adjusted,adjusted\n"
1788 "point,image,range,sigma,range,sigma,residual\n"
1789 "id,name,(km),(km),(km),(km),(km)\n");
1792 snprintf(buf,
sizeof(buf),
",,measured,a priori,adjusted\n"
1793 "point,image,range,sigma,range,residual\n"
1794 "id,name,(km),(km),(km),(km)\n");
1798 for (
int i = 0; i < numPoints; i++) {
1801 if (!point || point->isRejected()) {
1805 int nRangeConstraints = point->numberRangeConstraints();
1806 for (
int j = 0; j < nRangeConstraints; j++) {
1809 QString str = rangeConstraint->formatBundleOutputString(
m_settings->errorPropagation());
1828 QString ofname =
"residuals.csv";
1829 ofname =
m_settings->outputFilePrefix() + ofname;
1830 m_csvSavedResidualsFilename = ofname;
1832 std::ofstream fpOut(ofname.toLatin1().data(), std::ios::out);
1839 snprintf(buf,
sizeof(buf),
",,,x image,y image,Measured,Measured,sample,line,Residual Vector\n");
1841 snprintf(buf,
sizeof(buf),
"Point,Image,Image,coordinate,coordinate,"
1842 "Sample,Line,residual,residual,Magnitude\n");
1844 snprintf(buf,
sizeof(buf),
"Label,Filename,Serial Number,(mm),(mm),"
1845 "(pixels),(pixels),(pixels),(pixels),(pixels),Rejected\n");
1851 int numMeasures = 0;
1856 for (
int i = 0; i < numPoints; i++) {
1858 numMeasures = bundleControlPoint->size();
1860 if (bundleControlPoint->rawControlPoint()->IsIgnored()) {
1864 for (
int j = 0; j < numMeasures; j++) {
1865 bundleMeasure = bundleControlPoint->at(j);
1867 Camera *measureCamera = bundleMeasure->camera();
1868 if (!measureCamera) {
1872 if (bundleMeasure->isRejected()) {
1873 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,*\n",
1874 bundleControlPoint->id().toLatin1().data(),
1875 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1876 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1877 bundleMeasure->focalPlaneMeasuredX(),
1878 bundleMeasure->focalPlaneMeasuredY(),
1879 bundleMeasure->sample(),
1880 bundleMeasure->line(),
1881 bundleMeasure->sampleResidual(),
1882 bundleMeasure->lineResidual(),
1883 bundleMeasure->residualMagnitude());
1886 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1887 bundleControlPoint->id().toLatin1().data(),
1888 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1889 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1890 bundleMeasure->focalPlaneMeasuredX(),
1891 bundleMeasure->focalPlaneMeasuredY(),
1892 bundleMeasure->sample(),
1893 bundleMeasure->line(),
1894 bundleMeasure->sampleResidual(),
1895 bundleMeasure->lineResidual(),
1896 bundleMeasure->residualMagnitude());
1907 for (
int i = 0; i < numPoints; i++) {
1909 numMeasures = bundleLidarPoint->size();
1911 if (bundleLidarPoint->rawControlPoint()->IsIgnored()) {
1915 for (
int j = 0; j < numMeasures; j++) {
1916 bundleMeasure = bundleLidarPoint->at(j);
1918 Camera *measureCamera = bundleMeasure->camera();
1919 if (!measureCamera) {
1923 if (bundleMeasure->isRejected()) {
1924 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,*\n",
1925 bundleLidarPoint->id().toLatin1().data(),
1926 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1927 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1928 bundleMeasure->focalPlaneMeasuredX(),
1929 bundleMeasure->focalPlaneMeasuredY(),
1930 bundleMeasure->sample(),
1931 bundleMeasure->line(),
1932 bundleMeasure->sampleResidual(),
1933 bundleMeasure->lineResidual(),
1934 bundleMeasure->residualMagnitude());
1937 snprintf(buf,
sizeof(buf),
"%s,%s,%s,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf,%16.8lf\n",
1938 bundleLidarPoint->id().toLatin1().data(),
1939 bundleMeasure->parentBundleImage()->fileName().toLatin1().data(),
1940 bundleMeasure->cubeSerialNumber().toLatin1().data(),
1941 bundleMeasure->focalPlaneMeasuredX(),
1942 bundleMeasure->focalPlaneMeasuredY(),
1943 bundleMeasure->sample(),
1944 bundleMeasure->line(),
1945 bundleMeasure->sampleResidual(),
1946 bundleMeasure->lineResidual(),
1947 bundleMeasure->residualMagnitude());
1979 QString relativePath;
1980 QString relativeBundlePath;
1989 if (oldPath != newPath) {
1991 QDir bundleDir(newPath);
1992 if (!bundleDir.mkpath(bundleDir.path())) {
1994 QString(
"Failed to create directory [%1]")
1995 .arg(bundleSolutionInfoRoot.
path()),
2000 if (!QFile::copy(oldFile, newFile)) {
2002 QString(
"Failed to copy file [%1] to new file [%2]")
2006 newFile = newPath +
"/" +
FileName(m_txtBundleOutputFilename).
name();
2007 if (!QFile::copy(m_txtBundleOutputFilename, newFile)) {
2009 QString(
"Failed to copy file [%1] to new file [%2]")
2010 .arg(m_txtBundleOutputFilename).arg(newFile),
2013 newFile = newPath +
"/" +
FileName(m_csvSavedImagesFilename).
name();
2014 if (!QFile::copy(m_csvSavedImagesFilename, newFile)) {
2016 QString(
"Failed to copy file [%1] to new file [%2]")
2017 .arg(m_csvSavedImagesFilename).arg(newFile),
2020 newFile = newPath +
"/" +
FileName(m_csvSavedPointsFilename).
name();
2021 if (!QFile::copy(m_csvSavedPointsFilename, newFile)) {
2023 QString(
"Failed to copy file [%1] to new file [%2]")
2024 .arg(m_csvSavedPointsFilename).arg(newFile),
2027 newFile = newPath +
"/" +
FileName(m_csvSavedResidualsFilename).
name();
2028 if (!QFile::copy(m_csvSavedResidualsFilename, newFile)) {
2030 QString(
"Failed to copy file [%1] to new file [%2]")
2031 .arg(m_csvSavedResidualsFilename).arg(newFile),
2039 if (relativePath.startsWith(
"/")) {
2040 relativePath.remove(0,1);
2046 if (relativeBundlePath.startsWith(
"/")) {
2047 relativeBundlePath.remove(0,1);
2049 relativeBundlePath +=
"/";
2052 stream.writeStartElement(
"bundleSolutionInfo");
2054 stream.writeStartElement(
"generalAttributes");
2055 stream.writeTextElement(
"id",
m_id->toString());
2056 stream.writeTextElement(
"name",
m_name);
2057 stream.writeTextElement(
"runTime",
runTime());
2059 stream.writeTextElement(
"inputFileName",
2061 stream.writeTextElement(
"bundleOutTXT",
2062 relativeBundlePath +
FileName(m_txtBundleOutputFilename).
name());
2063 stream.writeTextElement(
"imagesCSV",
2064 relativeBundlePath +
FileName(m_csvSavedImagesFilename).
name());
2065 stream.writeTextElement(
"pointsCSV",
2066 relativeBundlePath +
FileName(m_csvSavedPointsFilename).
name());
2067 stream.writeTextElement(
"residualsCSV",
2068 relativeBundlePath +
FileName(m_csvSavedResidualsFilename).
name());
2069 stream.writeEndElement();
2080 stream.writeStartElement(
"imageLists");
2084 stream.writeEndElement();
2088 stream.writeStartElement(
"outputControl");
2090 stream.writeEndElement();
2093 stream.writeEndElement();
2106 SurfacePoint::CoordIndex coordIdx)
const {
2108 switch (
m_settings->controlPointCoordTypeReports()) {
2111 case SurfacePoint::One:
2112 coordName =
" Latitude";
2114 case SurfacePoint::Two:
2115 coordName =
"Longitude";
2117 case SurfacePoint::Three:
2118 coordName =
" Radius";
2121 IString msg =
"Unknown surface point index enum ["
2129 case SurfacePoint::One:
2130 coordName =
"POINT X";
2132 case SurfacePoint::Two:
2133 coordName =
"POINT Y";
2135 case SurfacePoint::Three:
2136 coordName =
"POINT Z";
2139 IString msg =
"Unknown surface point index enum ["
2146 IString msg =
"Unknown surface point coordinate type enum ["
double degrees() const
Get the angle in units of Degrees.
This class is used to modify and manage solve settings for 1 to many BundleObservations.
bool solveTwist() const
Accesses the flag for solving for twist.
bool solvePolyOverPointing() const
Whether or not the solve polynomial will be fit over the existing pointing polynomial.
int numberCameraPositionCoefficientsSolved() const
Accesses the number of camera position coefficients in the solution.
int ckDegree() const
Accesses the degree of polynomial fit to original camera angles (ckDegree).
QList< double > aprioriPositionSigmas() const
Accesses the a priori position sigmas.
QList< double > aprioriPointingSigmas() const
Accesses the a priori pointing sigmas.
int ckSolveDegree() const
Accesses the degree of the camera angles polynomial being fit to in the bundle adjustment (ckSolveDeg...
bool solvePositionOverHermite() const
Whether or not the polynomial for solving will be fit over an existing Hermite spline.
int numberCameraAngleCoefficientsSolved() const
Accesses the number of camera angle coefficients in the solution.
int spkSolveDegree() const
Accesses the degree of thecamera position polynomial being fit to in the bundle adjustment (spkSolveD...
int spkDegree() const
Accesses the degree of the polynomial fit to the original camera position (spkDegree).
A container class for statistical results from a BundleAdjust solution.
bool outputResiduals()
Outputs image coordinate residuals to a csv file.
bool outputImagesCSV()
Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observa...
BundleSettingsQsp m_settings
Bundle settings.
QString inputControlNetFileName() const
Returns the name of the input control network.
QString m_runTime
Run time of the bundle adjustment.
void save(QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
Saves the BundleSolutionInfo to the project.
QString inputLidarDataFileName() const
Returns name of input lidar data file (if any).
void addAdjustedImages(ImageList *images)
Adds a list of images that were adjusted (their labels were updated).
QString savedPointsFilename()
Returns filename of output bundle points csv file.
QUuid * m_id
A unique ID for this BundleSolutionInfo object (useful for others to reference this object when savin...
BundleSettingsQsp bundleSettings()
Returns bundle settings.
void setName(QString name)
Sets the name of the bundle.
QList< ImageList * > * m_adjustedImages
Adjusted image list.
FileName * m_inputControlNetFileName
Input control network file name.
QString m_xmlHandlerCharacters
List of characters that have been handled.
void setOutputControl(Control *outputControl)
Returns the name of the output control network.
BundleSolutionInfo(BundleSettingsQsp inputSettings, FileName controlNetworkFileName, BundleResults outputStatistics, QList< ImageList * > imgList, QObject *parent=0)
Constructor.
QList< ImageList * > adjustedImages() const
Returns the list of images that were adjusted after a bundle.
QList< ImageList * > * m_images
Input image list.
FileName * m_inputLidarDataFileName
Input lidar data file name.
QString surfacePointCoordName(SurfacePoint::CoordinateType type, SurfacePoint::CoordIndex coordInx) const
Determine the control point coordinate name.
QString savedResidualsFilename()
Returns filename of output bundle residuals csv file.
void setOutputControlName(QString name)
Sets m_outputControlName.
BundleResults bundleResults()
Returns the bundle results.
QString id() const
Get a unique, identifying string associated with this BundleSolutionInfo object.
void setRunTime(QString runTime)
Sets the run time, and the name if a name is not already set.
bool outputPointsCSV()
Outputs point data to a csv file.
QString outputControlName() const
Returns m_outputControlName.
void updateFileName(Project *)
TODO: change description below to something more like english.
QString outputControlNetFileName() const
Returns the name of the output control network.
BundleResults * m_statisticsResults
Bundle statistical results.
~BundleSolutionInfo()
Destructor.
QString runTime() const
Returns the run time.
bool outputHeader(std::ofstream &fpOut)
Output header for bundle results file.
LidarData * m_outputLidarDataSet
QList of adjusted lidar points.
QString name() const
Returns the name of the bundle.
QString savedBundleOutputFilename()
Returns bundleout text filename.
bool outputText()
Outputs a text file with the results of the BundleAdjust.
Control * m_outputControl
Output control.
QString savedImagesFilename()
Returns filename of output bundle images csv file.
QList< ImageList * > imageList()
Returns the images used in the bundle.
void setOutputStatistics(BundleResults statisticsResults)
Sets the stat results.
QString m_name
Name of the bundle. Defaults to the id.
bool outputImagesCSVHeader(std::ofstream &fpOut, BundleObservationQsp observations)
Outputs the header for the bundleout_images.csv file.
Control * control() const
Returns bundle output Control object.
bool outputLidarCSV()
Outputs lidar data to a csv file.
This represents an ISIS control net in a project-based GUI interface.
@ Constrained
A Constrained point is a Control Point whose lat/lon/radius is somewhat established and should not be...
@ Free
A Free point is a Control Point that identifies common measurements between two or more cubes.
@ Fixed
A Fixed point is a Control Point whose lat/lon is well established and should not be changed.
Displacement is a signed length, usually in meters.
@ Kilometers
The distance is being specified in kilometers.
double kilometers() const
Get the distance in kilometers.
File name manipulation and expansion.
QString path() const
Returns the path of the file name.
QDir dir() const
Returns the path of the file's parent directory as a QDir object.
QString name() const
Returns the name of the file excluding the path and the attributes in the file name.
QString expanded() const
Returns a QString of the full file name including the file path, excluding the attributes.
QString toString() const
Returns a QString of the full file name including the file path, excluding the attributes with any Is...
@ Unknown
A type of error that cannot be classified as any of the other error types.
@ Programmer
This error is for when a programmer made an API call that was illegal.
@ Io
A type of error that occurred when performing an actual I/O operation.
Adds specific functionality to C++ strings.
Internalizes a list of images and allows for operations on the entire list.
static QString modelToString(Model model)
Static method to return a string represtentation for a given MaximumLikelihoodWFunctions::Model enum.
The main project for ipce.
static QString cnetRoot(QString projectRoot)
Appends the root directory name 'cnets' to the project.
static QString bundleSolutionInfoRoot(QString projectRoot)
Appends the root directory name 'bundle' to the project results directory.
QString newProjectRoot() const
Get the top-level folder of the new project.
QString projectRoot() const
Get the top-level folder of the project.
This class is used to accumulate statistics on double arrays.
void AddData(const double *data, const unsigned int count)
Add an array of doubles to the accumulators and counters.
double Rms() const
Computes and returns the rms.
This class defines a body-fixed surface point.
CoordinateType
Defines the coordinate typ, units, and coordinate index for some of the output methods.
@ Latitudinal
Planetocentric latitudinal (lat/lon/rad) coordinates.
@ Rectangular
Body-fixed rectangular x/y/z coordinates.
static QString coordinateTypeToString(CoordinateType type)
Converts the given SurfacePoint::CoordinateType enumeration to a string.
Latitude GetLatitude() const
Return the body-fixed latitude for the surface point.
Longitude GetLongitude() const
Return the body-fixed longitude for the surface point.
Distance GetLocalRadius() const
Return the radius of the surface point.
static QString CurrentLocalTime()
Returns the current local time This time is taken directly from the system clock, so if the system cl...
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
This is free and unencumbered software released into the public domain.
QSharedPointer< LidarData > LidarDataQsp
Definition for a shared pointer to a LidarData object.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
QSharedPointer< BundleLidarControlPoint > BundleLidarControlPointQsp
QSharedPointer to a BundleLidarControlPoint.
QSharedPointer< BundleSettings > BundleSettingsQsp
Definition for a BundleSettingsQsp, a shared pointer to a BundleSettings object.
QSharedPointer< BundleLidarRangeConstraint > BundleLidarRangeConstraintQsp
Typdef for BundleLidarRangeConstraint QSharedPointer.
QSharedPointer< BundleObservation > BundleObservationQsp
Typdef for BundleObservation QSharedPointer.
const double DEG2RAD
Multiplier for converting from degrees to radians.
const double Null
Value for an Isis Null pixel.
QSharedPointer< BundleControlPoint > BundleControlPointQsp
Definition for BundleControlPointQSP, a shared pointer to a BundleControlPoint.
bool IsSpecial(const double d)
Returns if the input pixel is special.
const double RAD2DEG
Multiplier for converting from radians to degrees.
QSharedPointer< BundleMeasure > BundleMeasureQsp
Definition for BundleMeasureQsp, a shared pointer to a BundleMeasure.