USGS

Isis 3.0 Object Programmers' Reference

Home

Isis::BundleAdjust Class Reference

#include <BundleAdjust.h>

Collaboration diagram for Isis::BundleAdjust:
Collaboration graph

Classes

struct  SpacecraftWeights

Public Types

enum  DecompositionMethod { NoneSelected, SPECIALK, CHOLMOD }
enum  CmatrixSolveType {
  None, AnglesOnly, AnglesVelocity, AnglesVelocityAcceleration,
  CKAll
}
enum  SpacecraftPositionSolveType {
  Nothing, PositionOnly, PositionVelocity, PositionVelocityAcceleration,
  SPKAll
}

Public Member Functions

 BundleAdjust (const QString &cnetFile, const QString &cubeList, bool printSummary=true)
 BundleAdjust (const QString &cnetFile, const QString &cubeList, const QString &heldList, bool printSummary=true)
 BundleAdjust (Isis::ControlNet &cnet, Isis::SerialNumberList &snlist, bool printSummary=true)
 BundleAdjust (Isis::ControlNet &cnet, Isis::SerialNumberList &snlist, Isis::SerialNumberList &heldsnlist, bool printSummary=true)
double Solve ()
 compute partials for measure
bool SolveCholesky ()
 The solve method is a least squares solution for updating the camera pointing, etc.
Isis::ControlNetControlNet ()
Isis::SerialNumberListSerialNumberList ()
int Images () const
int Observations () const
 Return the number of observations in list given to the constructor.
QString FileName (int index)
 Return the ith filename in the cube list file given to constructor.
bool IsHeld (int index)
 Return whether the ith file in the cube list is held.
Table Cmatrix (int index)
 Return a table cmatrix for the ith cube in the cube list given to the constructor.
Table SpVector (int index)
 Return a table spacecraft vector for the ith cube in the cube list given to the constructor.
void SetSolveTwist (bool solve)
void SetSolveRadii (bool solve)
void SetUpdateCubes (bool update)
void SetSolvePolyOverHermite (bool b)
void SetSolvePolyOverPointing (bool b)
void SetErrorPropagation (bool b)
void SetOutlierRejection (bool b)
void SetRejectionMultiplier (double d)
void SetGlobalLatitudeAprioriSigma (double d)
void SetGlobalLongitudeAprioriSigma (double d)
void SetGlobalRadiiAprioriSigma (double d)
void SetGlobalSpacecraftPositionAprioriSigma (double d)
void SetGlobalSpacecraftVelocityAprioriSigma (double d)
void SetGlobalSpacecraftAccelerationAprioriSigma (double d)
void SetGlobalCameraAnglesAprioriSigma (double d)
void SetGlobalCameraAngularVelocityAprioriSigma (double d)
void SetGlobalCameraAngularAccelerationAprioriSigma (double d)
void SetStandardOutput (bool b)
void SetCSVOutput (bool b)
void SetResidualOutput (bool b)
void SetOutputFilePrefix (const QString &str)
void SetDecompositionMethod (DecompositionMethod method)
 Set decomposition method.
void SetSolveCmatrix (CmatrixSolveType type)
 For which camera angle coefficients do we solve?
void SetSolveSpacecraftPosition (SpacecraftPositionSolveType type)
 For which camera position coefficients do we solve?
void SetCKDegree (int degree)
 Set the degree of the polynomial to fit to the camera angles.
void SetSolveCKDegree (int degree)
 Set the degree of the polynomial to adjust in the solution.
void SetSPKDegree (int degree)
 Set the degree of the polynomial to fit to the camera position.
void SetSolveSPKDegree (int degree)
 Set the degree of the camera position polynomial to adjust in the solution.
int BasisColumns ()
 Determine number of columns needed for least squares.
int ComputeConstrainedParameters ()
double Error () const
double Iteration () const
int IgnoredPoints () const
int FixedPoints () const
void SetObservationMode (bool bObservationMode)
 This method turns on observation mode and creates the observation number list.
void SetConvergenceThreshold (double d)
void SetMaxIterations (int n)
void SetSolutionMethod (QString str)
 This method sets the solution method for solving the matrix and fills the point index map, which is dependent on the solution method.
void GetSparseParameterCorrections ()
 Retrieve parameter correction vector for old sparse least-squares object and parse into m_Image_Corrections and m_Point_Corrections vectors so we can use the same output as SpecialK and Cholmod Sparse solutions.
bool IsConverged ()
QString IterationSummaryGroup () const
void maximumLikelihoodSetup (QList< QString > models, QList< double > quantiles)
 This method steps up the maximum likelihood estimation solution.

Private Member Functions

void Init (Progress *progress=0)
 Initialize solution parameters.
bool validateNetwork ()
 control network validation - on the very real chance that the net has not been checked before running the bundle
void ComputeNumberPartials ()
 This method determines the number of partials per image and per point.
void ComputeImageParameterWeights ()
 Weighting for image parameter ComputeNumberPartials must be called first.
void SetSpaceCraftWeights ()
void AddPartials (int nPointIndex)
 Populate least squares matrix with measures for a point (specific to frame cameras for now).
void FillPointIndexMap ()
 This method fills the point index map and needs to know the solution method in order to work properly.
void Update (BasisFunction &basis)
 This method uses the basis function after the matrix has been solved.
int PointIndex (int i) const
 Return index to basis function for ith point.
int ImageIndex (int i) const
 Return index to basis function for image with index i.
void CheckHeldList ()
 This method checks all cube files in the held list to make sure they are in the input list.
void ApplyHeldList ()
int Triangulation (bool bDoApproximation=false)
 Populate least squares matrix with measures for a point (specific to frame cameras for now).
bool ApproximatePoint_ClosestApproach (const ControlPoint &rpoint, int nIndex)
 Calculates approximate point coordinates by the method of the closest approach of two vectors.
bool TriangulatePoint (const ControlPoint &rpoint)
 Triangulates an individual point.
bool TriangulationPartials ()
bool SetParameterWeights ()
 set parameter weighting for old SPARSE solution
void SetPostBundleSigmas ()
 Set parameter sigmas (uncertainties) after bundle.
void IterationSummary (double avErr, double sigmaXY, double sigmaHat, double sigmaX, double sigmaY)
 This method creates a iteration summary and creates an iteration group for the Sparse BundleAdjust summary.
void SpecialKIterationSummary ()
 This method creates a iteration summary and creates an iteration group for the SpecialK solution summary.
bool Output ()
 Output bundle results to file.
bool OutputHeader (std::ofstream &fp_out)
 Output header for bundle results file.
bool OutputWithErrorPropagation ()
 output bundle results to file with error propagation
bool OutputNoErrorPropagation ()
 output bundle results to file with error propagation
bool OutputPointsCSV ()
 output point data to csv file
bool OutputImagesCSV ()
 output image data to csv file
bool OutputResiduals ()
 output image coordinate residuals to comma-separated-value file
bool WrapUp ()
 Bundle wrap up.
bool ComputeBundleStatistics ()
 flags...
void Initialize ()
 Initializes matrices and parameters for bundle adjustment.
bool InitializePointWeights ()
 Initialize point coordinaate weights.
void InitializePoints ()
 Initializing points.
bool formNormalEquations ()
 Forming the least-squares normal equations matrix.
void applyParameterCorrections ()
 apply parameter corrections
bool errorPropagation ()
 error propagation.
bool solveSystem ()
 Solve normal equations system.
bool formNormalEquations_CHOLMOD ()
 Forming the least-squares normal equations matrix via cholmod.
bool formNormals1_CHOLMOD (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &N22, SparseBlockColumnMatrix &N12, boost::numeric::ublas::compressed_vector< double > &n1, boost::numeric::ublas::vector< double > &n2, boost::numeric::ublas::matrix< double > &coeff_image, boost::numeric::ublas::matrix< double > &coeff_point3D, boost::numeric::ublas::vector< double > &coeff_RHS, int nImageIndex)
 Forming first set of auxiliary matrices for normal equations matrix via cholmod.
bool formNormals2_CHOLMOD (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &N22, SparseBlockColumnMatrix &N12, boost::numeric::ublas::vector< double > &n2, boost::numeric::ublas::vector< double > &nj, int nPointIndex, int i)
 Forming second set of auxiliary matrices for normal equations matrix via cholmod.
bool formNormals3_CHOLMOD (boost::numeric::ublas::compressed_vector< double > &n1, boost::numeric::ublas::vector< double > &nj)
 Apply weighting for spacecraft position, velocity, acceleration and camera angles, angular velocities, angular accelerations if so stipulated (legalese).
bool solveSystem_CHOLMOD ()
 Solution with CHOLMOD.
void AmultAdd_CNZRows_CHOLMOD (double alpha, SparseBlockColumnMatrix &A, SparseBlockRowMatrix &B)
 Dedicated matrix multiplication method.
void transA_NZ_multAdd_CHOLMOD (double alpha, SparseBlockRowMatrix &A, boost::numeric::ublas::vector< double > &B, boost::numeric::ublas::vector< double > &C)
 Dedicated matrix multiplication method.
void applyParameterCorrections_CHOLMOD ()
 apply parameter corrections for CHOLMOD solution.
bool errorPropagation_CHOLMOD ()
 error propagation for CHOLMOD solution.
bool formNormalEquations_SPECIALK ()
 Forming the least-squares normal equations matrix via specialk.
bool formNormals1_SPECIALK (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &N22, boost::numeric::ublas::matrix< double > &N12, boost::numeric::ublas::compressed_vector< double > &n1, boost::numeric::ublas::vector< double > &n2, boost::numeric::ublas::matrix< double > &coeff_image, boost::numeric::ublas::matrix< double > &coeff_point3D, boost::numeric::ublas::vector< double > &coeff_RHS, int nImageIndex)
 Forming first set of auxiliary matrices for normal equations matrix via specialk.
bool formNormals2_SPECIALK (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &N22, boost::numeric::ublas::matrix< double > &N12, boost::numeric::ublas::vector< double > &n2, boost::numeric::ublas::vector< double > &nj, int nPointIndex, int i)
 Forming second set of auxiliary matrices for normal equations matrix via specialk.
bool formNormals3_SPECIALK (boost::numeric::ublas::compressed_vector< double > &n1, boost::numeric::ublas::vector< double > &nj)
 apply weighting for spacecraft position, velocity, acceleration and camera angles, angular velocities, angular accelerations if so stipulated (legalese).
bool solveSystem_SPECIALK ()
 Solution with specialk (dense).
void AmultAdd_CNZRows_SPECIALK (double alpha, boost::numeric::ublas::matrix< double > &A, boost::numeric::ublas::compressed_matrix< double > &B, boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &C)
 Dedicated matrix multiplication method.
void transA_NZ_multAdd_SPECIALK (double alpha, boost::numeric::ublas::compressed_matrix< double > &A, boost::numeric::ublas::vector< double > &B, boost::numeric::ublas::vector< double > &C)
 Dedicated matrix multiplication method.
void applyParameterCorrections_SPECIALK ()
 Apply parameter corrections for specialk solution.
bool errorPropagation_SPECIALK ()
 error propagation for specialk solution.
bool CholeskyUT_NOSQR ()
 Upper triangular, square-root free cholesky.
bool CholeskyUT_NOSQR_Inverse ()
 Compute inverse of normal equations matrix for above square-root free cholesky method.
bool CholeskyUT_NOSQR_BackSub (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &m, boost::numeric::ublas::vector< double > &s, boost::numeric::ublas::vector< double > &rhs)
 Backsubstitution for above square-root free cholesky method.
bool ComputePartials_DC (boost::numeric::ublas::matrix< double > &coeff_image, boost::numeric::ublas::matrix< double > &coeff_point3D, boost::numeric::ublas::vector< double > &coeff_RHS, const ControlMeasure &measure, const ControlPoint &point)
 compute partials for measure
double ComputeResiduals ()
 This method computes the focal plane residuals for the measures.
void AmulttransBNZ (boost::numeric::ublas::matrix< double > &A, boost::numeric::ublas::compressed_matrix< double > &B, boost::numeric::ublas::matrix< double > &C, double alpha=1.0)
 Dedicated matrix multiplication method.
void ANZmultAdd (boost::numeric::ublas::compressed_matrix< double > &A, boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &B, boost::numeric::ublas::matrix< double > &C, double alpha=1.0)
 Dedicated matrix multiplication method.
bool Invert_3x3 (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &m)
 Dedicated quick inverse of 3x3 matrix.
bool product_ATransB (boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &N22, SparseBlockColumnMatrix &N12, SparseBlockRowMatrix &Q)
 C = A x B(transpose) where A is a boost matrix B is a SparseBlockColumn matrix C is a SparseBlockRowMatrix each block of B and C are boost matrices.
void product_AV (double alpha, boost::numeric::ublas::bounded_vector< double, 3 > &v2, SparseBlockRowMatrix &Q, boost::numeric::ublas::vector< double > &v1)
 Dedicated matrix multiplication method.
bool ComputeRejectionLimit ()
 Compute rejection limit.
bool FlagOutliers ()
 Flag outlier measurements.
bool initializeCholMod ()
 Initializations for Cholmod sparse matrix package.
bool freeCholMod ()
 Initializations for Cholmod sparse matrix package.
bool cholmod_Inverse ()
 Computate inverse of normal equations matrix for CHOLMOD.
bool loadCholmodTriplet ()
 Load sparse normal equations matrix into CHOLMOD triplet.

Private Attributes

bool m_bSolveTwist
 to solve for "twist" angle
bool m_bSolveRadii
 to solve for point radii
bool m_bUpdateCubes
 update cubes (only here for output into bundleout.txt)
bool m_bSolvePolyOverHermite
 to fit polynomial over existing Hermite
bool m_bSolvePolyOverPointing
 to fit polynomial over existing pointing
bool m_bObservationMode
 for observation mode (explain this somewhere)
bool m_bErrorPropagation
 to perform error propagation
bool m_bOutlierRejection
 to perform automatic outlier detection/rejection
double m_dRejectionMultiplier
 outlier rejection multiplier
bool m_bPrintSummary
 to print summary
bool m_bOutputStandard
 to print standard bundle output file (bundleout.txt)
bool m_bOutputCSV
 to output points and image station data in csv format
bool m_bOutputResiduals
 to output residuals in csv format
bool m_bCleanUp
 for cleanup (i.e. in destructor)
bool m_bSimulatedData
 indicating simulated (i.e. 'perfect' data)
bool m_bLastIteration
bool m_bMaxIterationsReached
bool m_bDeltack
 flag indicating deltack was calling app
int m_nIteration
 current iteration
int m_nMaxIterations
 maximum iterations
int m_nNumImagePartials
 number of image-related partials
int m_nNumPointPartials
 number of point-related partials
int m_nObservations
 number of image coordinate observations
int m_nRejectedObservations
 number of rejected image coordinate observations //!
int m_nImageParameters
 number of image parameters
int m_nPointParameters
 total number of point parameters (including constrained)
int m_nConstrainedPointParameters
 number of constrained point parameters
int m_nConstrainedImageParameters
 number of constrained image parameters
int m_nDegreesOfFreedom
 degrees of freedom //!
int m_nHeldPoints
 number of 'held' points (define)
int m_nFixedPoints
 number of 'fixed' (ground) points (define)
int m_nIgnoredPoints
 number of ignored points
int m_nHeldImages
 number of 'held' images (define)
int m_nHeldObservations
 number of 'held' observations (define)
int m_nCKDegree
 ck degree (define)
int m_nsolveCKDegree
 solve cad degree (define)
int m_nNumberCamAngleCoefSolved
 number of camera angle coefficients in solution
int m_nSPKDegree
 spk degree (define)
int m_nsolveSPKDegree
 solve spk degree (define)
int m_nNumberCamPosCoefSolved
 number of camera position coefficients in solution
int m_nUnknownParameters
 total number of parameters to solve for
int m_nBasisColumns
 number of columns (parameters) in normal equations
SpicePosition::Source m_nPositionType
 type of SpicePosition interpolation
SpiceRotation::Source m_nPointingType
 type of SpiceRotation interpolation
std::vector< int > m_nPointIndexMap
 index into normal equations of point parameter positions
std::vector< int > m_nImageIndexMap
 index into normal equations of image parameter positions
double m_dError
 error
double m_dConvergenceThreshold
 bundle convergence threshold
double m_dElapsedTime
 elapsed time for bundle
double m_dElapsedTimeErrorProp
 elapsed time for error propagation //!
double m_dSigma0
 std deviation of unit weight
double m_drms_rx
 rms of x residuals
double m_drms_ry
 rms of y residuals
double m_drms_rxy
 rms of all x and y residuals
double m_drms_sigmaLat
 rms of adjusted Latitude sigmas
double m_drms_sigmaLon
 rms of adjusted Longitude sigmas
double m_drms_sigmaRad
 rms of adjusted Radius sigmas
