Skip to content
Snippets Groups Projects
Unverified Commit e16b3149 authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Adds the ability to bundle adjust CSM images (#4537)


* copylab

* Initial work toward a working AbstractBundleObservation class

* Fix accidentl add of temporary changes from another project

* Trial 2 on fixing my accidental changes

* csm bundle building properly (#4409)

* Updates for linking and compiling

* Starting virtual functions

* Add virtuals to AbstractBundleObservation and get compiling again

* Remove function from parent

* Get jigsaw tests passing on csmbundle branch (#4413)

* Add virtuals to AbstractBundleObservation and get compiling again

* Remove function from parent

* Get existing jigsaw tests passing

* Remove unneeded functions from BundleObservation

* Clean up a bit more

* Clean up BundleObservation and AbstractBundleObservation more

* Remove unneeded BodyRotation

* Add target body solve back into bundle adjusment calc

* Remove debug output

* Removed unneeded memeber variables BundleObservation

Co-authored-by: default avatarKristin Berry <kberry@gyro.wr.usgs.gov>

* Move some functions to pure virtual

* Csmobservation (#4419)

* Now compiling

* Updated CSMCamera tests and docs

* Remove duplicated member variables and accesor functions from BundleObservation and add Csm camera type to Camera enum

* Remove commented-out code

* Added required headers from removed ground map header (#4427)

* last missing header (#4428)

* Moved CSM settings into BOSS

* Generates Serial Numbers using CSM label information (#4437)

* Creates Serial Numbers using CSM label information

* Updated second SerialNumberList:add function to accommodate CSM label

* Add hooks for csm bundle settings to jigsaw (#4438)

* In progress

* Added tests and Pvl support

* Add missing 'y' to docs

Co-authored-by: default avatarKristin Berry <kberry@usgs.gov>

* Moves partial calculation into CSM and ISIS observation classes. (#4436)

* Remove duplicated member variables and accesor functions from BundleObservation and add Csm camera type to Camera enum

* Remove commented-out code

* Imagecoeff migrated into BundleObservation class working

* Get base level working for all coeffs in ISIS

* Fix accidental move into if statement to get tests passing again

* Updated RHS for CsmBundleObservation to work

* Adds point3D support to CSM Camera observations and also adds ground Partials member function to CSMCamera

* Draft of sensor partials code

* Add docs, some fixes based on review requests

* move computation of weights and observation values to bundle observations

* Add observationvalue function to CsmBundleObservation and move the weighting that it is possible to to the observation classes

* Make CSMSolveSet an optional parameter to get jigsaw tests passing again

* cleanup

* Move observation weights into MLE if block

Co-authored-by: default avatarKristin Berry <kberry@gyro.wr.usgs.gov>

* Implemented bundleOutputString for CSM (#4444)

* Added test for CSM bundleOutputString

* Passing unit test and updates to bundleOutputString

* Addressed PR feedback

* Csmcsv (#4446)

* CSM CSV output

* Small test clean-up

* typo fix

* obs header fix

* Remove param list from bo

* Added debug output

* Now reurning

* Fixed unit test

* xml save test update

* Clean up bundleresults unit test output

* Fixed qfile member

* Fixed old path

* Changed header to use param names

* Making separate csvs

* Added reverse on obs by instId

* Trying to fix multiple sensors

* Fixed images header

* More debug

* removed debug outs

* Added terrible imageindex search

* Added held config fix

* Updated for observation test

* Updated jigsaw test makefiles

* Updated with new tests

* Updates Bundle Observation Vector to support Csm observations. (#4457)

* Remove duplicated member variables and accesor functions from BundleObservation and add Csm camera type to Camera enum

* Remove commented-out code

* Imagecoeff migrated into BundleObservation class working

* Get base level working for all coeffs in ISIS

* Fix accidental move into if statement to get tests passing again

* Updated RHS for CsmBundleObservation to work

* Adds point3D support to CSM Camera observations and also adds ground Partials member function to CSMCamera

* Draft of sensor partials code

* Add docs, some fixes based on review requests

* move computation of weights and observation values to bundle observations

* Add observationvalue function to CsmBundleObservation and move the weighting that it is possible to to the observation classes

* Make CSMSolveSet an optional parameter to get jigsaw tests passing again

* cleanup

* Move observation weights into MLE if block

* Added isis vs. csm support to Bundle Observation Vector class to allow jigsaw to proceed past the setup stage for csm networks

* Comment cleanup

* Fix failing unit tests

* Add docs

* Updated based on feedback with potentially temporary fix to get unit tests passing

* Update tests a bit

* Aligned signature definitions and cleaned up

* remove unneeded functions

* More comment cleanup

Co-authored-by: default avatarKristin Berry <kberry@gyro.wr.usgs.gov>

* Jigsaw Test Conversions (sccconfig, scconfigHeld, radar) (#4463)

* Converted jigsaw scconfig tests.

* Added jigsaw radar test

* Updated tests to reflect PR #4446 changes & removed makefile tests

* Updates to scconfig tests

* Gets csm bundle converging (#4464)

* Added cam type checks

* checking csm partials

* Debug partials

* debug corrections

* Fixed index

* Scaled ground partials

* Updated param comparison

* Removed debug out

* Fixes spacing issue in CSM bundleout.txt (#4465)

* Update csm bundlout to have correct spacing for paramter names

* Reverted unintential change

Co-authored-by: default avatarKristin Berry <kberry@gyro.wr.usgs.gov>

* Removed unit-test specific changes I made to the code instead of the unit test

* Add latitudinal partials for CSM (#4468)

* Add latitudinal partials for CSM

* Added test

Co-authored-by: default avatarJesse Mapel <jmapel@usgs.gov>

* Csm clean up (#4483)

* Added cms index list error

* Added CSMCameraTests for partials

* Observation clean-up

* Cleaned up vector

* Rename BundleObservation classes (#4518)

* rename BundleObservation classes

* omit changes to sip wrappers

* Adds more capabilities to TestCsmModel (#4527)

* Updated to get new isd/state form to test jigsaw parsing

* Add functional image-to-ground, ground-to-image, and isd-parsing to TestCsmModel

* Remove temporary csminit test changes

* Updated variable name for clarity

* add csm info to app docs for csminit and jigsaw

* Csmbundle - remove SIP wrappers and deprecated formatBundleOutputString (#4526)

* remove sip wrappers

* remove deprecated formatBundleOutputString

* remove more sip code and formatBundleOutputString

* Fix functional tests to work with updated TestCsmModel (#4534)

* Tests + test data for CSM jigsaw (#4530)

* Removed debug couts

* Added csmnetwork test fixture

* Added a test for CSM test network

* Adjusted trig functions + added deg/rad conversions

* Initial CSMNetwork data

* Uncommented code

* Removed network path and control network from CSMNetwork fixture

* Removed temporary path from csv comparison

* Adjusted spacing + responded to PR feedback

Co-authored-by: default avatarAustin Sanders <arsanders@ugs.gov>

* Added the ability to update CSM model state in jigsaw (#4529)

* Added the ability to update CSM model state in jigsaw

* Added missing function docs

* Updated CSM jigsaw test to check apply

* Wrangled up an F

* Added changelog entry

* General clean-up

* Changed Camera local photometric calculations to not use bodyrotation

* Changed csm camera to save look on non-intersection

* Fixed docs typos

Co-authored-by: default avatarKristin Berry <kberry@gyro.wr.usgs.gov>
Co-authored-by: default avatarKristin Berry <kberry@usgs.gov>
Co-authored-by: default avatarAmy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Co-authored-by: default avatarTim Giroux <62255438+tgiroux@users.noreply.github.com>
Co-authored-by: default avatarTim Giroux <tgiroux@contractor.usgs.gov>
Co-authored-by: default avatarAustinSanders <arsanders@usgs.gov>
Co-authored-by: default avatarAustin Sanders <arsanders@ugs.gov>
parent 5c7ef966
No related branches found
No related tags found
No related merge requests found
Showing
with 71 additions and 1396 deletions
......@@ -37,10 +37,13 @@ release.
### Added
- Added a new dark current correction to hical that works with the higher temperatures recent images are captured at. Use the new config file, $ISISDATA/mro/calibration/hical.0023_darkrate.conf, to enable the new dark current correction over the old dark current correction. Runs of hical without the new dark current correction will also produce an extra line in the output log indicating that the ZeroDarkRate module is disabled. [#4324](https://github.com/USGS-Astrogeology/ISIS3/issues/4324)
- Added the ability to bundle adjust CSM models in jigsaw. Use the new CSMSOLVESET, CSMSOLVETYPE, and CSMSOLVELIST arguments to specify what you solve for. [#4537](https://github.com/USGS-Astrogeology/ISIS3/pull/4537)
### Changed
- Added the ability to export footprint information from a CaSSIS ISIS Cube label to the generated output PDS4 label in tgocassisrdrgen. [#4473](https://github.com/USGS-Astrogeology/ISIS3/issues/4473)
- isisVarInit.py no longer writes a "cat" statement by default to the activate scripts which cause the ISIS version information to be written on conda activate. This can be included in those scripts via a command line option to isisVarInit.py. Also, a quiet option is provided to isisVarInit.py to suppress its own writing to standard out, if needed.
- Changed how the images.csv file is output in jigsaw when there are multiple models. Now each sensor model will have its own images.csv file so that column headers can all be correct. For example, a solution involving LRONAC pairs and Apollo Metric images would generate three images.csv files: LRONAC Left, LRONAC Right, and Apollo Metric. [#4324](https://github.com/USGS-Astrogeology/ISIS3/issues/4324)
- Changed the API of many Bundle utility classes as part of CSM support in jigsaw. [#4324](https://github.com/USGS-Astrogeology/ISIS3/issues/4324)
### Fixed
- Fixed logging in FindFeatures where we were trying to get a non-existent Pvl group from the Pvl log. [#4375](https://github.com/USGS-Astrogeology/ISIS3/issues/4375)
......
......@@ -303,7 +303,6 @@ endif(APPLE)
if(pybindings)
find_package(Python REQUIRED)
find_package(Sip REQUIRED)
endif()
# Iterate through all variables and extract the libraries and include directories
......@@ -356,70 +355,6 @@ list(REMOVE_DUPLICATES ALLLIBDIRS)
list(REMOVE_DUPLICATES ALLLIBS)
list(REMOVE_DUPLICATES ALLINCDIRS)
#===============================================================================
#===============================================================================
# Set python bindings configuration and set target for generating C++ files
if(pybindings)
message("Configuring Python Bindings")
if (NOT DEFINED PYINSTALL_DIR)
set(PYINSTALL_DIR ${PYTHON_SITE_PACKAGES_DIR})
endif()
message(STATUS "PYTHON BINDINGS INSTALL DIR: ${PYINSTALL_DIR}")
# We need to get the locations for sip files, modules, etc.
set(ISIS_SIP_DIR "${CMAKE_SOURCE_DIR}/sipfiles")
set(ISIS_SIP_MODULE "${CMAKE_SOURCE_DIR}/sipfiles/master.sip")
set(SIP_BUILD_FILE "isispy.sbf")
set(ISIS_SIP_CODE_DIR ${CMAKE_BINARY_DIR}/sipsrc)
# Create the output directory for the new .CPP files
execute_process(COMMAND mkdir -p "${ISIS_SIP_CODE_DIR}")
# get list of output files exepected from sip
# get the PYQT configuration based flags from Python
execute_process(COMMAND ${PYTHON_EXECUTABLE} -c
"from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict;print(qtconfigdict['sip_flags'])"
OUTPUT_VARIABLE PYQT_SIP_FLAGS)
# CMAKE doesn't handle spaces from python well when piping that into the
# command because of white space and a trailing new line,
# so we turn it into a list
message(STATUS "Getting SIP config...")
message(STATUS "Attempting 'python -c \"from PyQt5.QtCore import PYQT_CONFIGURATION as qtconfigdict; print(qtconfigdict['sip_flags'])\"'")
if (${PYQT_SIP_FLAGS} STREQUAL "")
message(FATAL_ERROR "print(qtconfigdict['sip_flags']) returned empty string, is sip installed? Python binding can be disabled with pybindings=OFF")
endif()
string(STRIP ${PYQT_SIP_FLAGS} PYQT_SIP_FLAGS)
string(REPLACE " " ";" PYQT_SIP_FLAGS ${PYQT_SIP_FLAGS})
message(STATUS "FLAGS: ${PYQT_SIP_FLAGS}")
message(STATUS "Generating C++ code from sip files")
message(STATUS "SIP BUILD FILE: ${SIP_BUILD_FILE}")
message(STATUS "SIP MODULE: ${ISIS_SIP_MODULE}")
message(STATUS "SIP GENERATED CODE DIR: ${ISIS_SIP_CODE_DIR}")
execute_process(COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE})
# add target so users can run the command after initial configuration
add_custom_target(sipfiles
COMMAND ${SIP_BINARY_PATH} -e -o -c ${ISIS_SIP_CODE_DIR} -I ${SIP_DEFAULT_SIP_DIR}/PyQt5 ${PYQT_SIP_FLAGS} ${ISIS_SIP_MODULE}
COMMENT "Generating C++ code from sip files")
file(GLOB SIP_GENERATED_SOURCE_FILES ${ISIS_SIP_CODE_DIR}/*.cpp)
add_library(isispy MODULE ${SIP_GENERATED_SOURCE_FILES})
target_link_libraries(isispy ${ALLLIBS})
target_link_libraries(isispy isis)
set_target_properties(isispy PROPERTIES LINK_DEPENDS isis INSTALL_RPATH ${CMAKE_INSTALL_PREFIX})
add_dependencies(isispy sipfiles)
install(TARGETS isispy DESTINATION ${PYINSTALL_DIR})
endif()
#===============================================================================
#===============================================================================
......
Group = Keyword1
Auto
InputKey = CSMPlatformId
InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo)
OutputName = Keyword1
OutputPosition = (Group, SerialNumberKeywords)
Translation = (* , *)
End_Group
Group = Keyword2
Auto
InputKey = CSMInstrumentId
InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo)
OutputName = Keyword2
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group
Group = Keyword3
Auto
InputKey = ReferenceTime
InputGroup = "IsisCube,CsmInfo"
InputPosition = (IsisCube, CsmInfo)
OutputName = Keyword3
OutputPosition = (Group, SerialNumberKeywords)
Translation = (*, *)
End_Group
End
# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS
#
# SIP_VERSION - The version of SIP found expressed as a 6 digit hex number
# suitable for comparison as a string.
#
# SIP_VERSION_STR - The version of SIP found as a human readable string.
#
# SIP_BINARY_PATH - Path and filename of the SIP command line executable.
#
# SIP_INCLUDE_DIR - Directory holding the SIP C++ header file.
#
# SIP_DEFAULT_SIP_DIR - Default directory where .sip files should be installed
# into.
IF(SIP_VERSION)
# Already in cache, be silent
SET(SIP_FOUND TRUE)
ELSE(SIP_VERSION)
FIND_FILE(_find_sip_py FindSip.py PATHS ${CMAKE_MODULE_PATH})
EXECUTE_PROCESS(COMMAND ${PYTHON_EXECUTABLE} ${_find_sip_py} OUTPUT_VARIABLE sip_config)
IF(sip_config)
STRING(REGEX REPLACE "^sip_version:([^\n]+).*$" "\\1" SIP_VERSION ${sip_config})
STRING(REGEX REPLACE ".*\nsip_version_num:([^\n]+).*$" "\\1" SIP_VERSION_NUM ${sip_config})
STRING(REGEX REPLACE ".*\nsip_version_str:([^\n]+).*$" "\\1" SIP_VERSION_STR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_bin:([^\n]+).*$" "\\1" SIP_BINARY_PATH ${sip_config})
STRING(REGEX REPLACE ".*\ndefault_sip_dir:([^\n]+).*$" "\\1" SIP_DEFAULT_SIP_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_inc_dir:([^\n]+).*$" "\\1" SIP_INCLUDE_DIR ${sip_config})
STRING(REGEX REPLACE ".*\nsip_mod_dir:([^\n]+).*$" "\\1" SIP_MOD_DIR ${sip_config})
SET(SIP_FOUND TRUE)
ENDIF(sip_config)
IF(SIP_FOUND)
IF(NOT SIP_FIND_QUIETLY)
MESSAGE(STATUS "Found SIP version: ${SIP_VERSION_STR}")
ENDIF(NOT SIP_FIND_QUIETLY)
ELSE(SIP_FOUND)
IF(SIP_FIND_REQUIRED)
MESSAGE(FATAL_ERROR "Could not find SIP")
ENDIF(SIP_FIND_REQUIRED)
ENDIF(SIP_FOUND)
ENDIF(SIP_VERSION)
# Borrowed mostly from the QGIS project: https://github.com/qgis/QGIS
import sipconfig
sipcfg = sipconfig.Configuration()
print("sip_version:%06.0x" % sipcfg.sip_version)
print("sip_version_num:%d" % sipcfg.sip_version)
print("sip_version_str:%s" % sipcfg.sip_version_str)
print("sip_bin:%s" % sipcfg.sip_bin)
print("default_sip_dir:%s" % sipcfg.default_sip_dir)
print("sip_inc_dir:%s" % sipcfg.sip_inc_dir)
print("sip_mod_dir:%s" % sipcfg.sip_mod_dir)
// SIP Wrapper to the ISIS bundle class
%Include type_conversions.sip
namespace Isis {
class BundleAdjust : public QObject {
%TypeHeaderCode
#include "BundleAdjust.h"
#include "IException.h"
%End
public:
// Stuff in the square brackets [] indicate the C++ interface while the sip
// function name indicates the C python function interface
BundleAdjust(PyObject* settings, const QString &cnetFile, const QString &cubeList, bool printSummary = true) throw(Isis::IException) [(QSharedPointer<Isis::BundleSettings>, QString, QString, bool)];
%MethodCode
int sipErr = 0;
QSharedPointer<Isis::BundleSettings> *wrappedSettings = new QSharedPointer<Isis::BundleSettings>();
Isis::BundleSettings *settings = (Isis::BundleSettings*) sipConvertToType(a0, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr);
wrappedSettings->reset(settings);
try {
sipCpp = new sipIsis_BundleAdjust(*wrappedSettings, *a1, *a2, a3);
}
catch (Isis::IException &error) {
PyErr_SetString(sipException_Isis_IException, error.what());
return NULL;
}
%End
Isis::BundleSolutionInfo* solveCholeskyBR();
%MethodCode
try {
return sipConvertFromType(sipCpp->solveCholeskyBR(), sipType_Isis_BundleSolutionInfo, NULL);
}
catch (Isis::IException &error) {
PyErr_SetString(sipException_Isis_IException, error.what());
return NULL;
}
%End
};
};
namespace Isis {
class BundleControlPoint {
%TypeHeaderCode
#include "BundleControlPoint.h"
#include <QSharedPointer>
%End
public:
SIP_PYTYPE measures() throw(Isis::IException);
%MethodCode
size_t size = sipCpp->size();
PyObject *l = PyList_New(size);
for (size_t i = 0; i < size; ++i) {
Isis::BundleMeasure* cppMeasure = sipCpp->at(i).data();
PyObject *pyMeasure = sipConvertFromType((void*)(cppMeasure), sipType_Isis_BundleMeasure, NULL);
PyList_SetItem(l, i, pyMeasure);
}
return l;
%End
// BundleControlPoint(ControlPoint *point); // default constructor
BundleControlPoint(const Isis::BundleControlPoint &src) throw(Isis::IException);
~BundleControlPoint();
// copy
void copy(const Isis::BundleControlPoint &src) throw(Isis::IException);
// mutators
// QSharedPointer<Isis::BundleMeasure> addMeasure(ControlMeasure *controlMeasure);
void computeResiduals() throw(Isis::IException);
void setNumberOfRejectedMeasures(int numRejected) throw(Isis::IException);
void setRejected(bool reject) throw(Isis::IException);
void setWeights(const QSharedPointer<Isis::BundleSettings> settings, double metersToRadians) throw(Isis::IException);
void zeroNumberOfRejectedMeasures() throw(Isis::IException);
// accessors
bool isRejected() const throw(Isis::IException);
int numberOfMeasures() const throw(Isis::IException);
int numberOfRejectedMeasures() const throw(Isis::IException);
double residualRms() const throw(Isis::IException);
QString id() const throw(Isis::IException);
Isis::ControlPoint::PointType type() const throw(Isis::IException);
// string format methods
QString formatBundleOutputSummaryString(bool errorPropagation) const throw(Isis::IException);
QString formatBundleOutputDetailString(bool errorPropagation, double RTM, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/;
QString formatValue(double value, int fieldWidth, int precision) throw(Isis::IException);
QString formatAprioriSigmaString(int type, int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/;
QString formatLatitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException);
QString formatLongitudeAprioriSigmaString(int fieldWidth, int precision) const throw(Isis::IException);
QString formatRadiusAprioriSigmaString(int fieldWidth, int precision, bool solveRadius=false) throw(Isis::IException) /KeywordArgs="Optional"/;
QString formatAdjustedSigmaString(int type, int fieldWidth, int precision,
bool errorPropagation) const throw(Isis::IException);
QString formatLatitudeAdjustedSigmaString(int fieldWidth, int precision,
bool errorPropagation) const throw(Isis::IException);
QString formatLongitudeAdjustedSigmaString(int fieldWidth, int precision,
bool errorPropagation) const throw(Isis::IException);
QString formatRadiusAdjustedSigmaString(int fieldWidth, int precision,
bool errorPropagation) const throw(Isis::IException);
};
};
namespace Isis {
class BundleImage /NoDefaultCtors/ {
%TypeHeaderCode
#include "BundleImage.h"
%End
%InstanceCode
sipCpp = new Isis::BundleImage(NULL, "", "");
%End
public:
// QSharedPointer<BundleObservation> parentObservation();
QString serialNumber() throw(Isis::IException);
QString fileName() throw(Isis::IException);
};
};
%Include type_conversions.sip
namespace Isis {
class BundleMeasure /NoDefaultCtors/ {
%TypeHeaderCode
#include "BundleMeasure.h"
%End
public:
bool isRejected() const throw(Isis::IException);
// Camera *camera() const;
// Isis::BundleControlPoint *parentControlPoint();
QSharedPointer<Isis::BundleImage> parentBundleImage() throw(Isis::IException);
// QSharedPointer<BundleObservation> parentBundleObservation();
// const QSharedPointer<BundleObservationSolveSettings> observationSolveSettings();
double sample() const throw(Isis::IException);
double sampleResidual() const throw(Isis::IException);
double line() const throw(Isis::IException);
double lineResidual() const throw(Isis::IException);
double residualMagnitude() const throw(Isis::IException);
QString cubeSerialNumber() const throw(Isis::IException);
double focalPlaneComputedX() const throw(Isis::IException);
double focalPlaneComputedY() const throw(Isis::IException);
double focalPlaneMeasuredX() const throw(Isis::IException);
double focalPlaneMeasuredY() const throw(Isis::IException);
int observationIndex() const throw(Isis::IException);
};
};
%Import QtCore/QtCoremod.sip
%Import QtXml/QtXmlmod.sip
namespace Isis{
class BundleObservationSolveSettings {
%TypeHeaderCode
#include "BundleObservationSolveSettings.h"
%End
public:
enum InstrumentPointingSolveOption {
NoPointingFactors = 0, /**< Solve for none of the pointing factors.*/
AnglesOnly = 1, /**< Solve for pointing angles: right ascension, declination
and, optionally, twist.*/
AnglesVelocity = 2, //!< Solve for pointing angles and their angular velocities.
AnglesVelocityAcceleration = 3, /**< Solve for pointing angles, their velocities and their
accelerations.*/
AllPointingCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to
the pointing angles.*/
};
//! Options for how to solve for instrument position
enum InstrumentPositionSolveOption {
NoPositionFactors = 0, /**< Solve for none of the position factors.*/
PositionOnly = 1, /**< Solve for instrument positions only.*/
PositionVelocity = 2, /**< Solve for instrument positions and velocities.*/
PositionVelocityAcceleration = 3, /**< Solve for instrument positions, velocities, and
accelerations.*/
AllPositionCoefficients = 4 /**< Solve for all coefficients in the polynomials fit to
the instrument positions.*/
};
BundleObservationSolveSettings() throw(Isis::IException);
InstrumentPositionSolveOption stringToInstrumentPositionSolveOption(QString option) throw(Isis::IException);
InstrumentPointingSolveOption stringToInstrumentPointingSolveOption(QString option) throw(Isis::IException);
void setInstrumentPositionSettings(InstrumentPositionSolveOption option,
int spkDegree = 2,
int spkSolveDegree = 2,
bool positionOverHermite = false,
double positionAprioriSigma = -1.0,
double velocityAprioriSigma = -1.0,
double accelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/;
void setInstrumentPointingSettings(InstrumentPointingSolveOption option,
bool solveTwist,
int ckDegree = 2,
int ckSolveDegree = 2,
bool solvePolynomialOverExisting = false,
double anglesAprioriSigma = -1.0,
double angularVelocityAprioriSigma = -1.0,
double angularAccelerationAprioriSigma = -1.0) throw(Isis::IException) /KeywordArgs="Optional"/;
};
};
%Include Statistics.sip
%Include type_conversions.sip
namespace Isis {
class BundleResults : public QObject {
%TypeHeaderCode
#include "BundleResults.h"
%End
public:
BundleResults(const Isis::BundleResults &src);
void initialize();
void resizeSigmaStatisticsVectors(int numberImages);
// void setRmsImageResidualLists(QList<Isis::Statistics> rmsImageLineResiduals,
// QList<Isis::Statistics> rmsImageSampleResiduals,
// QList<Isis::Statistics> rmsImageResiduals);
// void setRmsImageResidualLists(QVector<Isis::Statistics> rmsImageLineResiduals,
// QVector<Isis::Statistics> rmsImageSampleResiduals,
// QVector<Isis::Statistics> rmsImageResiduals);
// void setSigmaLatitudeRange(Distance minLatDist, Distance maxLatDist,
// QString minLatPointId, QString maxLatPointId);
// void setSigmaLongitudeRange(Distance minLonDist, Distance maxLonDist,
// QString minLonPointId, QString maxLonPointId);
// void setSigmaRadiusRange(Distance minRadDist, Distance maxRadDist,
// QString minRadPointId, QString maxRadPointId);
void setRmsFromSigmaStatistics(double rmsFromSigmaLatStats,
double rmsFromSigmaLonStats,
double rmsFromSigmaRadStats);
void printMaximumLikelihoodTierInformation() throw(Isis::IException);
void incrementMaximumLikelihoodModelIndex() throw(Isis::IException);
void incrementFixedPoints() throw(Isis::IException);
int numberFixedPoints() const throw(Isis::IException);
void incrementHeldImages() throw(Isis::IException);
int numberHeldImages() const throw(Isis::IException);
void incrementIgnoredPoints() throw(Isis::IException);
int numberIgnoredPoints() const throw(Isis::IException); // currently unused ???
void setRejectionLimit(double rejectionLimit) throw(Isis::IException);
void setRmsXYResiduals(double rx, double ry, double rxy) throw(Isis::IException);
void setNumberRejectedObservations(int numberObservations) throw(Isis::IException);
void setNumberObservations(int numberObservations) throw(Isis::IException);
void setNumberImageParameters(int numberParameters) throw(Isis::IException); // ??? this is the same value an m_nRank
void resetNumberConstrainedPointParameters() throw(Isis::IException);
void incrementNumberConstrainedPointParameters(int incrementAmount) throw(Isis::IException);
void resetNumberConstrainedImageParameters() throw(Isis::IException);
void incrementNumberConstrainedImageParameters(int incrementAmount) throw(Isis::IException);
void resetNumberConstrainedTargetParameters() throw(Isis::IException);
void incrementNumberConstrainedTargetParameters(int incrementAmount) throw(Isis::IException);
void setNumberUnknownParameters(int numberParameters) throw(Isis::IException);
void computeDegreesOfFreedom() throw(Isis::IException);
void computeSigma0(double dvtpv, Isis::BundleSettings::ConvergenceCriteria criteria) throw(Isis::IException);
void setDegreesOfFreedom(double degreesOfFreedom) throw(Isis::IException);
void setSigma0(double sigma0) throw(Isis::IException);
void setElapsedTime(double time) throw(Isis::IException);
void setElapsedTimeErrorProp(double time) throw(Isis::IException);
void setRadiansToMeters(double rtm) throw(Isis::IException);
void setConverged(bool converged) throw(Isis::IException); // or initialze method
// void setBundleControlPoints(QVector<BundleControlPointQsp> controlPoints);
// void setOutputControlNet(QSharedPointer<Isis::ControlNet> outNet);
void setIterations(int iterations) throw(Isis::IException);
// void setObservations(BundleObservationVector observations) throw(Isis::IException);
QList<Isis::Statistics> rmsImageSampleResiduals() const throw(Isis::IException);
QList<Isis::Statistics> rmsImageLineResiduals() const throw(Isis::IException);
QList<Isis::Statistics> rmsImageResiduals() const throw(Isis::IException);
QVector<Isis::Statistics> rmsImageXSigmas() const throw(Isis::IException); // currently unused ???
QVector<Isis::Statistics> rmsImageYSigmas() const throw(Isis::IException); // currently unused ???
QVector<Isis::Statistics> rmsImageZSigmas() const throw(Isis::IException); // currently unused ???
QVector<Isis::Statistics> rmsImageRASigmas() const throw(Isis::IException); // currently unused ???
QVector<Isis::Statistics> rmsImageDECSigmas() const throw(Isis::IException); // currently unused ???
QVector<Isis::Statistics> rmsImageTWISTSigmas() const throw(Isis::IException); // currently unused ???
// Distance minSigmaLatitudeDistance() const throw(Isis::IException);
// Distance maxSigmaLatitudeDistance() const throw(Isis::IException);
// Distance minSigmaLongitudeDistance() const throw(Isis::IException);
// Distance maxSigmaLongitudeDistance() const throw(Isis::IException);
// Distance minSigmaRadiusDistance() const throw(Isis::IException);
// Distance maxSigmaRadiusDistance() const throw(Isis::IException);
QString maxSigmaLatitudePointId() const throw(Isis::IException);
QString minSigmaLatitudePointId() const throw(Isis::IException);
QString minSigmaLongitudePointId() const throw(Isis::IException);
QString maxSigmaLongitudePointId() const throw(Isis::IException);
QString minSigmaRadiusPointId() const throw(Isis::IException);
QString maxSigmaRadiusPointId() const throw(Isis::IException);
double sigmaLatitudeStatisticsRms() const throw(Isis::IException);
double sigmaLongitudeStatisticsRms() const throw(Isis::IException);
double sigmaRadiusStatisticsRms() const throw(Isis::IException);
double rmsRx() const throw(Isis::IException); // currently unused ???
double rmsRy() const throw(Isis::IException); // currently unused ???
double rmsRxy() const throw(Isis::IException); // currently unused ???
double rejectionLimit() const throw(Isis::IException);
double radiansToMeters() const throw(Isis::IException);
int numberRejectedObservations() const throw(Isis::IException);
int numberObservations() const throw(Isis::IException);
int numberImageParameters() const throw(Isis::IException); // ??? this is the same value an m_nRank
int numberConstrainedPointParameters() const throw(Isis::IException);
int numberConstrainedImageParameters() const throw(Isis::IException);
int numberConstrainedTargetParameters() const throw(Isis::IException);
int numberUnknownParameters() const throw(Isis::IException);
int degreesOfFreedom() const throw(Isis::IException);
double sigma0() const throw(Isis::IException);
double elapsedTime() const throw(Isis::IException);
double elapsedTimeErrorProp() const throw(Isis::IException);
bool converged() const throw(Isis::IException); // or initialze method
QVector<QSharedPointer<Isis::BundleControlPoint> > &bundleControlPoints();
QSharedPointer<Isis::ControlNet> outputControlNet() const throw(Isis::IException);
int iterations() const throw(Isis::IException);
int numberMaximumLikelihoodModels() const throw(Isis::IException);
int maximumLikelihoodModelIndex() const throw(Isis::IException);
double maximumLikelihoodMedianR2Residuals() const throw(Isis::IException);
double maximumLikelihoodModelQuantile(int modelIndex) const throw(Isis::IException);
};
};
%Include BundleObservationSolveSettings.sip
%Include MaximumLikelihoodWFunctions.sip
%Include type_conversions.sip
namespace Isis {
class BundleSettings {
%TypeHeaderCode
#include "BundleSettings.h"
#include "BundleObservationSolveSettings.h"
#include <QList>
%End
public:
enum ConvergenceCriteria {
Sigma0, /**< The value of sigma0 will be used to determine that the bundle
adjustment has converged.*/
ParameterCorrections /**< All parameter corrections will be used to determine that the
bundle adjustment has converged.*/
};
// enum MaximumLikelihoodModel {
// NoMaximumLikelihoodEstimator,
// Huber,
// ModifiedHuber,
// Welsch,
// Chen
// };
BundleSettings() throw(Isis::IException);
void setValidateNetwork(bool) throw(Isis::IException);
void setSolveOptions(bool solveObservationMode = false,
bool updateCubeLabel = false,
bool errorPropagation = false,
bool solveRadius = false,
double globalLatitudeAprioriSigma = Isis::Null,
double globalLongitudeAprioriSigma = Isis::Null,
double globalRadiusAprioriSigma = Isis::Null) throw(Isis::IException) /KeywordArgs="Optional"/;
void setOutlierRejection(bool outlierRejection,
double multiplier = 1.0) throw(Isis::IException);
bool solveObservationMode() const throw(Isis::IException);
bool solveRadius() const throw(Isis::IException);
bool updateCubeLabel() const throw(Isis::IException);
bool errorPropagation() const throw(Isis::IException);
bool outlierRejection() const throw(Isis::IException);
double outlierRejectionMultiplier() const throw(Isis::IException);
double globalLatitudeAprioriSigma() const throw(Isis::IException);
double globalLongitudeAprioriSigma() const throw(Isis::IException);
double globalRadiusAprioriSigma() const throw(Isis::IException);
int numberSolveSettings() const throw(Isis::IException);
Isis::BundleObservationSolveSettings observationSolveSettings(QString instrumentId) const throw(Isis::IException);
Isis::BundleObservationSolveSettings observationSolveSettings(int n) const throw(Isis::IException);
void setObservationSolveOptions(QList<Isis::BundleObservationSolveSettings>);
// %MethodCode
// Py_ssize_t size = PyList_Size(a0);
// QList<Isis::BundleObservationSolveSettings> *cppSettingsList = new QList<Isis::BundleObservationSolveSettings>();
// int sipErr = 0;
// for(int i = 0; i < size; i++) {
// PyObject *pyStat = PyList_GET_ITEM(a0, i);
// Isis::BundleObservationSolveSettings *settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pyStat, sipType_Isis_BundleObservationSolveSettings, NULL, SIP_NOT_NONE, NULL, &sipErr);
// cppSettingsList->append(*settings);
// }
//
// sipCpp->setObservationSolveOptions(*cppSettingsList);
// %End
SIP_PYLIST maximumLikelihoodEstimatorModels() const throw(Isis::IException);
%MethodCode // convert QList<QPair> to Python list if tuples
typedef Isis::MaximumLikelihoodWFunctions::Model Model;
size_t size = sipCpp->maximumLikelihoodEstimatorModels().size();
PyObject *l = PyList_New(size);
for (size_t i = 0; i < size; ++i) {
// get the two items from the QPair
Model *model = new Model(sipCpp->maximumLikelihoodEstimatorModels()[i].first);
double doubl = sipCpp->maximumLikelihoodEstimatorModels()[i].second;
// Convert the two items to PyObjects
PyObject *first = sipConvertFromType((void*)(model), sipType_Isis_MaximumLikelihoodWFunctions_Model, NULL);
PyObject *second = PyFloat_FromDouble(doubl);
// set the tuple items
PyObject *tuple = PyTuple_New(2);
PyTuple_SetItem(tuple, 0, first);
PyTuple_SetItem(tuple, 1, second);
// Add new tuple to list
PyList_SetItem(l, i, tuple);
}
return l;
%End
int numberTargetBodyParameters() const throw(Isis::IException);
bool solveTargetBody() const throw(Isis::IException);
bool solvePoleRA() const throw(Isis::IException);
bool solvePoleRAVelocity() const throw(Isis::IException);
bool solvePoleDec() const throw(Isis::IException);
bool solvePoleDecVelocity() const throw(Isis::IException);
bool solvePM() const throw(Isis::IException);
bool solvePMVelocity() const throw(Isis::IException);
bool solvePMAcceleration() const throw(Isis::IException);
bool solveTriaxialRadii() const throw(Isis::IException);
bool solveMeanRadius() const throw(Isis::IException);
};
};
%Include type_conversions.sip
namespace Isis{
class BundleSolutionInfo : public QObject {
%TypeHeaderCode
#include "BundleSolutionInfo.h"
%End
public:
// do constructor since at the moment there doesn't seem to be a reason to contruct it directly in the python side
void setOutputStatistics(Isis::BundleResults statisticsResults) throw(Isis::IException);
void setRunTime(QString runTime) throw(Isis::IException);
QString id() const throw(Isis::IException);
QSharedPointer<Isis::BundleSettings> bundleSettings() throw(Isis::IException);
Isis::BundleResults bundleResults() throw(Isis::IException);
QString runTime() const throw(Isis::IException);
bool outputText() throw(Isis::IException);
bool outputPointsCSV() throw(Isis::IException);
bool outputResiduals() throw(Isis::IException);
}; // end namespace Isis
};
namespace Isis {
class ControlNet : public QObject {
%TypeHeaderCode
#include "ControlNet.h"
%End
public:
ControlNet() throw(Isis::IException);
ControlNet(const Isis::ControlNet &other) throw(Isis::IException);
void clear() throw(Isis::IException);
void Write(const QString &filename, bool pvl = false) throw(Isis::IException);
double GetMaximumResidual() throw(Isis::IException);
QString GetNetworkId() const throw(Isis::IException);
int GetNumEditLockMeasures() throw(Isis::IException);
int GetNumEditLockPoints() throw(Isis::IException);
int GetNumIgnoredMeasures() throw(Isis::IException);
int GetNumberOfValidMeasuresInImage(const QString &serialNumber) throw(Isis::IException);
int GetNumberOfJigsawRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException);
void ClearJigsawRejected() throw(Isis::IException);
void IncrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException);
void DecrementNumberOfRejectedMeasuresInImage(const QString &serialNumber) throw(Isis::IException);
int GetNumMeasures() const throw(Isis::IException);
int GetNumPoints() const throw(Isis::IException);
int GetNumValidMeasures() throw(Isis::IException);
int GetNumValidPoints() throw(Isis::IException);
QString GetTarget() const throw(Isis::IException);
QString GetUserName() const throw(Isis::IException);
};
};
namespace Isis {
class ControlPoint : public QObject {
%TypeHeaderCode
#include "ControlPoint.h"
%End
public:
enum PointType {
Fixed = 0,
Constrained = 1,
Free = 2
};
enum Status {
Failure,
Success,
PointLocked
};
enum ConstraintStatus {
LatitudeConstrained = 0,
LongitudeConstrained = 1,
RadiusConstrained = 2,
// XConstrained = 3,
// YConstrained = 4,
// ZConstrained = 5;
};
// This stuff input to jigsaw
// How did apriori source get computed??
struct SurfacePointSource {
enum Source {
None,
User,
AverageOfMeasures,
Reference,
Basemap,
BundleSolution
};
};
struct RadiusSource {
enum Source {
None,
User,
AverageOfMeasures,
Ellipsoid,
DEM,
BundleSolution
};
};
ControlPoint() throw(Isis::IException);
ControlPoint(const QString &id) throw(Isis::IException);
// Isis::ControlNet *Parent() { return parentNetwork; }
// void Load(PvlObject &p) throw(Isis::IException);
// void Add(ControlMeasure *measure) throw(Isis::IException);
// int Delete(ControlMeasure *measure) throw(Isis::IException);
// int Delete(QString serialNumber) throw(Isis::IException);
// int Delete(int index) throw(Isis::IException);
// Status ResetApriori() throw(Isis::IException);
// const Isis::ControlMeasure *GetMeasure(QString serialNumber) const throw(Isis::IException);
// ControlMeasure *GetMeasure(QString serialNumber) throw(Isis::IException);
// const ControlMeasure *GetMeasure(int index) const throw(Isis::IException);
// ControlMeasure *GetMeasure(int index) throw(Isis::IException);
// const ControlMeasure *GetRefMeasure() const throw(Isis::IException);
// ControlMeasure *GetRefMeasure() throw(Isis::IException);
// Status SetChooserName(QString name) throw(Isis::IException);
// Status SetDateTime(QString newDateTime) throw(Isis::IException);
// Status SetEditLock(bool editLock) throw(Isis::IException);
// Status SetId(QString id) throw(Isis::IException);
// Status SetRefMeasure(ControlMeasure *cm) throw(Isis::IException);
// Status SetRefMeasure(int index) throw(Isis::IException);
// Status SetRefMeasure(QString sn) throw(Isis::IException);
// Status SetRejected(bool rejected) throw(Isis::IException);
// Status SetIgnored(bool newIgnoreStatus) throw(Isis::IException);
// Status SetAdjustedSurfacePoint(SurfacePoint newSurfacePoint) throw(Isis::IException);
// Status SetType(PointType newType) throw(Isis::IException);
//
// Status SetAprioriRadiusSource(RadiusSource::Source source) throw(Isis::IException);
// Status SetAprioriRadiusSourceFile(QString sourceFile) throw(Isis::IException);
// Status SetAprioriSurfacePoint(SurfacePoint aprioriSP) throw(Isis::IException);
// Status SetAprioriSurfacePointSource(SurfacePointSource::Source source) throw(Isis::IException);
// Status SetAprioriSurfacePointSourceFile(QString sourceFile) throw(Isis::IException);
// Status UpdateSphericalPointCoordinates(const Latitude &lat, const Longitude &lon,
// const Distance &radius) throw(Isis::IException);
// Status ComputeApriori() throw(Isis::IException);
// Status ComputeResiduals() throw(Isis::IException);
// Status ComputeResiduals_Millimeters() throw(Isis::IException);
//
// SurfacePoint GetAdjustedSurfacePoint() const throw(Isis::IException);
// SurfacePoint GetBestSurfacePoint() const throw(Isis::IException);
QString GetChooserName() const throw(Isis::IException);
QString GetDateTime() const throw(Isis::IException);
bool IsEditLocked() const throw(Isis::IException);
bool IsRejected() const throw(Isis::IException);
QString GetId() const throw(Isis::IException);
bool IsIgnored() const throw(Isis::IException);
bool IsValid() const throw(Isis::IException);
bool IsInvalid() const throw(Isis::IException);
bool IsFixed() const throw(Isis::IException);
bool HasAprioriCoordinates() throw(Isis::IException);
bool IsConstrained() throw(Isis::IException);
bool IsLatitudeConstrained() throw(Isis::IException);
bool IsLongitudeConstrained() throw(Isis::IException);
bool IsRadiusConstrained() throw(Isis::IException);
int NumberOfConstrainedCoordinates() throw(Isis::IException);
static QString PointTypeToString(PointType type) throw(Isis::IException);
static PointType StringToPointType(QString pointTypeString) throw(Isis::IException);
QString GetPointTypeString() const throw(Isis::IException);
// PointType GetType() const throw(Isis::IException);
static QString RadiusSourceToString(RadiusSource::Source source) throw(Isis::IException);
static RadiusSource::Source StringToRadiusSource(QString str) throw(Isis::IException);
QString GetRadiusSourceString() const throw(Isis::IException);
static QString SurfacePointSourceToString(SurfacePointSource::Source source) throw(Isis::IException);
// static SurfacePointSource::Source StringToSurfacePointSource(QString str) throw(Isis::IException);
QString GetSurfacePointSourceString() const throw(Isis::IException);
// SurfacePoint GetAprioriSurfacePoint() const throw(Isis::IException);
// RadiusSource::Source GetAprioriRadiusSource() const throw(Isis::IException);
// QString GetAprioriRadiusSourceFile() const throw(Isis::IException);
// SurfacePointSource::Source GetAprioriSurfacePointSource() const throw(Isis::IException);
// QString GetAprioriSurfacePointSourceFile() const throw(Isis::IException);
int GetNumMeasures() const throw(Isis::IException);
int GetNumValidMeasures() const throw(Isis::IException);
int GetNumLockedMeasures() const throw(Isis::IException);
bool HasSerialNumber(QString serialNumber) const throw(Isis::IException);
// int IndexOf(ControlMeasure *, bool throws = true) const throw(Isis::IException);
int IndexOf(QString sn, bool throws = true) const throw(Isis::IException);
int IndexOfRefMeasure() const throw(Isis::IException);
bool IsReferenceExplicit() const throw(Isis::IException);
QString GetReferenceSN() const throw(Isis::IException);
// Statistics GetStatistic(double(ControlMeasure::*statFunc)() const) const throw(Isis::IException);
// Statistics GetStatistic(long dataType) const throw(Isis::IException);
// QList< ControlMeasure * > getMeasures(bool excludeIgnored = false) const throw(Isis::IException);
// QList< QString > getCubeSerialNumbers() const throw(Isis::IException);
// const ControlMeasure *operator[](QString serialNumber) const throw(Isis::IException);
// ControlMeasure *operator[](QString serialNumber) throw(Isis::IException);
// const ControlMeasure *operator[](int index) const throw(Isis::IException);
// ControlMeasure *operator[](int index) throw(Isis::IException);
// bool operator!=(const ControlPoint &pPoint) const throw(Isis::IException);
// bool operator==(const ControlPoint &pPoint) const throw(Isis::IException);
// const ControlPoint &operator=(const ControlPoint &pPoint) throw(Isis::IException);
// The next 7 methods are specifically to support BundleAdjust
void ZeroNumberOfRejectedMeasures() throw(Isis::IException);
void SetNumberOfRejectedMeasures(int numRejected) throw(Isis::IException);
int GetNumberOfRejectedMeasures() const throw(Isis::IException);
double GetSampleResidualRms() const throw(Isis::IException);
double GetLineResidualRms() const throw(Isis::IException);
double GetResidualRms() const throw(Isis::IException);
void ClearJigsawRejected() throw(Isis::IException);
// ControlPointFileEntryV0002 ToFileEntry() const throw(Isis::IException);
private:
// void SetExplicitReference(ControlMeasure *measure) throw(Isis::IException);
void ValidateMeasure(QString serialNumber) const throw(Isis::IException);
// void AddMeasure(ControlMeasure *measure) throw(Isis::IException);
void PointModified() throw(Isis::IException);
// private:
// ControlNet *parentNetwork;
//
// //!< List of Control Measures
// QHash< QString, ControlMeasure * > * measures;
//
// QStringList *cubeSerials;
//
// ControlMeasure *referenceMeasure;
//
// /**
// * This is the control point ID. This is supposed to be a unique
// * identifier for control points. This often has a number in it, and
// * looks like "T0052" where the next one is "T0053" and so on.
// */
// QString id;
//
// /**
// * This is the user name of the person who last modified this control
// * point. Modifications are things like updating the surface point, but
// * not things like updating the last modified time. The calculations
// * relating to this control point have to actually change for this to
// * be updated. This is an empty string if we need to dynamically
// * get the username of the caller when asked for (or written to file).
// */
// QString chooserName;
//
// /**
// * This is the last modified date and time. This is updated automatically
// * and works virtually in the same way as chooserName.
// */
// QString dateTime;
//
// /**
// * What this control point is tying together.
// * @see PointType
// */
// PointType type;
//
// /**
// * If we forced a build that we would normally have thrown an exception
// * for then this is set to true. Otherwise, and most of the time, this
// * is false.
// */
// bool invalid;
//
// /**
// * This stores the edit lock state.
// * @see SetEditLock
// */
// bool editLock;
//
// /**
// * This stores the jigsaw rejected state.
// * @see SetJigsawReject
// */
// bool jigsawRejected;
//
// /**
// * This stores the constraint status of the a priori SurfacePoint
// * @todo Eventually add x, y, and z
// */
// std::bitset<6> constraintStatus;
//
// /**
// * This indicates if a program has explicitely set the reference in this
// * point or the implicit reference is still the current reference. This
// * is useful for programs that want to choose the reference for all
// * points where this hasn't happened yet.
// */
// bool referenceExplicitlySet;
//
// /**
// * True if we should preserve but ignore the entire control point and its
// * measures.
// */
// bool ignore;
//
// //! Where the apriori surface point originated from
// SurfacePointSource::Source aprioriSurfacePointSource;
//
// //! FileName where the apriori surface point originated from
// QString aprioriSurfacePointSourceFile;
//
// /**
// * Where the apriori surface point's radius originated from, most commonly
// * used by jigsaw.
// */
// RadiusSource::Source aprioriRadiusSource;
//
// /**
// * The name of the file that derives the apriori surface point's radius
// */
// QString aprioriRadiusSourceFile;
//
// /**
// * The apriori surface point. This is the "known truth" or trustworthy
// * point that should not be modified unless done very explicitely. This
// * comes from places like hand picking where you really don't want the
// * surface point to vary far from this point, but some variation is
// * okay (1/10th of a pixel is fair for human accuracy for example). Very
// * often this point does not exist.
// */
// SurfacePoint aprioriSurfacePoint;
//
// /**
// * This is the calculated, or aposterori, surface point. This is what most
// * programs should be working with and updating.
// */
// SurfacePoint adjustedSurfacePoint;
//
// /**
// * This parameter is used and maintained by BundleAdjust for the jigsaw
// * application. It is stored here because ControlPoint contains the index
// * of the measures.
// */
// int numberOfRejectedMeasures;
};
};
namespace Isis {
class MaximumLikelihoodWFunctions {
%TypeHeaderCode
#include "MaximumLikelihoodWFunctions.h"
%End
public:
enum Model {
Huber,
HuberModified,
Welsch,
Chen
};
static QString modelToString(Model model) throw(Isis::IException);
static Isis::MaximumLikelihoodWFunctions::Model stringToModel(QString modelName) throw(Isis::IException);
MaximumLikelihoodWFunctions() throw(Isis::IException);
MaximumLikelihoodWFunctions(Model modelSelection) throw(Isis::IException);
MaximumLikelihoodWFunctions(Model modelSelection, double tweakingConstant) throw(Isis::IException);
MaximumLikelihoodWFunctions(const Isis::MaximumLikelihoodWFunctions &other) throw(Isis::IException);
void setModel(Model modelSelection) throw(Isis::IException); // uses default tweaking constant
void setTweakingConstantDefault() throw(Isis::IException);
void setModel(Model modelSelection, double tweakingConstant) throw(Isis::IException);
void setTweakingConstant(double tweakingConstant) throw(Isis::IException);
Model model() const throw(Isis::IException);
double tweakingConstant() const throw(Isis::IException);
// the W functions provide an additional weighting factor W which is used
// to 're-weight' each observation dynamically during an adjustment, the
// scalar functions provide access to various flavors of this scalar (as
// a function of the residual divided by the residuals sigma)
double sqrtWeightScaler(double residualZScore) throw(Isis::IException); //it is often convient to use square roots of
//weights when building normals, this function
// provides the scaler for the square root of
// the weight directly
double tweakingConstantQuantile() throw(Isis::IException); // returns which quantile of the residuals is recommended to
// use as the tweaking constant, this varies as a function of
// the model being employed
QString weightedResidualCutoff() throw(Isis::IException);
QDataStream &write(QDataStream &stream) const throw(Isis::IException);
QDataStream &read(QDataStream &stream) throw(Isis::IException);
};
};
namespace Isis {
class Statistics : public QObject {
%TypeHeaderCode
#include "Statistics.h"
%End
public:
Statistics(const Isis::Statistics &other) throw(Isis::IException);
void Reset() throw(Isis::IException);
void AddData(const double *data, const unsigned int count) throw(Isis::IException);
void AddData(const double data) throw(Isis::IException);
void RemoveData(const double *data, const unsigned int count) throw(Isis::IException);
void RemoveData(const double data) throw(Isis::IException);
double ValidMinimum() const throw(Isis::IException);
double ValidMaximum() const throw(Isis::IException);
bool InRange(const double value) throw(Isis::IException);
bool AboveRange(const double value) throw(Isis::IException);
bool BelowRange(const double value) throw(Isis::IException);
double Average() const throw(Isis::IException);
double StandardDeviation() const throw(Isis::IException);
double Variance() const throw(Isis::IException);
double Sum() const throw(Isis::IException);
double SumSquare() const throw(Isis::IException);
double Rms() const throw(Isis::IException);
double Minimum() const throw(Isis::IException);
double Maximum() const throw(Isis::IException);
double ChebyshevMinimum(const double percent = 99.5) const throw(Isis::IException);
double ChebyshevMaximum(const double percent = 99.5) const throw(Isis::IException);
double BestMinimum(const double percent = 99.5) const throw(Isis::IException);
double BestMaximum(const double percent = 99.5) const throw(Isis::IException);
double ZScore(const double value) const throw(Isis::IException);
bool RemovedData() const throw(Isis::IException);
};
};
%Module(name=libisispy,
version=0,
keyword_arguments="Optional")
%ExportedHeaderCode
#include <glob.h>
#include <iostream>
#include <QLibrary>
#include <QString>
#include <QFileInfo>
using namespace std;
// Wraps glob to return a STD vector to avoid dealing with C style globbing
inline vector<QString> glob(const QString& pat){
glob_t glob_result;
glob(pat.toLatin1().data(),GLOB_TILDE,NULL,&glob_result);
vector<QString> ret;
for(unsigned int i=0;i<glob_result.gl_pathc;++i){
ret.push_back(QString(glob_result.gl_pathv[i]));
}
globfree(&glob_result);
return ret;
}
// Loads library files which match the given regex.
// All files matching regex are piped into QLibrary and Loaded.
//
// If verbose = true, it wil print every file followed by OK or FAILED
// which indicates a successful load. If unsuccessful, it also prints
// an error message for context.
inline void load_libs(const QString& pat, bool verbose=false) {
vector<QString> libs = glob(pat);
QLibrary lib_loader;
for (vector<QString>::const_iterator i = libs.begin(); i != libs.end(); ++i) {
// Strip extension
QFileInfo file(*i);
QString lib_dir = file.path() + "/" + file.completeBaseName();
lib_loader.setFileName(lib_dir);
// Load hint required for symbols to be accessible to other libraries loaded later
lib_loader.setLoadHints(QLibrary::ExportExternalSymbolsHint);
bool load_ok = lib_loader.load();
// if verbose is true, print out load info
if (verbose) {
if (load_ok) {
cout << "Loaded " + lib_dir.toStdString() + " : OK" << endl;
}
else if (!load_ok) {
cout << "Loaded " + lib_dir.toStdString() + " : FAILED" << endl
<< lib_loader.errorString().toStdString() << endl;
}
}
}
}
%End
%Include type_conversions.sip
%Include ControlPoint.sip
%Include BundleMeasure.sip
%Include BundleControlPoint.sip
%Include BundleImage.sip
%Include ControlNet.sip
%Include Statistics.sip
%Include BundleResults.sip
%Include BundleSolutionInfo.sip
%Include BundleObservationSolveSettings.sip
%Include BundleSettings.sip
%Include BundleAdjust.sip
%Include MaximumLikelihoodWFunctions.sip
%Import QtCore/QtCoremod.sip
%Import QtXml/QtXmlmod.sip
%Exception Isis::IException(SIP_Exception) /PyName=IException/
{
%TypeHeaderCode
#include "IException.h"
%End
%RaiseCode
const char *detail = sipExceptionRef.what();
SIP_BLOCK_THREADS
PyErr_SetString(sipException_Isis_IException, detail);
SIP_UNBLOCK_THREADS
%End
};
%MappedType QVector<QSharedPointer<Isis::BundleControlPoint> >
{
%TypeHeaderCode
#include "BundleControlPoint.h"
#include <QList>
%End
%ConvertFromTypeCode
size_t size = sipCpp->size();
PyObject *l = PyList_New(size);
for (size_t i = 0; i < size; ++i) {
Isis::BundleControlPoint* cppCPoint = sipCpp->at(i).data();
PyObject *pyCPoint = sipConvertFromType((void*)(cppCPoint), sipType_Isis_BundleControlPoint, NULL);
PyList_SetItem(l, i, pyCPoint);
}
return l;
%End
%ConvertToTypeCode
Py_ssize_t size = PyList_Size(sipPy);
QVector<QSharedPointer<Isis::BundleControlPoint> > *cppPointList = new QVector<QSharedPointer<Isis::BundleControlPoint> > ();
int sipErr = 0;
for(int i = 0; i < size; i++) {
PyObject *pyCPoint = PyList_GET_ITEM(sipPy, i);
Isis::BundleControlPoint *cppCPoint = (Isis::BundleControlPoint*)sipConvertToType(pyCPoint, sipType_Isis_BundleControlPoint, NULL, SIP_NOT_NONE, NULL, &sipErr);
cppPointList->append(QSharedPointer<Isis::BundleControlPoint>(cppCPoint));
}
*sipCppPtr = cppPointList;
return sipGetState(sipTransferObj);
%End
};
%MappedType QList<Isis::Statistics>
{
%TypeHeaderCode
#include "Statistics.h"
#include <QList>
%End
%ConvertFromTypeCode
size_t size = sipCpp->size();
PyObject *l = PyList_New(size);
for (size_t i = 0; i < size; ++i) {
Isis::Statistics* cppStats = new Isis::Statistics(sipCpp->at(i));
PyObject *pyStats = sipConvertFromType((void*)(cppStats), sipType_Isis_Statistics, NULL);
PyList_SetItem(l, i, pyStats);
}
return l;
%End
%ConvertToTypeCode
Py_ssize_t size = PyList_Size(sipPy);
QList<Isis::Statistics> *cppStatList = new QList<Isis::Statistics>();
int sipErr = 0;
for(int i = 0; i < size; i++) {
PyObject *pyStat = PyList_GET_ITEM(sipPy, i);
Isis::Statistics *stats = (Isis::Statistics*)sipConvertToType(pyStat, sipType_Isis_Statistics, NULL, SIP_NOT_NONE, NULL, &sipErr);
cppStatList->append(*stats);
}
*sipCppPtr = cppStatList;
return sipGetState(sipTransferObj);
%End
};
%MappedType QList<Isis::BundleObservationSolveSettings>
{
%TypeHeaderCode
#include "BundleObservationSolveSettings.h"
#include <QList>
%End
%ConvertFromTypeCode
PyObject *l;
// Create the Python list of the correct length.
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;
for (int i = 0; i < sipCpp->size(); ++i) {
Isis::BundleObservationSolveSettings *settings = new Isis::BundleObservationSolveSettings(sipCpp->at(i));
PyObject *pySettings = sipConvertFromType((void*)(settings), sipType_Isis_BundleObservationSolveSettings, NULL);
PyList_SetItem(l, i, pySettings);
}
return l;
%End
%ConvertToTypeCode
if (!sipIsErr) {
if (!PyList_Check(sipPy))
return 0;
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
if (!sipCanConvertToType(PyList_GET_ITEM(sipPy, i),
sipType_Isis_BundleObservationSolveSettings, SIP_NOT_NONE))
return 0;
return 1;
}
Py_ssize_t size = PyList_Size(sipPy);
QList<Isis::BundleObservationSolveSettings> *cppSettingsList = new QList<Isis::BundleObservationSolveSettings>();
int state;
for(Py_ssize_t i = 0; i < size; i++) {
PyObject *pySettings = PyList_GET_ITEM(sipPy, i);
Isis::BundleObservationSolveSettings *settings;
settings = (Isis::BundleObservationSolveSettings*)sipConvertToType(pySettings, sipType_Isis_BundleObservationSolveSettings, 0, SIP_NOT_NONE, &state, sipIsErr);
if (*sipIsErr) {
sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state);
delete cppSettingsList;
return 0;
}
cppSettingsList->append(*settings);
sipReleaseType(pySettings, sipType_Isis_BundleObservationSolveSettings, state);
}
*sipCppPtr = cppSettingsList;
return sipGetState(sipTransferObj);
%End
};
// convert Bundlesettings wrapped in a QSharedPointer in Isis
%MappedType QSharedPointer<Isis::BundleImage>
{
%TypeHeaderCode
#include "BundleImage.h"
#include <QSharedPointer>
%End
%ConvertFromTypeCode
Isis::BundleImage *cpp = sipCpp->data();
PyObject *py = sipConvertFromType(cpp, sipType_Isis_BundleImage, NULL);
return py;
%End
%ConvertToTypeCode
int sipErr = 0;
QSharedPointer<Isis::BundleImage>* cpp_qsp = new QSharedPointer<Isis::BundleImage>();
Isis::BundleImage *cpp = (Isis::BundleImage*)sipConvertToType(sipPy, sipType_Isis_BundleImage, NULL, SIP_NOT_NONE, NULL, &sipErr);
cpp_qsp->reset(cpp);
*sipCppPtr = cpp_qsp;
return sipGetState(sipTransferObj);
%End
};
// convert Bundlesettings wrapped in a QSharedPointer in Isis
%MappedType QSharedPointer<Isis::BundleSettings>
{
%TypeHeaderCode
#include "BundleSettings.h"
#include <QSharedPointer>
using namespace std;
%End
%ConvertFromTypeCode
Isis::BundleSettings *settings = sipCpp->data();
PyObject *pySettings = sipConvertFromType(settings, sipType_Isis_BundleSettings, NULL);
return pySettings;
%End
%ConvertToTypeCode
int sipErr = 0;
QSharedPointer<Isis::BundleSettings>* wrappedSettings = new QSharedPointer<Isis::BundleSettings>();
Isis::BundleSettings *settings = (BundleSettings*) sipConvertToType(sipPy, sipType_Isis_BundleSettings, NULL, SIP_NOT_NONE, NULL, &sipErr);
wrappedSettings->reset(settings);
*sipCppPtr = wrappedSettings;
return sipGetState(sipTransferObj);
%End
};
// convert Bundlesettings wrapped in a QSharedPointer in Isis
%MappedType QSharedPointer<Isis::ControlNet>
{
%TypeHeaderCode
#include "ControlNet.h"
#include <QSharedPointer>
using namespace std;
%End
%ConvertFromTypeCode
PyObject *pySettings = sipConvertFromType(sipCpp, sipType_Isis_ControlNet, NULL);
return pySettings;
%End
%ConvertToTypeCode
int sipErr = 0;
QSharedPointer<Isis::ControlNet> *qspControlNet = NULL;
if (!sipCanConvertToType(sipPy, sipType_Isis_ControlNet, SIP_NOT_NONE)) {
sipErr = 1;
}
else {
Isis::ControlNet *cppControlNet = (Isis::ControlNet*)sipConvertToType(sipPy, sipType_Isis_ControlNet, NULL, SIP_NOT_NONE, NULL, &sipErr);
qspControlNet->reset(cppControlNet);
}
*sipCppPtr = qspControlNet;
return sipGetState(sipTransferObj);
%End
};
// Convert a python str object to a std::string.
%MappedType std::string
{
%TypeHeaderCode
#include <string>
%End
%ConvertFromTypeCode
// convert an std::string to a Python (unicode) string
PyObject* newstring;
newstring = PyUnicode_DecodeUTF8(sipCpp->c_str(), sipCpp->length(), NULL);
if(newstring == NULL) {
PyErr_Clear();
newstring = PyBytes_FromString(sipCpp->c_str());
}
return newstring;
%End
%ConvertToTypeCode
// Allow a Python string (or a unicode string) whenever a string is
// expected.
// If argument is a Unicode string, just decode it to UTF-8
// If argument is a Python string, assume it's UTF-8
if (sipIsErr == NULL)
return (PyBytes_Check(sipPy) || PyUnicode_Check(sipPy));
if (sipPy == Py_None)
{
*sipCppPtr = new std::string;
return 1;
}
if (PyUnicode_Check(sipPy))
{
PyObject* s = PyUnicode_AsEncodedString(sipPy, "UTF-8", "");
*sipCppPtr = new std::string(PyBytes_AS_STRING(s));
Py_DECREF(s);
return 1;
}
if (PyBytes_Check(sipPy))
{
*sipCppPtr = new std::string(PyBytes_AS_STRING(sipPy));
return 1;
}
return 0;
%End
};
......@@ -18,8 +18,31 @@
</p>
<p>
Information about the CSM model will also be added to the CsmInfo group on
the cube label. These are just for users to reference and are not used
programmatically.
the cube label. The group includes names, units, and types for model
parameters.
</p>
<pre>
Group = CsmInfo
CSMPlatformID = Mars_Reconnaissance_Orbiter
CSMInstrumentId = "CONTEXT CAMERA"
ReferenceTime = 2014-05-21T15:48:56Z
ModelParameterNames = ("IT Pos. Bias ", "CT Pos. Bias ",
"Rad Pos. Bias ", "IT Vel. Bias ",
"CT Vel. Bias ", "Rad Vel. Bias ",
"Omega Bias ", "Phi Bias ",
"Kappa Bias ", "Omega Rate ",
"Phi Rate ", "Kappa Rate ",
"Omega Accl ", "Phi Accl ",
"Kappa Accl ", "Focal Bias ")
ModelParameterUnits = (m, m, m, m, m, m, m, m, m, m, m, m, m, m, m, m)
ModelParameterTypes = (REAL, REAL, REAL, REAL, REAL, REAL, REAL, REAL,
REAL, REAL, REAL, REAL, REAL, REAL, REAL, REAL)
End_Group
</pre>
<p>
The ModelParameter keywords contain information that can be used
when running jigsaw. This information is unique for each model. For
more detail, see the CSMSOLVELIST parameter in the jigsaw documentation.
</p>
<p>
This program can be run on any Cube file, but if the Cube has spice data
......@@ -148,4 +171,17 @@
</parameter>
</group>
</groups>
<example>
<brief>Simple csminit Example</brief>
<description>
This example uses a calibrated MRO CTX image and an isd generated using ALE or Abstraction Layer for Ephemerides.
</description>
<terminalInterface>
<commandLine> csminit from= F02_036648_2021_XN_22N022W.cal.csm.cub isd= F02_036648_2021_XN_22N022W.cal.csm.json
</commandLine>
<description>
Simple csminit example
</description>
</terminalInterface>
</example>
</application>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment