Isis 3 Programmer Reference
Isis::BundleObservation Class Reference

Class for bundle observations. More...

#include <BundleObservation.h>

Inheritance diagram for Isis::BundleObservation:
Inheritance graph
Collaboration diagram for Isis::BundleObservation:
Collaboration graph

Public Member Functions

 BundleObservation ()
 Constructs a BundleObservation initialized to a default state. More...
 
 BundleObservation (BundleImageQsp image, QString observationNumber, QString instrumentId, BundleTargetBodyQsp bundleTargetBody)
 Constructs a BundleObservation from an BundleImage, an instrument id, an observation number to assign to this BundleObservation, and a target body. More...
 
 BundleObservation (const BundleObservation &src)
 Creates a copy of another BundleObservation. More...
 
 ~BundleObservation ()
 Destructor. More...
 
BundleObservationoperator= (const BundleObservation &src)
 Assignment operator. More...
 
void copy (const BundleObservation &src)
 
void append (const BundleImageQsp &value)
 Appends a BundleImage shared pointer to the BundleObservation. More...
 
BundleImageQsp imageByCubeSerialNumber (QString cubeSerialNumber)
 Returns the BundleImage shared pointer associated with the given serial number. More...
 
bool setSolveSettings (BundleObservationSolveSettings solveSettings)
 Set solve parameters. More...
 
void setIndex (int n)
 Sets the index for the observation. More...
 
int index ()
 Accesses the observation's index. More...
 
int numberPositionParameters ()
 Returns the number of position parameters there are. More...
 
int numberPointingParameters ()
 Returns the number of pointing parameters being solved for. More...
 
int numberParameters ()
 Returns the number of total parameters there are for solving. More...
 
QString instrumentId ()
 Accesses the instrument id. More...
 
SpiceRotationspiceRotation ()
 Accesses the instrument's spice rotation. More...
 
SpicePositionspicePosition ()
 Accesses the instrument's spice position. More...
 
LinearAlgebra::VectorparameterWeights ()
 Accesses the solve parameter weights. More...
 
LinearAlgebra::VectorparameterCorrections ()
 Accesses the parameter corrections. More...
 
LinearAlgebra::VectoraprioriSigmas ()
 Accesses the a priori sigmas. More...
 
LinearAlgebra::VectoradjustedSigmas ()
 Accesses the adjusted sigmas. More...
 
const BundleObservationSolveSettingsQsp solveSettings ()
 Accesses the solve settings. More...
 
bool applyParameterCorrections (LinearAlgebra::Vector corrections)
 Applies the parameter corrections. More...
 
bool initializeExteriorOrientation ()
 Initializes the exterior orientation. More...
 
void initializeBodyRotation ()
 Intializes the body rotation. More...
 
void updateBodyRotation ()
 Updates the body rotation. More...
 
void bundleOutputFetchData (QVector< double > &finalParameterValues, int &nPositionCoefficients, int &nPointingCoefficients, bool &useDefaultPosition, bool &useDefaultPointing, bool &useDefaultTwist)
 Fetches data for the log file output methods. More...
 
void bundleOutputString (std::ostream &fpOut, bool errorPropagation)
 Takes in an open std::ofstream and writes out information which goes into the bundleout.txt file. More...
 
QString bundleOutputCSV (bool errorPropagation)
 Creates and returns a formatted QString representing the bundle coefficients and parameters in csv format. More...
 
QString formatBundleOutputString (bool errorPropagation, bool imageCSV=false)
 
Creates and returns a formatted QString representing the bundle coefficients and parameters More...
 
QStringList parameterList ()
 Access to parameters for CorrelationMatrix to use. More...
 
QStringList imageNames ()
 Access to image names for CorrelationMatrix to use. More...
 

Private Member Functions

bool initParameterWeights ()
 Initializes the paramater weights for solving. More...
 

Private Attributes

