Isis 3.0
Back | Home
Isis::BundleSolutionInfo Class Reference

Container class for BundleAdjustment results. More...

#include <BundleSolutionInfo.h>

Inherits QObject.

Public Slots

void updateFileName (Project *)
 Change the on-disk file name for the control network used to be where the control network ought to be in the given project. More...
 

Public Member Functions

 BundleSolutionInfo (BundleSettingsQsp inputSettings, FileName controlNetworkFileName, BundleResults outputStatistics, QObject *parent=0)
 Constructor. More...
 
 BundleSolutionInfo (Project *project, XmlStackedHandlerReader *xmlReader, QObject *parent=0)
 Constructor. More...
 
 BundleSolutionInfo (FileName bundleSolutionInfoFile)
 Constructor. More...
 
 BundleSolutionInfo (const BundleSolutionInfo &src)
 Constructor. More...
 
 ~BundleSolutionInfo ()
 Destructor. More...
 
BundleSolutionInfooperator= (const BundleSolutionInfo &src)
 Creates an equal operator for BundleSolutionInfos. More...
 
void setOutputStatistics (BundleResults statisticsResults)
 Sets the stat results. More...
 
void setRunTime (QString runTime)
 Sets the run time. More...
 
QString id () const
 Get a unique, identifying string associated with this BundleSolutionInfo object. More...
 
QString controlNetworkFileName () const
 Returns the name of the control network. More...
 
BundleSettingsQsp bundleSettings ()
 Returns the bundle settings. More...
 
BundleResults bundleResults ()
 Returns the bundle results. More...
 
QString runTime () const
 Returns the run time. More...
 
bool outputImagesCSVHeader (std::ofstream &fpOut)
 Outputs the header for the bundleout_images.csv file. More...
 
bool outputHeader (std::ofstream &fpOut)
 Output header for bundle results file. More...
 
bool outputText ()
 Outputs a text file with the results of the BundleAdjust. More...
 
bool outputImagesCSV ()
 Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observation. More...
 
bool outputPointsCSV ()
 Outputs point data to a csv file. More...
 
bool outputResiduals ()
 Outputs image coordinate residuals to a csv file. More...
 
PvlObject pvlObject (QString resultsName="BundleSolutionInfo", QString settingsName="InputSettings", QString statisticsName="StatisticsResults")
 Writes the results from BundleAdjust to a Pvl. More...
 
void save (QXmlStreamWriter &stream, const Project *project, FileName newProjectRoot) const
 Saves the BundleSolutionInfo to the project. More...
 
void save (QXmlStreamWriter &stream, const Project *project) const
 Saves the BundleSolutionInfo to the project. More...
 
QDataStream & write (QDataStream &stream) const
 Writes the data to the stream. More...
 
QDataStream & read (QDataStream &stream)
 Reads the data from the stream. More...
 
void writeH5File (FileName outputFileName) const
 
void readH5File (FileName outputFileName) const
 
void createH5File (FileName outputFileName) const
 Creates a new file using H5F_ACC_EXCL. More...
 
void openH5File (FileName outputFileName)
 Reads the settings and results from another BundleSolutionInfo. More...
 

Detailed Description

Container class for BundleAdjustment results.

This class includes the settings used to run the bundle adjustment, the resulting statistics values, and the name of the control network used.

Author
2014-07-08 Jeannie Backer

Constructor & Destructor Documentation

Isis::BundleSolutionInfo::BundleSolutionInfo ( BundleSettingsQsp  inputSettings,
FileName  controlNetworkFileName,
BundleResults  outputStatistics,
QObject parent = 0 
)

Constructor.

Creates a BundleSolutionInfo.

Parameters
inputSettingsThe settings saved in BundleSolutionInfo
controlNetworkFileNameThe file name and path of the control network
outputStatisticsThe results of the BundleAdjust
parentThe Qt-relationship parent
Isis::BundleSolutionInfo::BundleSolutionInfo ( Project project,
XmlStackedHandlerReader xmlReader,
QObject parent = 0 
)

Constructor.

Creates a BundleSolutionInfo.

Parameters
projectThe current project
xmlReaderAn XML reader that's up to an <bundleSettings> tag.
parentThe Qt-relationship parent

References Isis::XmlStackedHandlerReader::pushContentHandler().

Isis::BundleSolutionInfo::BundleSolutionInfo ( FileName  bundleSolutionInfoFile)

Constructor.

Creates a BundleSolutionInfo.

Parameters
bundleSolutionInfoFilename of another BundleSolutionInfo and reads the settings and BundleResults from that.

References openH5File().

Isis::BundleSolutionInfo::BundleSolutionInfo ( const BundleSolutionInfo src)

Constructor.

Creates a BundleSolutionInfo.

Parameters
srcBundleSolutionInfo where the settings and BundleResults are read from.
Isis::BundleSolutionInfo::~BundleSolutionInfo ( )

Destructor.

Member Function Documentation

BundleResults Isis::BundleSolutionInfo::bundleResults ( )

Returns the bundle results.

Exceptions
IException::Unknown"Results for this bundle is NULL."
Returns
BundleResults The bundle results.

References _FILEINFO_, and Isis::IException::Unknown.

Referenced by Isis::JigsawDialog::bundleFinished(), Isis::ProjectItem::ProjectItem(), and pvlObject().

BundleSettingsQsp Isis::BundleSolutionInfo::bundleSettings ( )

Returns the bundle settings.

Returns
BundleSettingsQsp The bundle settings.

Referenced by Isis::Project::addBundleSolutionInfo(), Isis::ProjectItem::ProjectItem(), and pvlObject().

QString Isis::BundleSolutionInfo::controlNetworkFileName ( ) const

Returns the name of the control network.

Returns
QString The name of the control network.

References Isis::FileName::expanded().

Referenced by Isis::ProjectItem::ProjectItem(), pvlObject(), and read().

void Isis::BundleSolutionInfo::createH5File ( FileName  outputFileName) const

Creates a new file using H5F_ACC_EXCL.

Exceptions
IException::Io"A file already exists with the given name ["
IException::Unknown"H5 exception handler has detected an error when invoking the function"
IException::Unknown"Unable to save bundle solution information to an HDF5 file."
Parameters
outputFileNameThe name of the file we are creating.

References _FILEINFO_, Isis::BundleResults::createH5Group(), Isis::FileName::expanded(), Isis::FileName::fileExists(), Isis::IException::Io, and Isis::IException::Unknown.

Referenced by Isis::Project::addBundleSolutionInfo().

QString Isis::BundleSolutionInfo::id ( ) const

Get a unique, identifying string associated with this BundleSolutionInfo object.

Returns
QString A unique ID for this BundleSolutionInfo object

Referenced by Isis::Project::loadBundleSolutionInfo(), and read().

void Isis::BundleSolutionInfo::openH5File ( FileName  bundleSolutionInfoFile)

Reads the settings and results from another BundleSolutionInfo.

Exceptions
IException::Io"No file with the given name was found."
IException::Io"The given file is unsupported for constructing BundleSolutionInfo objects. Supported file types include [hdf]."
IException::Unknown"H5 exception handler has detected an error when invoking the function"
IException::Unknown"Unable to read bundle solution information from the given HDF5 file"
Parameters
bundleSolutionInfoFileThe name of the BundleSolutionInfo we are reading from

References _FILEINFO_, Isis::ImageList::append(), Isis::FileName::expanded(), Isis::FileName::extension(), Isis::FileName::fileExists(), Isis::IException::Io, Isis::BundleResults::openH5Group(), and Isis::IException::Unknown.

Referenced by BundleSolutionInfo().

BundleSolutionInfo & Isis::BundleSolutionInfo::operator= ( const BundleSolutionInfo src)

Creates an equal operator for BundleSolutionInfos.

Parameters
srcthe BundleSolutionInfo that we are comparing the current BundleSolutionInfo to.
Returns
BundleSolutionInfo Reference to the current BundleSolutionInfo

References Isis::FileName::expanded().

bool Isis::BundleSolutionInfo::outputHeader ( std::ofstream &  fpOut)

Output header for bundle results file.

Parameters
fpOutThe output stream that the header will be sent to.
Returns
bool If the header was successfully output to the output stream.
Exceptions
IException::Io"Failed to output residual percentiles for bundleout"
IException::Io"Failed to output residual box plot for bundleout"

References _FILEINFO_, Isis::BundleObservationSolveSettings::aprioriPointingSigmas(), Isis::BundleObservationSolveSettings::aprioriPositionSigmas(), Isis::BundleObservationSolveSettings::ckDegree(), Isis::BundleObservationSolveSettings::ckSolveDegree(), Isis::iTime::CurrentLocalTime(), Isis::BundleResults::elapsedTime(), Isis::BundleResults::elapsedTimeErrorProp(), Isis::FileName::expanded(), Isis::IException::Io, Isis::BundleResults::iterations(), Isis::StatCumProbDistDynCalc::max(), Isis::BundleResults::maximumLikelihoodModelQuantile(), Isis::BundleResults::maximumLikelihoodModelWFunc(), Isis::StatCumProbDistDynCalc::min(), Isis::MaximumLikelihoodWFunctions::modelToString(), Isis::Null, Isis::BundleObservationSolveSettings::numberCameraAngleCoefficientsSolved(), Isis::BundleObservationSolveSettings::numberCameraPositionCoefficientsSolved(), Isis::BundleResults::numberConstrainedImageParameters(), Isis::BundleResults::numberConstrainedPointParameters(), Isis::BundleResults::numberConstrainedTargetParameters(), Isis::BundleResults::numberObservations(), Isis::BundleResults::numberRejectedObservations(), Isis::BundleResults::numberUnknownParameters(), Isis::BundleResults::observations(), Isis::BundleResults::outputControlNet(), Isis::BundleResults::residualsCumulativeProbabilityDistribution(), Isis::BundleResults::sigma0(), Isis::BundleObservationSolveSettings::solvePolyOverPointing(), Isis::BundleObservationSolveSettings::solvePositionOverHermite(), Isis::BundleObservationSolveSettings::solveTwist(), Isis::BundleObservationSolveSettings::spkDegree(), Isis::BundleObservationSolveSettings::spkSolveDegree(), Isis::MaximumLikelihoodWFunctions::tweakingConstant(), Isis::StatCumProbDistDynCalc::value(), and Isis::MaximumLikelihoodWFunctions::weightedResidualCutoff().

Referenced by outputText().

bool Isis::BundleSolutionInfo::outputImagesCSV ( )

Outputs the bundleout_images.csv file which contains Jigsaw data about the images within each observation.

Returns
True upon success, False if something went wrong.

References Isis::BundleResults::converged(), Isis::BundleResults::observations(), outputImagesCSVHeader(), Isis::BundleResults::rmsImageLineResiduals(), Isis::BundleResults::rmsImageResiduals(), Isis::BundleResults::rmsImageSampleResiduals(), and Isis::toString().

bool Isis::BundleSolutionInfo::outputImagesCSVHeader ( std::ofstream &  fpOut)

Outputs the header for the bundleout_images.csv file.

Parameters
fpOutThe output file stream.
Returns
True if the write is successful, False otherwise.

References Isis::BundleObservationSolveSettings::numberCameraAngleCoefficientsSolved(), Isis::BundleObservationSolveSettings::numberCameraPositionCoefficientsSolved(), and Isis::toString().

Referenced by outputImagesCSV().

bool Isis::BundleSolutionInfo::outputPointsCSV ( )

Outputs point data to a csv file.

Returns
bool If the point data was successfully output.

References Isis::BundleResults::bundleControlPoints(), Isis::ControlPoint::Constrained, Isis::DEG2RAD(), Isis::ControlPoint::Fixed, Isis::ControlPoint::Free, and Isis::BundleResults::radiansToMeters().