double m_dminSigmaLatitude
QString m_idMinSigmaLatitude
double m_dmaxSigmaLatitude
QString m_idMaxSigmaLatitude
double m_dminSigmaLongitude
QString m_idMinSigmaLongitude
double m_dmaxSigmaLongitude
QString m_idMaxSigmaLongitude
double m_dminSigmaRadius
QString m_idMinSigmaRadius
double m_dmaxSigmaRadius
QString m_idMaxSigmaRadius
double m_dRejectionLimit
 current rejection limit
double m_dGlobalLatitudeAprioriSigma
 latitude apriori sigma
double m_dGlobalLongitudeAprioriSigma
 longitude apriori sigma
double m_dGlobalRadiusAprioriSigma
 radius apriori sigma
double m_dGlobalSurfaceXAprioriSigma
 surface point x apriori sigma
double m_dGlobalSurfaceYAprioriSigma
 surface point y apriori sigma
double m_dGlobalSurfaceZAprioriSigma
 surface point z apriori sigma
std::vector< double > m_dGlobalSpacecraftPositionAprioriSigma
 camera position apriori sigmas: size is # camera position coefficients solved
std::vector< double > m_dGlobalCameraAnglesAprioriSigma
 camera angles apriori sigmas: size is # camera angle coefficients solved
double m_dGlobalSpacecraftPositionWeight
double m_dGlobalSpacecraftVelocityWeight
double m_dGlobalSpacecraftAccelerationWeight
double m_dGlobalCameraAnglesWeight
double m_dGlobalCameraAngularVelocityWeight
double m_dGlobalCameraAngularAccelerationWeight
std::vector< double > m_dImageParameterWeights
double m_dRTM
 radians to meters conversion factor (body specific)
double m_dMTR
 meters to radians conversion factor (body specific)
Distance m_BodyRadii [3]
 body radii i meters
std::vector< double > m_dEpsilons
 vector maintaining total corrections to parameters
std::vector< double > m_dParameterWeights
 vector of parameter weights
std::vector< double > m_dxKnowns
std::vector< double > m_dyKnowns
QString m_strCnetFileName
 Control Net file specification.
QString m_strSolutionMethod
 solution method string (QR,SVD,SPARSE-LU,SPECIALK)
QString m_strOutputFilePrefix
 output file prefix
Isis::LeastSquaresm_pLsq
 < pointers to...
Isis::ControlNetm_pCnet
 'ControlNet' object
Isis::SerialNumberListm_pSnList
 list of image serial numbers
Isis::SerialNumberListm_pHeldSnList
 list of held image serial numbers
Isis::ObservationNumberListm_pObsNumList
 list of observation numbers
Statistics m_Statsx
 x errors
Statistics m_Statsy
 y errors
Statistics m_Statsrx
 x residuals
Statistics m_Statsry
 y residuals
Statistics m_Statsrxy
 xy residuals
std::vector< Statisticsm_rmsImageSampleResiduals
std::vector< Statisticsm_rmsImageLineResiduals
std::vector< Statisticsm_rmsImageResiduals
std::vector< Statisticsm_rmsImageXSigmas
std::vector< Statisticsm_rmsImageYSigmas
std::vector< Statisticsm_rmsImageZSigmas
std::vector< Statisticsm_rmsImageRASigmas
std::vector< Statisticsm_rmsImageDECSigmas
std::vector< Statisticsm_rmsImageTWISTSigmas
DecompositionMethod m_decompositionMethod
 matrix decomp method
CmatrixSolveType m_cmatrixSolveType
 cmatrix solve type (define)
SpacecraftPositionSolveType m_spacecraftPositionSolveType
 spacecraft position solve type (define)
std::vector< SpacecraftWeightsm_SCWeights
int m_nRank
bool m_bConverged
bool m_bError
boost::numeric::ublas::symmetric_matrix
< double,
boost::numeric::ublas::upper,
boost::numeric::ublas::column_major > 
m_Normals
 reduced normal equations matrix
boost::numeric::ublas::vector
< double > 
m_nj
 array of Qs (see Brown, 1976)
std::vector
< boost::numeric::ublas::compressed_matrix
< double > > 
m_Qs_SPECIALK
std::vector< SparseBlockRowMatrixm_Qs_CHOLMOD
 array of NICs (see Brown, 1976)
std::vector
< boost::numeric::ublas::bounded_vector
< double, 3 > > 
m_NICs
boost::numeric::ublas::vector
< double > 
m_Image_Corrections
 image parameter cumulative correction vector
boost::numeric::ublas::vector
< double > 
m_Image_Solution
 image parameter solution vector
std::vector
< boost::numeric::ublas::bounded_vector
< double, 3 > > 
m_Point_Corrections
 vector of corrections to 3D point parameter
std::vector
< boost::numeric::ublas::bounded_vector
< double, 3 > > 
m_Point_AprioriSigmas
 vector of apriori sigmas for 3D point parameters
std::vector
< boost::numeric::ublas::bounded_vector
< double, 3 > > 
m_Point_Weights
 vector of weights for 3D point parameters
std::vector
< boost::numeric::ublas::vector
< double > > 
m_Image_AdjustedSigmas
 vector of a posteriori (adjusted image parameter sigmas
QString m_iterationSummary
cholmod_common m_cm
cholmod_factor * m_L
cholmod_sparse * m_N
SparseBlockMatrix m_SparseNormals
cholmod_triplet * m_pTriplet
MaximumLikelihoodWFunctionsm_wFunc [3]
 This class is used to reweight observations in order to achieve more robust parameter estimation, up to three different maximum likelihood estimation models can be used in succession.
StatCumProbDistDynCalcm_cumPro
 This class will be used to calculate the cumulative probability distribution of |R^2 residuals|, quantiles of this distribution are used to adjust the maximum likelihood functions dynamically iteration by iteration.
StatCumProbDistDynCalcm_cumProRes
 This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels), this is used for reporting, and not for computation.
bool m_maxLikelihoodFlag [3]
 Up to three different maximum likelihood estimation models can be used in succession, these flags record if they are enabled .
int m_maxLikelihoodIndex
 This count keeps track of which stadge of the maximum likelihood adjustment the bundle is currently on.
double m_maxLikelihoodQuan [3]
 Quantiles of the |residual| distribution to be used for tweaking constants of the maximum probability models.
double m_maxLikelihoodMedianR2Residuals
 Median of R^2 residuals.

Detailed Description