QString m_observationNumber
 This is typically equivalent to serial number except in the case of "observation mode" (e.g. More...
 
int m_index
 Index of this observation. More...
 
QMap< QString, BundleImageQspm_cubeSerialNumberToBundleImageMap
 Map between cube serial number and BundleImage pointers. More...
 
QStringList m_serialNumbers
 List of all cube serial numbers in observation. More...
 
QStringList m_parameterNamesList
 List of all cube parameters. More...
 
QStringList m_imageNames
 List of all cube names. More...
 
QString m_instrumentId
 Spacecraft instrument id. More...
 
BundleObservationSolveSettingsQsp m_solveSettings
 Solve settings for this observation. More...
 
SpiceRotationm_instrumentRotation
 Instrument spice rotation (in primary image). More...
 
SpicePositionm_instrumentPosition
 Instrument spice position (in primary image). More...
 
BundleTargetBodyQsp m_bundleTargetBody
 QShared pointer to BundleTargetBody. More...
 
LinearAlgebra::Vector m_weights
 Parameter weights. Cumulative parameter correction vector. More...
 
LinearAlgebra::Vector m_corrections
 
LinearAlgebra::Vector m_aprioriSigmas
 A posteriori (adjusted) parameter sigmas. More...
 
LinearAlgebra::Vector m_adjustedSigmas
 A posteriori (adjusted) parameter sigmas. More...
 

Detailed Description

Class for bundle observations.

This class is used for creating a bundle observation. Contained BundleImages are stored as shared pointers, so they will be automatically deleted when all shared pointers are deleted.

Author
2014-07-09 Ken Edmundson
History:

2014-07-09 Ken Edmundson - Original version.

2014-07-16 Jeannie Backer - Replaced QVectors with QLists.

2014-07-17 Kimberly Oyama - Added member variables and accessors for the images and parameters in this observation. They will be used for the correlation matrix.

2014-07-23 Jeannie Backer - Replaced QVectors with QLists.

2015-02-20 Jeannie Backer - Brought closer to Isis coding standards.

2016-08-03 Jesse Mapel - Changed contained member type to a QSharedPointer. Also changed m_solveSettings to a QSharedPointer. Fixes #4150.

2016-08-03 Ian Humphrey - Updated documentation and coding standards. Fixes #4078.

2016-08-10 Jeannie Backer - Replaced boost vector with Isis::LinearAlgebra::Vector. References #4163.

2016-08-15 Jesse Mapel - Added a map between cube serial number and contained bundle image. References #4159.

2016-08-23 Ian Humphrey - The applyParameterCorrections() method now throws the last exception. Fixes #4153.

2016-10-06 Tyler Wilson - Modified the function formatBundleOutputString so that it can be used by BundleSolutionInfo::outputCSVImages() function. Fixes #4314.

2016-10-26 Ian Humphrey - Modified formatBundleOutputString() to provided default values for all solve parameters, whether they are being solved for or not. Fixes #4464.

2016-10-27 Tyler Wilson - Modified formatBundleOutputString to change N/A to FREE in the output under POINTS DETAIL when no lat/lon sigmas were entered. Fixes #4317.

2016-11-14 Ken Edmundson - Modified the following... -changed adjustedSigma from 0.0 to N/A if error propagation is off when writing bundleout.txt OR images.csv. -changed sigma default from -1.0 to N/A for position and pointing parameters when writing images.csv.

2019-05-14 Tyler Wilson - Added the bundleOutputString(std::ofstream &fpOut, bool errorPropagation) function which is called by BundleSolutionInfo::outputText(). This function is a refactor of the formatBundleOutputString and uses the traditional C function sprintf instead of QString arg chaining because it's easier to make the output columns align nicely. Also, it maintains consistency with text output in BundleSolutionInfo.

2019-06-03 Tyler Wilson - Deleted the formatBundleOutputString and added the functions bundleOutputCSV/bundleOutputFetchData. Combined with bundleOutputString these three functions will fulfill the same functional role formerly occuped by formatBundleOutputString but with reduced code duplication.

2019-08-15 Adam Paquette - Readded the formatBundleOutputString function and added deprication warnings to formatBundleOutputString.

2019-09-10 Adam Paquette - Changed how bundleOutputString formats the text that is written to the bundleout.txt file.

Definition at line 98 of file BundleObservation.h.

Constructor & Destructor Documentation

◆ BundleObservation() [1/3]

Isis::BundleObservation::BundleObservation ( )

Constructs a BundleObservation initialized to a default state.

Definition at line 23 of file BundleObservation.cpp.

◆ BundleObservation() [2/3]

Isis::BundleObservation::BundleObservation ( BundleImageQsp  image,
QString  observationNumber,
QString  instrumentId,
BundleTargetBodyQsp  bundleTargetBody 
)

Constructs a BundleObservation from an BundleImage, an instrument id, an observation number to assign to this BundleObservation, and a target body.

Parameters
imageQSharedPointer to the primary image in the observation
observationNumberObservation number of the observation
instrumentIdId of the instrument for the observation
bundleTargetBodyQSharedPointer to the target body of the observation

Definition at line 49 of file BundleObservation.cpp.

◆ BundleObservation() [3/3]

Isis::BundleObservation::BundleObservation ( const BundleObservation src)

◆ ~BundleObservation()

Isis::BundleObservation::~BundleObservation ( )

Destructor.

Contained BundleImages will remain until all shared pointers are deleted.

Definition at line 125 of file BundleObservation.cpp.

Member Function Documentation

◆ adjustedSigmas()

LinearAlgebra::Vector & Isis::BundleObservation::adjustedSigmas ( )

Accesses the adjusted sigmas.

Returns
LinearAlgebra::Vector Returns the adjusted sigmas

Definition at line 312 of file BundleObservation.cpp.

◆ append()

void Isis::BundleObservation::append ( const BundleImageQsp value)

Appends a BundleImage shared pointer to the BundleObservation.

If the pointer is valid, then the BundleImage and its serial number will be inserted into the serial number to BundleImage map.

Parameters
valueThe BundleImage to be appended.
See also
QVector::append()

Definition at line 165 of file BundleObservation.cpp.

◆ applyParameterCorrections()

bool Isis::BundleObservation::applyParameterCorrections ( LinearAlgebra::Vector  corrections)

Applies the parameter corrections.

Parameters
correctionsVector of corrections to apply
Exceptions
IException::Unknown"Instrument position is NULL, but position solve option is [not NoPositionFactors]"
IException::Unknown"Instrument position is NULL, but pointing solve option is [not NoPointingFactors]"
IException::Unknown"Unable to apply parameter corrections to BundleObservation."
Returns
bool Returns true upon successful application of corrections
Todo:
always returns true?

Definition at line 619 of file BundleObservation.cpp.

References _FILEINFO_, Isis::SpicePosition::SetPolynomial(), and Isis::SpiceRotation::SetPolynomial().

◆ aprioriSigmas()

LinearAlgebra::Vector & Isis::BundleObservation::aprioriSigmas ( )

Accesses the a priori sigmas.

Todo:
Returns
LinearAlgebra::Vector Returns the a priori sigmas

Definition at line 302 of file BundleObservation.cpp.

◆ bundleOutputCSV()

QString Isis::BundleObservation::bundleOutputCSV ( bool  errorPropagation)

Creates and returns a formatted QString representing the bundle coefficients and parameters in csv format.

Parameters
errorPropagationBoolean indicating whether or not to attach more information (corrections, sigmas, adjusted sigmas...) to the output QString
Returns
QString Returns a formatted QString representing the BundleObservation in csv format

Definition at line 1475 of file BundleObservation.cpp.

References Isis::IsSpecial(), Isis::RAD2DEG, and Isis::toString().

◆ bundleOutputFetchData()

void Isis::BundleObservation::bundleOutputFetchData ( QVector< double > &  finalParameterValues,
int &  nPositionCoefficients,
int &  nPointingCoefficients,
bool &  useDefaultPosition,
bool &  useDefaultPointing,
bool &  useDefaultTwist 
)

Fetches data for the log file output methods.

Parameters
finalParameterValuesReference to QVector<double> of calculated position and pointing
nPositionCoefficientsReference to int of the number of position coefficients
nPointingCoefficientsReference to int of the number of pointing coefficients
useDefaultPositionReference to boolean of whether to use default position
useDefaultPointingReference to boolean of whether to use default pointing
useDefaultTwistReference to bollean of whether to use defualt twist

Definition at line 1153 of file BundleObservation.cpp.

◆ bundleOutputString()

void Isis::BundleObservation::bundleOutputString ( std::ostream &  fpOut,
bool  errorPropagation 
)

Takes in an open std::ofstream and writes out information which goes into the bundleout.txt file.

Parameters
fpOutThe open std::ofstream object which is passed in from BundleSolutionInfo::outputText()
errorPropagationBoolean indicating whether or not to attach more information (corrections, sigmas, adjusted sigmas...) to the output.

Definition at line 1251 of file BundleObservation.cpp.

References Isis::IsSpecial(), Isis::RAD2DEG, and Isis::toString().

◆ formatBundleOutputString()

QString Isis::BundleObservation::formatBundleOutputString ( bool  errorPropagation,
bool  imageCSV = false 
)


Creates and returns a formatted QString representing the bundle coefficients and parameters

The function formatBundleOutputString is depricated as of ISIS 3.9 and will be removed in ISIS 4.0

Parameters
errorPropagationBoolean indicating whether or not to attach more information (corrections, sigmas, adjusted sigmas...) to the output QString
imageCSVBoolean which is set to true if the function is being called from BundleSolutionInfo::outputImagesCSV(). It is set to false by default for backwards compatibility.
Returns
QString Returns a formatted QString representing the BundleObservation
History:
2016-10-26 Ian Humphrey - Default values are now provided for parameters that are not being solved. Fixes #4464.

Definition at line 805 of file BundleObservation.cpp.

References Isis::IsSpecial(), Isis::RAD2DEG, and Isis::toString().

◆ imageByCubeSerialNumber()

BundleImageQsp Isis::BundleObservation::imageByCubeSerialNumber ( QString  cubeSerialNumber)

Returns the BundleImage shared pointer associated with the given serial number.

If no BundleImage with that serial number is contained a NULL pointer is returned.

Parameters
cubeSerialNumberThe serial number of the cube to be returned.
Returns
BundleImageQsp A shared pointer to the BundleImage (NULL if not found).

Definition at line 181 of file BundleObservation.cpp.

◆ imageNames()

QStringList Isis::BundleObservation::imageNames ( )

Access to image names for CorrelationMatrix to use.

Returns
QStringList Returns a QStringList of the image names

Definition at line 1586 of file BundleObservation.cpp.

◆ index()

int Isis::BundleObservation::index ( )

Accesses the observation's index.

Returns
int Returns the observation's index

Definition at line 782 of file BundleObservation.cpp.

◆ initializeBodyRotation()

void Isis::BundleObservation::initializeBodyRotation ( )

Intializes the body rotation.

Todo:
check to make sure m_bundleTargetBody is valid

Definition at line 421 of file BundleObservation.cpp.

◆ initializeExteriorOrientation()

bool Isis::BundleObservation::initializeExteriorOrientation ( )

◆ initParameterWeights()

bool Isis::BundleObservation::initParameterWeights ( )
private

Initializes the paramater weights for solving.

Returns
bool Returns true upon successful intialization
Todo:
Don't like this, don't like this, don't like this, don't like this, don't like this. By the way, this seems klunky to me, would like to come up with a better way. Also, apriori sigmas are in two places, the BundleObservationSolveSettings AND in the the BundleObservation class too - this is unnecessary should only be in the BundleObservationSolveSettings. But, they are split into position and pointing.
Todo:
always returns true?

Definition at line 513 of file BundleObservation.cpp.

References Isis::DEG2RAD.

◆ instrumentId()

QString Isis::BundleObservation::instrumentId ( )

Accesses the instrument id.

Returns
QString Returns the instrument id of the observation

Definition at line 243 of file BundleObservation.cpp.

◆ numberParameters()

int Isis::BundleObservation::numberParameters ( )

Returns the number of total parameters there are for solving.

The total number of parameters is equal to the number of position parameters and number of pointing parameters

Returns
int Returns the number of parameters there are

Definition at line 762 of file BundleObservation.cpp.

◆ numberPointingParameters()

int Isis::BundleObservation::numberPointingParameters ( )

Returns the number of pointing parameters being solved for.

Returns
int Returns the number of pointing parameters

Definition at line 744 of file BundleObservation.cpp.

◆ numberPositionParameters()

int Isis::BundleObservation::numberPositionParameters ( )

Returns the number of position parameters there are.

Returns
int Returns the number of position parameters

Definition at line 734 of file BundleObservation.cpp.

◆ operator=()

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

Assignment operator.

Assigns the state of the source BundleObservation to this BundleObservation

Parameters
BundleObservationReference to the source BundleObservation to assign from
Returns
BundleObservation& Reference to this BundleObservation

Definition at line 139 of file BundleObservation.cpp.

References m_cubeSerialNumberToBundleImageMap, m_instrumentId, m_instrumentPosition, m_instrumentRotation, m_observationNumber, m_serialNumbers, and m_solveSettings.

◆ parameterCorrections()

LinearAlgebra::Vector & Isis::BundleObservation::parameterCorrections ( )

Accesses the parameter corrections.

Returns
LinearAlgebra::Vector Returns the parameter corrections

Definition at line 283 of file BundleObservation.cpp.

◆ parameterList()

QStringList Isis::BundleObservation::parameterList ( )

Access to parameters for CorrelationMatrix to use.

Returns
QStringList Returns a QStringList of the names of the parameters

Definition at line 1576 of file BundleObservation.cpp.

◆ parameterWeights()

LinearAlgebra::Vector & Isis::BundleObservation::parameterWeights ( )

Accesses the solve parameter weights.

Returns
LinearAlgebra::Vector Returns the parameter weights for solving

Definition at line 273 of file BundleObservation.cpp.

◆ setIndex()

void Isis::BundleObservation::setIndex ( int  n)

Sets the index for the observation.

Parameters
nValue to set the index of the observation to

Definition at line 772 of file BundleObservation.cpp.

◆ setSolveSettings()

bool Isis::BundleObservation::setSolveSettings ( BundleObservationSolveSettings  solveSettings)

Set solve parameters.

Parameters
solveSettingsThe solve settings to use
Returns
bool Returns true if settings were successfully set
Todo:
initParameterWeights() doesn't return false, so this methods always returns true.

Definition at line 203 of file BundleObservation.cpp.

References Isis::Null.

◆ solveSettings()

const BundleObservationSolveSettingsQsp Isis::BundleObservation::solveSettings ( )

Accesses the solve settings.

Returns
const BundleObservationSolveSettingsQsp Returns a pointer to the solve settings for this BundleObservation

Definition at line 323 of file BundleObservation.cpp.

◆ spicePosition()

SpicePosition * Isis::BundleObservation::spicePosition ( )

Accesses the instrument's spice position.

Returns
SpicePosition* Returns the SpicePosition for this observation

Definition at line 263 of file BundleObservation.cpp.

◆ spiceRotation()

SpiceRotation * Isis::BundleObservation::spiceRotation ( )

Accesses the instrument's spice rotation.

Returns
SpiceRotation* Returns the SpiceRotation for this observation

Definition at line 253 of file BundleObservation.cpp.

◆ updateBodyRotation()

void Isis::BundleObservation::updateBodyRotation ( )

Updates the body rotation.

Todo:
Is this a duplicate of initializeBodyRotation?

Definition at line 439 of file BundleObservation.cpp.

Member Data Documentation

◆ m_adjustedSigmas

LinearAlgebra::Vector Isis::BundleObservation::m_adjustedSigmas
private

A posteriori (adjusted) parameter sigmas.

Definition at line 198 of file BundleObservation.h.

◆ m_aprioriSigmas

LinearAlgebra::Vector Isis::BundleObservation::m_aprioriSigmas
private

A posteriori (adjusted) parameter sigmas.

Definition at line 196 of file BundleObservation.h.

◆ m_bundleTargetBody

BundleTargetBodyQsp Isis::BundleObservation::m_bundleTargetBody
private

QShared pointer to BundleTargetBody.

Definition at line 188 of file BundleObservation.h.

◆ m_cubeSerialNumberToBundleImageMap

QMap<QString, BundleImageQsp> Isis::BundleObservation::m_cubeSerialNumberToBundleImageMap
private

Map between cube serial number and BundleImage pointers.

Definition at line 174 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_imageNames

QStringList Isis::BundleObservation::m_imageNames
private

List of all cube names.

Definition at line 178 of file BundleObservation.h.

◆ m_index

int Isis::BundleObservation::m_index
private

Index of this observation.

Definition at line 171 of file BundleObservation.h.

Referenced by BundleObservation().

◆ m_instrumentId

QString Isis::BundleObservation::m_instrumentId
private

Spacecraft instrument id.

Definition at line 180 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_instrumentPosition

SpicePosition* Isis::BundleObservation::m_instrumentPosition
private

Instrument spice position (in primary image).

Definition at line 185 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_instrumentRotation

SpiceRotation* Isis::BundleObservation::m_instrumentRotation
private

Instrument spice rotation (in primary image).

Definition at line 184 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_observationNumber

QString Isis::BundleObservation::m_observationNumber
private

This is typically equivalent to serial number except in the case of "observation mode" (e.g.

Lunar Orbiter) where for each image in the observation, the observation number is the serial number augmented with an additional integer.

Definition at line 165 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_parameterNamesList

QStringList Isis::BundleObservation::m_parameterNamesList
private

List of all cube parameters.

Definition at line 177 of file BundleObservation.h.

◆ m_serialNumbers

QStringList Isis::BundleObservation::m_serialNumbers
private

List of all cube serial numbers in observation.

Definition at line 176 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_solveSettings

BundleObservationSolveSettingsQsp Isis::BundleObservation::m_solveSettings
private

Solve settings for this observation.

Definition at line 182 of file BundleObservation.h.

Referenced by BundleObservation(), and operator=().

◆ m_weights

LinearAlgebra::Vector Isis::BundleObservation::m_weights
private

Parameter weights. Cumulative parameter correction vector.

Definition at line 191 of file BundleObservation.h.


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