bool Isis::BundleSolutionInfo::outputResiduals ( )

Outputs image coordinate residuals to a csv file.

Returns
bool If the residuals were successfully output.

References Isis::BundleResults::bundleControlPoints().

PvlObject Isis::BundleSolutionInfo::pvlObject ( QString  resultsName = "BundleSolutionInfo",
QString  settingsName = "InputSettings",
QString  statisticsName = "StatisticsResults" 
)

Writes the results from BundleAdjust to a Pvl.

Parameters
resultsNameThe name of the results
settingsNameThe name of the settings
statisticsNameThe name of the statistics
Returns
PvlObject The PvlObject that we are writing to

References bundleResults(), bundleSettings(), controlNetworkFileName(), Isis::FileName::expanded(), Isis::BundleResults::pvlObject(), and runTime().

QDataStream & Isis::BundleSolutionInfo::read ( QDataStream &  stream)

Reads the data from the stream.

Parameters
streamThe stream we are reading from
Returns
QDataStream The stream we read from

References controlNetworkFileName(), and id().

Referenced by Isis::operator>>().

void Isis::BundleSolutionInfo::readH5File ( FileName  outputFileName) const
QString Isis::BundleSolutionInfo::runTime ( ) const

Returns the run time.

Returns
QString The run time.

Referenced by Isis::Project::addBundleSolutionInfo(), pvlObject(), save(), Isis::ProjectItem::setBundleSolutionInfo(), and setRunTime().

void Isis::BundleSolutionInfo::save ( QXmlStreamWriter &  stream,
const Project project,
FileName  newProjectRoot 
) const

Saves the BundleSolutionInfo to the project.

Output format:

<image id="..." filename="..."> ... </image>

(fileName attribute is just the base name)

Parameters
streamThe stream to which the BundleSolutionInfo will be saved
projectThe project to which this BundleSolutionInfo will be saved
newProjectRootThe location of the project root directory. This is not used.

References Isis::FileName::expanded(), runTime(), and Isis::BundleResults::save().

void Isis::BundleSolutionInfo::save ( QXmlStreamWriter &  stream,
const Project project 
) const

Saves the BundleSolutionInfo to the project.

Parameters
streamThe stream to which the BundleSolutionInfo will be saved
projectThe project to which this BundleSolutionInfo will be saved

References Isis::FileName::expanded(), runTime(), and Isis::BundleResults::save().

void Isis::BundleSolutionInfo::setOutputStatistics ( BundleResults  statisticsResults)

Sets the stat results.

Parameters
statisticsResultsThe new BundleResults
void Isis::BundleSolutionInfo::setRunTime ( QString  runTime)

Sets the run time.

Parameters
runTimeThe run time.

References runTime().

Referenced by Isis::JigsawDialog::bundleFinished().

void Isis::BundleSolutionInfo::updateFileName ( Project project)
slot

Change the on-disk file name for the control network used to be where the control network ought to be in the given project.

This method is modelled after the updateFileName() methods in Image and Control. Those methods close something (cubes for Image and a control net for control) but there is not a close method in BundleSolutionInfo.

Parameters
projectThe project that this BundleSolutionInfo is stored in

References Isis::Project::cnetRoot(), Isis::FileName::dir(), Isis::FileName::expanded(), and Isis::FileName::name().

QDataStream & Isis::BundleSolutionInfo::write ( QDataStream &  stream) const

Writes the data to the stream.

Parameters
streamThe stream we are writing to and returning
Returns
QDataStream The stream we wrote to

References Isis::FileName::expanded().

Referenced by Isis::operator<<().

void Isis::BundleSolutionInfo::writeH5File ( FileName  outputFileName) const

The documentation for this class was generated from the following files:

U.S. Department of the Interior | U.S. Geological Survey
ISIS | Privacy & Disclaimers | Astrogeology Research Program
To contact us, please post comments and questions on the ISIS Support Center
File Modified: 07/12/2023 23:32:43