Author
2006-05-30 Jeff Anderson, Debbie A. Cook, and Tracie Sucharski
History:
2005-05-30 Jeff Anderson, Debbie A. Cook & Tracie Sucharski Original version
History:
2007-05-29 Debbie A. Cook Added new method IterationSummary and changed points on held images to held instead of ground
History:
2007-07-12 Debbie A. Cook Fixed bug in iteration statistics calculations in the case of a single control point that was causing a divide by zero error
History:
2007-08-25 Debbie A. Cook Added methods and members to support instrument position solution
History:
2007-09-17 Debbie A. Cook Added ability to process in observation mode for Lunar Orbiter
History:
2007-11-17 Debbie A. Cook Added method SetSolution Method.
History:
2007-12-21 Debbie A. Cook Added member p_Degree and methods m_nsolveCamDegree and ckDegree
History:
2008-01-11 Debbie A. Cook Added observation mode functionality for spacecraft position and upgraded ObservationNumber methods for compatability
History:
2008-01-14 Debbie A. Cook Added code to solve for local radii
History:
2008-04-18 Debbie A. Cook Added progress for ControlNet
History:
2008-06-18 Christopher Austin Fixed ifndef
History:
2008-11-07 Tracie Sucharski, Added bool to constructors to indicate whether to print iteration summary info to the session log. This was needed for qtie which has no session log.
History:
2008-11-22 Debbie A. Cook Added code to wrap longitude to keep it in [0.,360.]
History:
2008-11-22 Debbie A. Cook Added new call to get timeScale and set for the observation along with basetime
History:
2008-11-26 Debbie A. Cook Added check to ApplyHeldList for Ignored points and measures
History:
2009-01-08 Debbie A. Cook Revised AddPartials and PointPartial to avoid using the camera methods to map a body-fixed vector to the camera because they compute a new time for line scan cameras based on the lat/lon/radius and the new time is used to retrieve Spice. The updated software uses the Spice at the time of the measurement.
History:
2009-02-15 Debbie A. Cook Corrected focal length to include its sign and removed obsolete calls to X/Y direction methods. Also modified PointPartial to use lat/lon/radius from the point instead of the camera.
History:
2009-08-13 Debbie A. Cook Corrected calculations of cudx and cudy so that they use the signed focal length also
History:
2009-10-14 Debbie A. Cook Modified AddPartials method to use new CameraGroundMap method, GetXY
History:
2009-10-30 Debbie A. Cook Improved error message in AddPartials
History:
2009-12-14 Debbie A. Cook Updated SpicePosition enumerated partial type constants
History:
2010-03-19 Debbie A. Cook Moved partials to GroundMap classes to support Radar sensors and modified argument list for GroundMap method ComputeXY since it now returns cudx and cudy
History:
2010-06-18 Debbie A. Cook Added p_cnetFile as member since it was taken out of ControlNet
History:
2010-07-09 Ken Edmundson Added Folding in solution method (SPECIALK), error propogation, statistical report, etc.
History:
2010-08-13 Debbie A. Cook Changed surface point from lat/lon/radius to body-fixed XYZ.
History:
2010-12-17 Debbie A. Cook Merged Ken Edmundson version with system and updated to new binary control net
History:
2011-02-01 Debbie A. Cook Moved code to create point index map into its own method to be called after the solution method has been set.
History:
2011-02-17 Debbie A. Cook Updated to use new parameter added to SpicePosition, p_timeScale
History:
2011-03-05 Debbie A. Cook Put point index creation back in init. This will prevent QRD and SVD from working if ground points are in the control net.
History:
2011-03-29 Ken Edmundson Fixed bug in observation mode when solving for spacecraft position and improved output
History:
2011-04-02 Debbie A. Cook Updated to ControlPoint class changes regarding target radii. Also separated out 2 sets of calculations to test later for efficiency
History:
2011-06-05 Debbie A. Cook Changed checks for solution type to match change from SPARSE to SPARSE-LU
History:
2011-06-07 Debbie A. Cook and Tracie Sucharski - Modified point types Ground ------> Fixed Tie----------> Free
History:
2011-06-14 Debbie A. Cook added method IsHeld(int index) for preventing any updates to held images
History:
2011-06-27 Debbie A. Cook and Ken Edmundson Added names to top header fields of .csv output and fixed bugs in sparse output.
History:
2011-07-12 Ken Edmundson Segmentation fault bugfix in OutputHeader method. Previously was attempting to output camera angle sigmas when none had been allocated.
History:
2011-07-14 Ken Edmundson and Debbie Cook Added new member, m_bDeltack to indicate calling application was deltack (or qtie) and has potential to have a single ControlPoint and ControlMeasure.
History:
2011-08-08 Tracie Sucharski, Added method to return the iteration summary to be used in qtie which does not have a log file. In SetImages, clear the cameraMap and cameraList. Added this back in (was originally added on 2011-01-19), was deleted somewhere along the line.
History:
2011-09-28 Debbie A. Cook Renamed SPARSE solve method to OLDSPARSE and CHOLMOD to SPARSE.
History:
2011-10-14 Ken Edmundson Added call to m_pCnet->ClearJigsawRejected(); to Init() method to set all measure/point JigsawRejected flags to false prior to bundle.
History:
2011-12-09 Ken Edmundson, memory leak fix in method cholmod_Inverse need call to "cholmod_free_dense(&x,&m_cm)" inside loop.
History:
2011-12-20 Ken Edmundson, Fixes to outlier rejection. Added rejection multiplier member variable, can be set in jigsaw interface.
History:
2012-02-02 Debbie A. Cook, Added SetSolvePolyOverHermite method and members m_bSolvePolyOverHermite and m_nPositionType.
History:
2012-03-26 Orrin Thomas, added maximum likelihood capabilities
History:
2012-05-21 Debbie A. Cook, Added initialization of m_dRejectionMultiplier
History:
2012-07-06 Debbie A. Cook, Updated Spice members to be more compliant with Isis coding standards. References #972.
History:
2012-09-28 Ken Edmundson, Initialized variables for bundle statistic computations;bundleout.txt modifed to show N/A for RMS, Min, Max of Radius Sigmas when not solving for radius. References #783.
History:
2013-11-12 Ken Edmundson Programmers Note. References #813, #1521, #1653 #813 - info echoed to screen when using Maximum Likelihood methods are now printed to print.prt file. #1521 - cout debug statements that appear on screen when updating images removed from SpiceRotation.cpp #1653 - Constraints were being applied for "Free" points that have constrained coordinates. Also found that a priori coordinates for these points were not being computed in ControlPoint::ComputeApriori, this has also been fixed.
History:
2013-12-18 Tracie Sucharski - The ControlNet::GetNumberOfMeasuresInImage was renamed to ControlNet::GetNumberOfValidMeasuresInImage and only returns the number of valid (Ignore= False) measures.
History:
2014-02-25 Ken Edmundson - Speed up and memory improvements to error propagation. References #2031.
History:
2014-11-05 Ken Edmundson - Fixed memory bug. Wasn't releasing cholmod_factor m_L every iteration. Now release every iteration but the last since we need m_L for error propagation. References #2189.

Definition at line 172 of file BundleAdjust.h.

Member Function Documentation

void Isis::BundleAdjust::AmultAdd_CNZRows_CHOLMOD ( double  alpha,
SparseBlockColumnMatrix N12,
SparseBlockRowMatrix Q 
)
private

Dedicated matrix multiplication method.

TODO: Define.

NOTE: A = N12, B = Q

Definition at line 2122 of file BundleAdjust.cpp.

void Isis::BundleAdjust::AmultAdd_CNZRows_SPECIALK ( double  alpha,
boost::numeric::ublas::matrix< double > &  A,
boost::numeric::ublas::compressed_matrix< double > &  B,
boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &  C 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2163 of file BundleAdjust.cpp.

void Isis::BundleAdjust::AmulttransBNZ ( boost::numeric::ublas::matrix< double > &  A,
boost::numeric::ublas::compressed_matrix< double > &  B,
boost::numeric::ublas::matrix< double > &  C,
double  alpha = 1.0 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2280 of file BundleAdjust.cpp.

void Isis::BundleAdjust::ANZmultAdd ( boost::numeric::ublas::compressed_matrix< double > &  A,
boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &  B,
boost::numeric::ublas::matrix< double > &  C,
double  alpha = 1.0 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2330 of file BundleAdjust.cpp.

void Isis::BundleAdjust::applyParameterCorrections ( )
private

apply parameter corrections

Definition at line 4549 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::ApproximatePoint_ClosestApproach ( const ControlPoint rPoint,
int  nIndex 
)
private
int Isis::BundleAdjust::BasisColumns ( )

Determine number of columns needed for least squares.

When we create a row of data we store all image partials first and then the point partials.

Definition at line 738 of file BundleAdjust.cpp.

void Isis::BundleAdjust::CheckHeldList ( )
private

This method checks all cube files in the held list to make sure they are in the input list.

Definition at line 474 of file BundleAdjust.cpp.

References _FILEINFO_.

bool Isis::BundleAdjust::CholeskyUT_NOSQR ( )
private

Upper triangular, square-root free cholesky.

Definition at line 2602 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::CholeskyUT_NOSQR_BackSub ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > &  m,
boost::numeric::ublas::vector< double > &  s,
boost::numeric::ublas::vector< double > &  rhs 
)
private

Backsubstitution for above square-root free cholesky method.

Definition at line 2689 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::CholeskyUT_NOSQR_Inverse ( )
private

Compute inverse of normal equations matrix for above square-root free cholesky method.

Definition at line 2727 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::cholmod_Inverse ( )
private

Computate inverse of normal equations matrix for CHOLMOD.

Definition at line 2786 of file BundleAdjust.cpp.

Table Isis::BundleAdjust::Cmatrix ( int  index)

Return a table cmatrix for the ith cube in the cube list given to the constructor.

Definition at line 6085 of file BundleAdjust.cpp.

void Isis::BundleAdjust::ComputeImageParameterWeights ( )
private

Weighting for image parameter ComputeNumberPartials must be called first.

Definition at line 542 of file BundleAdjust.cpp.

void Isis::BundleAdjust::ComputeNumberPartials ( )
private

This method determines the number of partials per image and per point.

It is based on the variables to be solved for (e.g., twist, radii, cmatrix velocity, cmatrix acceleration, degree of camera position polynomial, etc).

Definition at line 490 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::ComputePartials_DC ( boost::numeric::ublas::matrix< double > &  coeff_image,
boost::numeric::ublas::matrix< double > &  coeff_point3D,
boost::numeric::ublas::vector< double > &  coeff_RHS,
const ControlMeasure measure,
const ControlPoint point 
)
private
bool Isis::BundleAdjust::ComputeRejectionLimit ( )
private

Compute rejection limit.

Definition at line 5229 of file BundleAdjust.cpp.

References Isis::ControlPoint::GetMeasure().

double Isis::BundleAdjust::ComputeResiduals ( )
private

This method computes the focal plane residuals for the measures.

History:
2012-01-18 Debbie A. Cook - Fixed the computation of vx and vy to make sure they are focal plane x and y residuals instead of image sample and line residuals.

Definition at line 4951 of file BundleAdjust.cpp.

References Isis::ControlPoint::ComputeResiduals(), and Isis::ControlPoint::GetMeasure().

bool Isis::BundleAdjust::errorPropagation ( )
private

error propagation.

Definition at line 5452 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::errorPropagation_SPECIALK ( )
private
QString Isis::BundleAdjust::FileName ( int  index)

Return the ith filename in the cube list file given to constructor.

Definition at line 6062 of file BundleAdjust.cpp.

void Isis::BundleAdjust::FillPointIndexMap ( )
private

This method fills the point index map and needs to know the solution method in order to work properly.

Definition at line 432 of file BundleAdjust.cpp.

References Isis::ControlPoint::GetType().

bool Isis::BundleAdjust::formNormalEquations ( )
private

Forming the least-squares normal equations matrix.

Definition at line 1199 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::formNormalEquations_CHOLMOD ( )
private

Forming the least-squares normal equations matrix via cholmod.

Definition at line 1225 of file BundleAdjust.cpp.

References Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlPoint::GetMeasure(), and Isis::SparseBlockColumnMatrix::wipe().

bool Isis::BundleAdjust::formNormalEquations_SPECIALK ( )
private

Forming the least-squares normal equations matrix via specialk.

Definition at line 1589 of file BundleAdjust.cpp.

References Isis::ControlMeasure::GetCubeSerialNumber(), and Isis::ControlPoint::GetMeasure().

bool Isis::BundleAdjust::formNormals1_CHOLMOD ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  N22,
SparseBlockColumnMatrix N12,
boost::numeric::ublas::compressed_vector< double > &  n1,
boost::numeric::ublas::vector< double > &  n2,
boost::numeric::ublas::matrix< double > &  coeff_image,
boost::numeric::ublas::matrix< double > &  coeff_point3D,
boost::numeric::ublas::vector< double > &  coeff_RHS,
int  nImageIndex 
)
private

Forming first set of auxiliary matrices for normal equations matrix via cholmod.

Definition at line 1372 of file BundleAdjust.cpp.

References Isis::SparseBlockColumnMatrix::insertMatrixBlock().

bool Isis::BundleAdjust::formNormals1_SPECIALK ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  N22,
boost::numeric::ublas::matrix< double > &  N12,
boost::numeric::ublas::compressed_vector< double > &  n1,
boost::numeric::ublas::vector< double > &  n2,
boost::numeric::ublas::matrix< double > &  coeff_image,
boost::numeric::ublas::matrix< double > &  coeff_point3D,
boost::numeric::ublas::vector< double > &  coeff_RHS,
int  nImageIndex 
)
private

Forming first set of auxiliary matrices for normal equations matrix via specialk.

Definition at line 1727 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::formNormals2_CHOLMOD ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  N22,
SparseBlockColumnMatrix N12,
boost::numeric::ublas::vector< double > &  n2,
boost::numeric::ublas::vector< double > &  nj,
int  nPointIndex,
int  i 
)
private

Forming second set of auxiliary matrices for normal equations matrix via cholmod.

Definition at line 1452 of file BundleAdjust.cpp.

References Isis::ControlPoint::SetAdjustedSurfacePoint(), Isis::SurfacePoint::SetSphericalMatrix(), and Isis::SparseBlockRowMatrix::zeroBlocks().

bool Isis::BundleAdjust::formNormals2_SPECIALK ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  N22,
boost::numeric::ublas::matrix< double > &  N12,
boost::numeric::ublas::vector< double > &  n2,
boost::numeric::ublas::vector< double > &  nj,
int  nPointIndex,
int  i 
)
private

Forming second set of auxiliary matrices for normal equations matrix via specialk.

Definition at line 1800 of file BundleAdjust.cpp.

References Isis::ControlPoint::SetAdjustedSurfacePoint(), and Isis::SurfacePoint::SetSphericalMatrix().

bool Isis::BundleAdjust::formNormals3_CHOLMOD ( boost::numeric::ublas::compressed_vector< double > &  n1,
boost::numeric::ublas::vector< double > &  nj 
)
private

Apply weighting for spacecraft position, velocity, acceleration and camera angles, angular velocities, angular accelerations if so stipulated (legalese).

Definition at line 1554 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::formNormals3_SPECIALK ( boost::numeric::ublas::compressed_vector< double > &  n1,
boost::numeric::ublas::vector< double > &  nj 
)
private

apply weighting for spacecraft position, velocity, acceleration and camera angles, angular velocities, angular accelerations if so stipulated (legalese).

Definition at line 1899 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::freeCholMod ( )
private

Initializations for Cholmod sparse matrix package.

Definition at line 416 of file BundleAdjust.cpp.

void Isis::BundleAdjust::GetSparseParameterCorrections ( )

Retrieve parameter correction vector for old sparse least-squares object and parse into m_Image_Corrections and m_Point_Corrections vectors so we can use the same output as SpecialK and Cholmod Sparse solutions.

Definition at line 3663 of file BundleAdjust.cpp.

int Isis::BundleAdjust::ImageIndex ( int  i) const
private

Return index to basis function for image with index i.

Definition at line 6050 of file BundleAdjust.cpp.

void Isis::BundleAdjust::Init ( Progress progress = 0)
private

Initialize solution parameters.

History:
2011-08-14 Debbie A. Cook - Opt out of network validation for deltack network in order to allow a single measure on a point

Definition at line 208 of file BundleAdjust.cpp.

References Isis::Camera::Camera(), and Isis::Spice::radii().

void Isis::BundleAdjust::Initialize ( )
private

Initializes matrices and parameters for bundle adjustment.

Definition at line 755 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::initializeCholMod ( )
private

Initializations for Cholmod sparse matrix package.

Definition at line 390 of file BundleAdjust.cpp.

void Isis::BundleAdjust::InitializePoints ( )
private

Initializing points.

This method will definitely need to be revisited.

Definition at line 2050 of file BundleAdjust.cpp.

References Isis::ControlPoint::SetAdjustedSurfacePoint().

bool Isis::BundleAdjust::Invert_3x3 ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  m)
private

Dedicated quick inverse of 3x3 matrix.

TODO: belongs in matrix class or wrapper.

Definition at line 2831 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::IsHeld ( int  index)

Return whether the ith file in the cube list is held.

Definition at line 6073 of file BundleAdjust.cpp.

void Isis::BundleAdjust::IterationSummary ( double  avErr,
double  sigmaXY,
double  sigmaHat,
double  sigmaX,
double  sigmaY 
)
private

This method creates a iteration summary and creates an iteration group for the Sparse BundleAdjust summary.

Parameters
itIteration number
it_timeIteration time
avErrAverage error or iteration (pixels)
sigmaXYStandard deviation of coordinates (mm)
sigmaHatAposteriori standard deviation of unit weight (mm)
sigmaXStandard deviation of deltax (mm)
sigmaYStandard deviation of deltay (mm)

Definition at line 6158 of file BundleAdjust.cpp.

References Isis::toString().

bool Isis::BundleAdjust::loadCholmodTriplet ( )
private

Load sparse normal equations matrix into CHOLMOD triplet.

Definition at line 2466 of file BundleAdjust.cpp.

void Isis::BundleAdjust::maximumLikelihoodSetup ( QList< QString >  models,
QList< double >  quantiles 
)

This method steps up the maximum likelihood estimation solution.

Zero to three successive solutions models are available.

Definition at line 8845 of file BundleAdjust.cpp.

References _FILEINFO_.

int Isis::BundleAdjust::Observations ( ) const

Return the number of observations in list given to the constructor.

Definition at line 6100 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::Output ( )
private

Output bundle results to file.

Definition at line 6400 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::OutputHeader ( std::ofstream &  fp_out)
private

Output header for bundle results file.

Definition at line 6424 of file BundleAdjust.cpp.

References _FILEINFO_, and Isis::iTime::CurrentLocalTime().

bool Isis::BundleAdjust::OutputNoErrorPropagation ( )
private

output bundle results to file with error propagation

output bundle results to file with no error propagation

History:
2011-05-22 Debbie A. Cook - Added commas to make csv header lines consistent for comparer
History:
2011-06-05 Debbie A. Cook - Fixed output of spacecraft position when it is not part of the bundle
History:
2011-07-26 Debbie A. Cook - Omitted output of camera angles for radar, which only has spacecraft position

Definition at line 7722 of file BundleAdjust.cpp.

References Isis::Camera::Camera(), Isis::DEG2RAD(), Isis::Angle::degrees(), Isis::SpiceRotation::GetCenterAngles(), Isis::SpicePosition::GetCenterCoordinate(), Isis::ControlPoint::GetId(), Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLocalRadius(), Isis::SurfacePoint::GetLongitude(), Isis::ControlPoint::GetNumberOfRejectedMeasures(), Isis::SpicePosition::GetPolynomial(), Isis::SpiceRotation::GetPolynomial(), Isis::ControlPoint::GetResidualRms(), Isis::ControlPoint::GetType(), Isis::Spice::instrumentPosition(), Isis::Spice::instrumentRotation(), Isis::Distance::meters(), and Isis::RAD2DEG().

bool Isis::BundleAdjust::OutputResiduals ( )
private

output image coordinate residuals to comma-separated-value file

Definition at line 8220 of file BundleAdjust.cpp.

References Isis::ControlMeasure::GetCubeSerialNumber(), Isis::ControlPoint::GetId(), Isis::ControlPoint::GetMeasure(), and Isis::ControlMeasure::GetResidualMagnitude().

int Isis::BundleAdjust::PointIndex ( int  i) const
private

Return index to basis function for ith point.

Definition at line 6032 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::product_ATransB ( boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper > &  N22,
SparseBlockColumnMatrix N12,
SparseBlockRowMatrix Q 
)
private

C = A x B(transpose) where A is a boost matrix B is a SparseBlockColumn matrix C is a SparseBlockRowMatrix each block of B and C are boost matrices.

Definition at line 2095 of file BundleAdjust.cpp.

References Isis::SparseBlockRowMatrix::insertMatrixBlock().

void Isis::BundleAdjust::product_AV ( double  alpha,
boost::numeric::ublas::bounded_vector< double, 3 > &  v2,
SparseBlockRowMatrix Q,
boost::numeric::ublas::vector< double > &  v1 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2071 of file BundleAdjust.cpp.

void Isis::BundleAdjust::SetCKDegree ( int  degree)
inline

Set the degree of the polynomial to fit to the camera angles.

Definition at line 273 of file BundleAdjust.h.

References m_nCKDegree.

void Isis::BundleAdjust::SetDecompositionMethod ( DecompositionMethod  method)

Set decomposition method.

Choices are... SpecialK (dense normal equations matrix) Sparse (Cholmod sparse normal equations matrix)

Definition at line 652 of file BundleAdjust.cpp.

void Isis::BundleAdjust::SetObservationMode ( bool  observationMode)

This method turns on observation mode and creates the observation number list.

It also checks to make sure the held image list is consistent for all images in an observation.

Is this still going to be necessary. Is the code that uses it still intact?

Definition at line 617 of file BundleAdjust.cpp.

References _FILEINFO_.

bool Isis::BundleAdjust::SetParameterWeights ( )
private

set parameter weighting for old SPARSE solution

History:
2011-04-19 Debbie A. Cook - Added initialization to m_Point_AprioriSigmas for old sparse method case.

Definition at line 6230 of file BundleAdjust.cpp.

References Isis::SurfacePoint::GetLatSigmaDistance(), Isis::SurfacePoint::GetLatWeight(), Isis::SurfacePoint::GetLocalRadiusWeight(), Isis::SurfacePoint::GetLonSigmaDistance(), Isis::SurfacePoint::GetLonWeight(), Isis::ControlPoint::GetType(), and Isis::Distance::meters().

void Isis::BundleAdjust::SetPostBundleSigmas ( )
private
void Isis::BundleAdjust::SetSolutionMethod ( QString  str)

This method sets the solution method for solving the matrix and fills the point index map, which is dependent on the solution method.

Definition at line 8836 of file BundleAdjust.cpp.

void Isis::BundleAdjust::SetSolveCKDegree ( int  degree)
inline

Set the degree of the polynomial to adjust in the solution.

Definition at line 276 of file BundleAdjust.h.

References m_nsolveCKDegree.

void Isis::BundleAdjust::SetSolveCmatrix ( CmatrixSolveType  type)

For which camera angle coefficients do we solve?

Definition at line 660 of file BundleAdjust.cpp.

References _FILEINFO_, and Isis::toString().

void Isis::BundleAdjust::SetSolveSpacecraftPosition ( SpacecraftPositionSolveType  type)

For which camera position coefficients do we solve?

Definition at line 698 of file BundleAdjust.cpp.

References _FILEINFO_, and Isis::toString().

void Isis::BundleAdjust::SetSolveSPKDegree ( int  degree)
inline

Set the degree of the camera position polynomial to adjust in the solution.

Definition at line 283 of file BundleAdjust.h.

References m_nsolveSPKDegree.

void Isis::BundleAdjust::SetSPKDegree ( int  degree)
inline

Set the degree of the polynomial to fit to the camera position.

Definition at line 279 of file BundleAdjust.h.

References m_nSPKDegree.

double Isis::BundleAdjust::Solve ( )

compute partials for measure

The solve method is an least squares solution for updating the camera pointing, etc. It is iterative as the equations are non-linear. During each iteration it is updating portions of the control net, as well as the instrument pointing/position in the camera. If it doesn't converge to a solution in maxIterations it will throw an error. However, even if an error is thrown the control network will contain the errors (residuals) at each control measure.

Parameters
tolMaximum pixel error for any control network measurement
maxIterationsMaximum iterations, if tolerance is never met an iException will be thrown.

Definition at line 3385 of file BundleAdjust.cpp.

References _FILEINFO_, Isis::Camera::Camera(), Isis::SpicePosition::GetBaseTime(), Isis::SpiceRotation::GetBaseTime(), Isis::SpicePosition::GetPolynomial(), Isis::SpiceRotation::GetPolynomial(), Isis::SpicePosition::GetTimeScale(), Isis::SpiceRotation::GetTimeScale(), Isis::Spice::instrumentPosition(), Isis::Spice::instrumentRotation(), Isis::LeastSquares::QRD, Isis::SpicePosition::SetOverrideBaseTime(), Isis::SpiceRotation::SetOverrideBaseTime(), Isis::SpicePosition::SetPolynomial(), Isis::SpiceRotation::SetPolynomial(), Isis::SpicePosition::SetPolynomialDegree(), Isis::SpiceRotation::SetPolynomialDegree(), Isis::Progress::SetText(), Isis::LeastSquares::SPARSE, Isis::LeastSquares::SVD, and Isis::toString().

bool Isis::BundleAdjust::SolveCholesky ( )

The solve method is a least squares solution for updating the camera pointing, etc.

It is iterative as the equations are non-linear. If it doesn't iterate to a solution in maxIterations it will throw an error. During each iteration it is updating portions of the control net, as well as the instrument pointing in the camera. An error is thrown if it does not converge within the maximum iterations. However, even if an error is thrown the control network will contain the errors (residuals) for each control measure.

Parameters
tolMaximum pixel error for any control network measurement
maxIterationsMaximum iterations, if tolerance is never met an iException will be thrown.

Definition at line 883 of file BundleAdjust.cpp.

References _FILEINFO_, Isis::Camera::Camera(), Isis::SpicePosition::GetBaseTime(), Isis::SpiceRotation::GetBaseTime(), Isis::SpicePosition::GetPolynomial(), Isis::SpiceRotation::GetPolynomial(), Isis::SpicePosition::GetTimeScale(), Isis::SpiceRotation::GetTimeScale(), Isis::Spice::instrumentPosition(), Isis::Spice::instrumentRotation(), Isis::SpicePosition::SetOverrideBaseTime(), Isis::SpiceRotation::SetOverrideBaseTime(), Isis::SpicePosition::SetPolynomial(), Isis::SpiceRotation::SetPolynomial(), Isis::SpicePosition::SetPolynomialDegree(), Isis::SpiceRotation::SetPolynomialDegree(), and Isis::toString().

bool Isis::BundleAdjust::solveSystem ( )
private

Solve normal equations system.

Definition at line 1212 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::solveSystem_CHOLMOD ( )
private

Solution with CHOLMOD.

Definition at line 2378 of file BundleAdjust.cpp.

References _FILEINFO_.

bool Isis::BundleAdjust::solveSystem_SPECIALK ( )
private

Solution with specialk (dense).

Definition at line 2569 of file BundleAdjust.cpp.

void Isis::BundleAdjust::SpecialKIterationSummary ( )
private

This method creates a iteration summary and creates an iteration group for the SpecialK solution summary.

Definition at line 6188 of file BundleAdjust.cpp.

References Isis::toString().

Table Isis::BundleAdjust::SpVector ( int  index)

Return a table spacecraft vector for the ith cube in the cube list given to the constructor.

Definition at line 6091 of file BundleAdjust.cpp.

void Isis::BundleAdjust::transA_NZ_multAdd_CHOLMOD ( double  alpha,
SparseBlockRowMatrix A,
boost::numeric::ublas::vector< double > &  B,
boost::numeric::ublas::vector< double > &  C 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2209 of file BundleAdjust.cpp.

void Isis::BundleAdjust::transA_NZ_multAdd_SPECIALK ( double  alpha,
boost::numeric::ublas::compressed_matrix< double > &  A,
boost::numeric::ublas::vector< double > &  B,
boost::numeric::ublas::vector< double > &  C 
)
private

Dedicated matrix multiplication method.

TODO: Define.

Definition at line 2238 of file BundleAdjust.cpp.

bool Isis::BundleAdjust::TriangulatePoint ( const ControlPoint rPoint)
private

Triangulates an individual point.

Parameters
rpointreference to control point
maxIterationsMaximum iterations, if tolerance is never met an iException will be thrown.
Returns
integer Number of points triangulated successfully

Definition at line 4295 of file BundleAdjust.cpp.

int Isis::BundleAdjust::Triangulation ( bool  bDoApproximation = false)
private

Populate least squares matrix with measures for a point (specific to frame cameras for now).

Triangulates all points (including control points).

Parameters
tolMaximum pixel error for any control network measurement
maxIterationsMaximum iterations, if tolerance is never met an iException will be thrown.
Returns
integer Number of points triangulated successfully

Definition at line 4253 of file BundleAdjust.cpp.

void Isis::BundleAdjust::Update ( BasisFunction basis)
private

This method uses the basis function after the matrix has been solved.

The coefficients of the basis function represent the new right ascension, declination, and twist values of the camera. Each is a polynomial based on time. For example, ra = A + B * (t - t0) + C * (t - t0)^2. However, as the function we were solving was non-linear we had to take the derivative to linearize. Therefore we have the change in ra, dec, and twist. Really we have the change in A, B, and C.

Definition at line 5892 of file BundleAdjust.cpp.

References Isis::Camera::Camera(), Isis::BasisFunction::Coefficient(), Isis::DEG2RAD(), Isis::Angle::degrees(), Isis::SurfacePoint::GetLatitude(), Isis::SurfacePoint::GetLocalRadius(), Isis::SurfacePoint::GetLongitude(), Isis::SpicePosition::GetPolynomial(), Isis::SpiceRotation::GetPolynomial(), Isis::ControlPoint::GetType(), Isis::Spice::instrumentPosition(), Isis::Spice::instrumentRotation(), Isis::Distance::meters(), Isis::RAD2DEG(), Isis::ControlPoint::SetAdjustedSurfacePoint(), Isis::SpicePosition::SetPolynomial(), Isis::SpiceRotation::SetPolynomial(), and Isis::SurfacePoint::SetSphericalCoordinates().

bool Isis::BundleAdjust::validateNetwork ( )
private

control network validation - on the very real chance that the net has not been checked before running the bundle

checks implemented for ... (1) images with 0 or 1 measures

History:
2011-08-4 Debbie A. Cook - Changed error message to indicate it fails with one measure as well as no measures.

Definition at line 362 of file BundleAdjust.cpp.

References _FILEINFO_, and Isis::toString().

bool Isis::BundleAdjust::WrapUp ( )
private

Bundle wrap up.

Definition at line 5069 of file BundleAdjust.cpp.

References Isis::ControlPoint::ComputeResiduals().

Member Data Documentation

bool Isis::BundleAdjust::m_bCleanUp
private

for cleanup (i.e. in destructor)

Definition at line 362 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bDeltack
private

flag indicating deltack was calling app

Definition at line 366 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bErrorPropagation
private

to perform error propagation

Definition at line 355 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bObservationMode
private

for observation mode (explain this somewhere)

Definition at line 354 of file BundleAdjust.h.

Distance Isis::BundleAdjust::m_BodyRadii[3]
private

body radii i meters

Definition at line 456 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bOutlierRejection
private

to perform automatic outlier detection/rejection

Definition at line 356 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bOutputCSV
private

to output points and image station data in csv format

Definition at line 360 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bOutputResiduals
private

to output residuals in csv format

Definition at line 361 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bOutputStandard
private

to print standard bundle output file (bundleout.txt)

Definition at line 359 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bPrintSummary
private

to print summary

Definition at line 358 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bSimulatedData
private

indicating simulated (i.e. 'perfect' data)

Definition at line 363 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bSolvePolyOverHermite
private

to fit polynomial over existing Hermite

Definition at line 352 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bSolvePolyOverPointing
private

to fit polynomial over existing pointing

Definition at line 353 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bSolveRadii
private

to solve for point radii

Definition at line 350 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bSolveTwist
private

to solve for "twist" angle

Definition at line 349 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_bUpdateCubes
private

update cubes (only here for output into bundleout.txt)

Definition at line 351 of file BundleAdjust.h.

CmatrixSolveType Isis::BundleAdjust::m_cmatrixSolveType
private

cmatrix solve type (define)

Definition at line 495 of file BundleAdjust.h.

StatCumProbDistDynCalc* Isis::BundleAdjust::m_cumPro
private

This class will be used to calculate the cumulative probability distribution of |R^2 residuals|, quantiles of this distribution are used to adjust the maximum likelihood functions dynamically iteration by iteration.

Definition at line 677 of file BundleAdjust.h.

StatCumProbDistDynCalc* Isis::BundleAdjust::m_cumProRes
private

This class keeps track of the cumulative probability distribution of residuals (in unweighted pixels), this is used for reporting, and not for computation.

Definition at line 682 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dConvergenceThreshold
private

bundle convergence threshold

Definition at line 399 of file BundleAdjust.h.

DecompositionMethod Isis::BundleAdjust::m_decompositionMethod
private

matrix decomp method

Definition at line 493 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dElapsedTime
private

elapsed time for bundle

Definition at line 400 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dElapsedTimeErrorProp
private

elapsed time for error propagation //!

Definition at line 401 of file BundleAdjust.h.

std::vector<double> Isis::BundleAdjust::m_dEpsilons
private

vector maintaining total corrections to parameters

Definition at line 458 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dError
private

error

Definition at line 398 of file BundleAdjust.h.

std::vector<double> Isis::BundleAdjust::m_dGlobalCameraAnglesAprioriSigma
private

camera angles apriori sigmas: size is # camera angle coefficients solved

Definition at line 440 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalLatitudeAprioriSigma
private

latitude apriori sigma

Definition at line 428 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalLongitudeAprioriSigma
private

longitude apriori sigma

Definition at line 429 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalRadiusAprioriSigma
private

radius apriori sigma

Definition at line 430 of file BundleAdjust.h.

std::vector<double> Isis::BundleAdjust::m_dGlobalSpacecraftPositionAprioriSigma
private

camera position apriori sigmas: size is # camera position coefficients solved

Definition at line 435 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalSurfaceXAprioriSigma
private

surface point x apriori sigma

Definition at line 431 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalSurfaceYAprioriSigma
private

surface point y apriori sigma

Definition at line 432 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dGlobalSurfaceZAprioriSigma
private

surface point z apriori sigma

Definition at line 433 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dMTR
private

meters to radians conversion factor (body specific)

Definition at line 455 of file BundleAdjust.h.

std::vector<double> Isis::BundleAdjust::m_dParameterWeights
private

vector of parameter weights

Definition at line 459 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dRejectionLimit
private

current rejection limit

apriori sigmas from user interface < for points, these override values control-net except for "held" & "fixed" points

Definition at line 422 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dRejectionMultiplier
private

outlier rejection multiplier

Definition at line 357 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_rx
private

rms of x residuals

Definition at line 403 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_rxy
private

rms of all x and y residuals

Definition at line 405 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_ry
private

rms of y residuals

Definition at line 404 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_sigmaLat
private

rms of adjusted Latitude sigmas

Definition at line 406 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_sigmaLon
private

rms of adjusted Longitude sigmas

Definition at line 407 of file BundleAdjust.h.

double Isis::BundleAdjust::m_drms_sigmaRad
private

rms of adjusted Radius sigmas

Definition at line 408 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dRTM
private

radians to meters conversion factor (body specific)

Definition at line 454 of file BundleAdjust.h.

double Isis::BundleAdjust::m_dSigma0
private

std deviation of unit weight

Definition at line 402 of file BundleAdjust.h.

std::vector< boost::numeric::ublas::vector< double > > Isis::BundleAdjust::m_Image_AdjustedSigmas
private

vector of a posteriori (adjusted image parameter sigmas

Definition at line 529 of file BundleAdjust.h.

boost::numeric::ublas::vector<double> Isis::BundleAdjust::m_Image_Corrections
private

image parameter cumulative correction vector

Definition at line 522 of file BundleAdjust.h.

boost::numeric::ublas::vector<double> Isis::BundleAdjust::m_Image_Solution
private

image parameter solution vector

Definition at line 523 of file BundleAdjust.h.

bool Isis::BundleAdjust::m_maxLikelihoodFlag[3]
private

Up to three different maximum likelihood estimation models can be used in succession, these flags record if they are enabled .

Definition at line 687 of file BundleAdjust.h.

int Isis::BundleAdjust::m_maxLikelihoodIndex
private

This count keeps track of which stadge of the maximum likelihood adjustment the bundle is currently on.

Definition at line 692 of file BundleAdjust.h.

double Isis::BundleAdjust::m_maxLikelihoodMedianR2Residuals
private

Median of R^2 residuals.

Definition at line 701 of file BundleAdjust.h.

double Isis::BundleAdjust::m_maxLikelihoodQuan[3]
private

Quantiles of the |residual| distribution to be used for tweaking constants of the maximum probability models.

Definition at line 697 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nBasisColumns
private

number of columns (parameters) in normal equations

Definition at line 392 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nCKDegree
private

ck degree (define)

Definition at line 385 of file BundleAdjust.h.

Referenced by SetCKDegree().

int Isis::BundleAdjust::m_nConstrainedImageParameters
private

number of constrained image parameters

Definition at line 378 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nConstrainedPointParameters
private

number of constrained point parameters

Definition at line 377 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nDegreesOfFreedom
private

degrees of freedom //!

Definition at line 379 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nFixedPoints
private

number of 'fixed' (ground) points (define)

Definition at line 381 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nHeldImages
private

number of 'held' images (define)

Definition at line 383 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nHeldObservations
private

number of 'held' observations (define)

Definition at line 384 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nHeldPoints
private

number of 'held' points (define)

Definition at line 380 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nIgnoredPoints
private

number of ignored points

Definition at line 382 of file BundleAdjust.h.

std::vector<int> Isis::BundleAdjust::m_nImageIndexMap
private

index into normal equations of image parameter positions

Definition at line 396 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nImageParameters
private

number of image parameters

Definition at line 375 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nIteration
private

current iteration

Definition at line 369 of file BundleAdjust.h.

boost::numeric::ublas::vector< double > Isis::BundleAdjust::m_nj
private

array of Qs (see Brown, 1976)

Definition at line 515 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nMaxIterations
private

maximum iterations

Definition at line 370 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nNumberCamAngleCoefSolved
private

number of camera angle coefficients in solution

Definition at line 387 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nNumberCamPosCoefSolved
private

number of camera position coefficients in solution

Definition at line 390 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nNumImagePartials
private

number of image-related partials

Definition at line 371 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nNumPointPartials
private

number of point-related partials

Definition at line 372 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nObservations
private

number of image coordinate observations

Definition at line 373 of file BundleAdjust.h.

boost::numeric::ublas::symmetric_matrix< double, boost::numeric::ublas::upper, boost::numeric::ublas::column_major > Isis::BundleAdjust::m_Normals
private

reduced normal equations matrix

Definition at line 512 of file BundleAdjust.h.

std::vector<int> Isis::BundleAdjust::m_nPointIndexMap
private

index into normal equations of point parameter positions

Definition at line 395 of file BundleAdjust.h.

SpiceRotation::Source Isis::BundleAdjust::m_nPointingType
private

type of SpiceRotation interpolation

Definition at line 394 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nPointParameters
private

total number of point parameters (including constrained)

Definition at line 376 of file BundleAdjust.h.

SpicePosition::Source Isis::BundleAdjust::m_nPositionType
private

type of SpicePosition interpolation

Definition at line 393 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nRejectedObservations
private

number of rejected image coordinate observations //!

Definition at line 374 of file BundleAdjust.h.

int Isis::BundleAdjust::m_nsolveCKDegree
private

solve cad degree (define)

Definition at line 386 of file BundleAdjust.h.

Referenced by SetSolveCKDegree().

int Isis::BundleAdjust::m_nsolveSPKDegree
private

solve spk degree (define)

Definition at line 389 of file BundleAdjust.h.

Referenced by SetSolveSPKDegree().

int Isis::BundleAdjust::m_nSPKDegree
private

spk degree (define)

Definition at line 388 of file BundleAdjust.h.

Referenced by SetSPKDegree().

int Isis::BundleAdjust::m_nUnknownParameters
private

total number of parameters to solve for

Definition at line 391 of file BundleAdjust.h.

Isis::ControlNet* Isis::BundleAdjust::m_pCnet
private

'ControlNet' object

Definition at line 471 of file BundleAdjust.h.

Isis::SerialNumberList* Isis::BundleAdjust::m_pHeldSnList
private

list of held image serial numbers

Definition at line 473 of file BundleAdjust.h.

Isis::LeastSquares* Isis::BundleAdjust::m_pLsq
private

< pointers to...

'LeastSquares' object

Definition at line 470 of file BundleAdjust.h.

Isis::ObservationNumberList* Isis::BundleAdjust::m_pObsNumList
private

list of observation numbers

vectors for statistical computations...

Definition at line 474 of file BundleAdjust.h.

std::vector< boost::numeric::ublas::bounded_vector< double, 3 > > Isis::BundleAdjust::m_Point_AprioriSigmas
private

vector of apriori sigmas for 3D point parameters

Definition at line 526 of file BundleAdjust.h.

std::vector< boost::numeric::ublas::bounded_vector< double, 3 > > Isis::BundleAdjust::m_Point_Corrections
private

vector of corrections to 3D point parameter

Definition at line 525 of file BundleAdjust.h.

std::vector< boost::numeric::ublas::bounded_vector< double, 3 > > Isis::BundleAdjust::m_Point_Weights
private

vector of weights for 3D point parameters

Definition at line 527 of file BundleAdjust.h.

Isis::SerialNumberList* Isis::BundleAdjust::m_pSnList
private

list of image serial numbers

Definition at line 472 of file BundleAdjust.h.

std::vector< SparseBlockRowMatrix > Isis::BundleAdjust::m_Qs_CHOLMOD
private

array of NICs (see Brown, 1976)

Definition at line 519 of file BundleAdjust.h.

SpacecraftPositionSolveType Isis::BundleAdjust::m_spacecraftPositionSolveType
private

spacecraft position solve type (define)

Definition at line 496 of file BundleAdjust.h.

Statistics Isis::BundleAdjust::m_Statsrx
private

x residuals

Definition at line 479 of file BundleAdjust.h.

Statistics Isis::BundleAdjust::m_Statsrxy
private

xy residuals

Definition at line 481 of file BundleAdjust.h.

Statistics Isis::BundleAdjust::m_Statsry
private

y residuals

Definition at line 480 of file BundleAdjust.h.

Statistics Isis::BundleAdjust::m_Statsx
private

x errors

Definition at line 477 of file BundleAdjust.h.

Statistics Isis::BundleAdjust::m_Statsy
private

y errors

Definition at line 478 of file BundleAdjust.h.

QString Isis::BundleAdjust::m_strCnetFileName
private

Control Net file specification.

Definition at line 464 of file BundleAdjust.h.

QString Isis::BundleAdjust::m_strOutputFilePrefix
private

output file prefix

Definition at line 466 of file BundleAdjust.h.

QString Isis::BundleAdjust::m_strSolutionMethod
private

solution method string (QR,SVD,SPARSE-LU,SPECIALK)

Definition at line 465 of file BundleAdjust.h.

MaximumLikelihoodWFunctions* Isis::BundleAdjust::m_wFunc[3]
private

This class is used to reweight observations in order to achieve more robust parameter estimation, up to three different maximum likelihood estimation models can be used in succession.

Definition at line 671 of file BundleAdjust.h.


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