65 m_pm = target->pmCoefs();
209 Angle aprioriVelocityPoleRA,
210 Angle sigmaVelocityPoleRA,
212 Angle aprioriVelocityPoleDec,
213 Angle sigmaVelocityPoleDec,
215 Angle aprioriVelocityPM,
216 Angle sigmaVelocityPM,
239 m_raPole[1] = aprioriVelocityPoleRA;
245 m_pm[1] = aprioriVelocityPM;
255 if (sigmaPoleRA.
degrees() > 0.0) {
268 m_raPole[1] = aprioriVelocityPoleRA;
270 if (sigmaVelocityPoleRA.
degrees() > 0.0) {
289 if (sigmaPoleDec.
degrees() > 0.0) {
303 if (sigmaVelocityPoleDec.
degrees() > 0.0) {
336 m_pm[1] = aprioriVelocityPM;
338 if (sigmaVelocityPM.
degrees() > 0.0) {
575 QString msg =
"In BundleTargetBody::applyParameterCorrections: " 576 "correction and m_targetParameter vectors sizes don't match.\n";
595 case AccelerationPoleRA:
601 case VelocityPoleDec:
604 case AccelerationPoleDec:
616 case TriaxialRadiusA:
618 double c =
m_radii[0].kilometers();
619 double d = c + corrections[n];
624 case TriaxialRadiusB:
626 double c =
m_radii[1].kilometers();
627 double d = c + corrections[n];
632 case TriaxialRadiusC:
634 double c =
m_radii[2].kilometers();
635 double d = c + corrections[n];
643 double d = c + corrections[n];
658 QString msg =
"Unable to apply parameter corrections to BundleTargetBody.";
675 if (method.compare(
"NONE", Qt::CaseInsensitive) == 0) {
678 else if (method.compare(
"MEAN", Qt::CaseInsensitive) == 0) {
681 else if (method.compare(
"ALL", Qt::CaseInsensitive) == 0) {
686 "Unknown target body radius solution method [" + method +
"].",
704 else if (method ==
Mean)
706 else if (method ==
All)
709 "Unknown target body radius solve method enum [" +
toString(method) +
"].",
900 QString msg =
"The triaxial radii can only be accessed when solving for triaxial radii.";
917 QString msg =
"The mean radius can only be accessed when solving for mean radius.";
940 for (
int i = 0; i < nParameters; i++) {
961 std::vector<double> finalParameterValues;
964 int nAngleParameters = 0;
965 int nRadiusParameters = 0;
967 finalParameterValues.push_back(
m_raPole[0].degrees());
968 parameterNamesList.append( str.arg(
"POLE RA ") );
972 finalParameterValues.push_back(
m_raPole[1].degrees());
973 parameterNamesList.append( str.arg(
"POLE RAv ") );
977 finalParameterValues.push_back(
m_raPole[2].degrees());
978 parameterNamesList.append( str.arg(
"POLE RAa ") );
982 finalParameterValues.push_back(
m_decPole[0].degrees());
983 parameterNamesList.append( str.arg(
"POLE DEC ") );
987 finalParameterValues.push_back(
m_decPole[1].degrees());
988 parameterNamesList.append( str.arg(
"POLE DECv ") );
992 finalParameterValues.push_back(
m_decPole[2].degrees());
993 parameterNamesList.append( str.arg(
"POLE DECa ") );
997 finalParameterValues.push_back(
m_pm[0].degrees());
998 parameterNamesList.append( str.arg(
" PM ") );
1002 finalParameterValues.push_back(
m_pm[1].degrees());
1003 parameterNamesList.append( str.arg(
" PMv ") );
1007 finalParameterValues.push_back(
m_pm[2].degrees());
1008 parameterNamesList.append( str.arg(
" PMa ") );
1012 finalParameterValues.push_back(
m_radii[0].kilometers());
1013 finalParameterValues.push_back(
m_radii[1].kilometers());
1014 finalParameterValues.push_back(
m_radii[2].kilometers());
1015 parameterNamesList.append( str.arg(
" RadiusA ") );
1016 parameterNamesList.append( str.arg(
" RadiusB ") );
1017 parameterNamesList.append( str.arg(
" RadiusC ") );
1018 nRadiusParameters += 3;
1022 parameterNamesList.append( str.arg(
"MeanRadius ") );
1023 nRadiusParameters++;
1026 int nParameters = nAngleParameters + nRadiusParameters;
1029 QString finalqStr =
"";
1034 for (
int i = 0; i < nAngleParameters; i++) {
1041 if (errorPropagation) {
1043 qStr = QString(
"%1%2%3%4%5%6\n").
1044 arg( parameterNamesList.at(i) ).
1045 arg(finalParameterValues[i] - corr_temp.
degrees(), 17,
'f', 8).
1046 arg(corr_temp.
degrees(), 21,
'f', 8).
1047 arg(finalParameterValues[i], 20,
'f', 8).
1053 qStr = QString(
"%1%2%3%4%5%6\n").
1054 arg( parameterNamesList.at(i) ).
1055 arg(finalParameterValues[i] - corr_temp.
degrees(), 17,
'f', 8).
1056 arg(corr_temp.
degrees(), 21,
'f', 8).
1057 arg(finalParameterValues[i], 20,
'f', 8).
1064 for (
int i = nAngleParameters; i < nParameters; i++) {
1071 if (errorPropagation) {
1072 double d1 = finalParameterValues[i];
1074 qStr = QString(
"%1%2%3%4%5%6\n").
1075 arg( parameterNamesList.at(i) ).
1076 arg(d1 - d2, 17,
'f', 8).
1077 arg(d2, 21,
'f', 8).
1078 arg(d1, 20,
'f', 8).
1083 double d1 = finalParameterValues[i];
1085 qStr = QString(
"%1%2%3%4%5%6\n").
1086 arg( parameterNamesList.at(i) ).
1087 arg(d1 - d2, 17,
'f', 8).
1088 arg(d2, 21,
'f', 8).
1089 arg(d1, 20,
'f', 8).
1183 std::set<int> targetParameterSolveCodes;
1186 if (g->hasKeyword(
"Ra")) {
1188 str = g->findKeyword(
"Ra")[0];
1191 QString msg =
"Ra must be given as none, position, velocity, or acceleration";
1194 if (str ==
"position") {
1195 targetParameterSolveCodes.insert(BundleTargetBody::PoleRA);
1197 else if (str ==
"velocity") {
1198 targetParameterSolveCodes.insert(BundleTargetBody::PoleRA);
1199 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleRA);
1201 else if (str ==
"acceleration") {
1202 targetParameterSolveCodes.insert(BundleTargetBody::PoleRA);
1203 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleRA);
1204 targetParameterSolveCodes.insert(BundleTargetBody::AccelerationPoleRA);
1208 if (g->hasKeyword(
"Dec")) {
1210 str = g->findKeyword(
"Dec")[0];
1213 QString msg =
"Dec must be given as none, position, velocity, or acceleration";
1216 if (str ==
"position") {
1217 targetParameterSolveCodes.insert(BundleTargetBody::PoleDec);
1219 else if (str ==
"velocity") {
1220 targetParameterSolveCodes.insert(BundleTargetBody::PoleDec);
1221 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleDec);
1223 else if (str ==
"acceleration") {
1224 targetParameterSolveCodes.insert(BundleTargetBody::PoleDec);
1225 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPoleDec);
1226 targetParameterSolveCodes.insert(BundleTargetBody::AccelerationPoleDec);
1230 if (g->hasKeyword(
"Pm")) {
1232 str = g->findKeyword(
"Pm")[0];
1235 QString msg =
"Pm must be given as none, position, velocity, or acceleration";
1238 if (str ==
"position") {
1239 targetParameterSolveCodes.insert(BundleTargetBody::PM);
1241 else if (str ==
"velocity") {
1242 targetParameterSolveCodes.insert(BundleTargetBody::PM);
1243 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPM);
1245 else if (str ==
"acceleration") {
1246 targetParameterSolveCodes.insert(BundleTargetBody::PM);
1247 targetParameterSolveCodes.insert(BundleTargetBody::VelocityPM);
1248 targetParameterSolveCodes.insert(BundleTargetBody::AccelerationPM);
1252 if (g->hasKeyword(
"RadiiSolveOption")) {
1254 str = g->findKeyword(
"RadiiSolveOption")[0];
1257 QString msg =
"RadiiSolveOption must be given as none, triaxial, or mean";
1260 if (str ==
"triaxial") {
1261 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusA);
1262 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusB);
1263 targetParameterSolveCodes.insert(BundleTargetBody::TriaxialRadiusC);
1264 solveRadiiMethod =
All;
1266 else if (str ==
"mean") {
1267 targetParameterSolveCodes.insert(BundleTargetBody::MeanRadius);
1268 solveRadiiMethod =
Mean;
1271 solveRadiiMethod =
None;
1275 Angle aprioriPoleRA;
1277 Angle aprioriVelocityPoleRA;
1278 Angle poleRAVelocitySigma;
1279 Angle aprioriAccelerationPoleRA;
1280 Angle poleRAAccelerationSigma;
1281 Angle aprioriPoleDec;
1283 Angle aprioriVelocityPoleDec;
1284 Angle sigmaVelocityPoleDec;
1285 Angle aprioriAccelerationPoleDec;
1286 Angle sigmaAccelerationPoleDec;
1289 Angle aprioriVelocityPM;
1290 Angle sigmaVelocityPM;
1291 Angle aprioriAccelerationPM;
1292 Angle pmAccelerationSigma;
1305 if (g->hasKeyword(
"RaValue")) {
1307 d = (double)(g->findKeyword(
"RaValue"));
1310 QString msg =
"RaValue must be a valid double (>= 0; blank defaults to 0).";
1316 if (g->hasKeyword(
"RaSigma")) {
1318 d = (double)(g->findKeyword(
"RaSigma"));
1321 QString msg =
"RaSigma must be a valid double (>= 0; blank defaults to 0).";
1327 if (g->hasKeyword(
"RaVelocityValue")) {
1329 d = (double)(g->findKeyword(
"RaVelocityValue"));
1332 QString msg =
"RaVelocityValue must be a valid double (>= 0; blank defaults to 0).";
1338 if (g->hasKeyword(
"RaVelocitySigma")) {
1340 d = (double)(g->findKeyword(
"RaVelocitySigma"));
1343 QString msg =
"RaVelocitySigma must be a valid double (>= 0; blank defaults to 0).";
1349 if (g->hasKeyword(
"RaAccelerationValue")) {
1351 d = (double)(g->findKeyword(
"RaAccelerationValue"));
1354 QString msg =
"RaAccelerationValue must be a valid double (>= 0; blank defaults to 0).";
1360 if (g->hasKeyword(
"RaAccelerationSigma")) {
1362 d = (double)(g->findKeyword(
"RaAccelerationSigma"));
1365 QString msg =
"RaAccelerationSigma must be a valid double (>= 0; blank defaults to 0).";
1371 if (g->hasKeyword(
"DecValue")) {
1373 d = (double)(g->findKeyword(
"DecValue"));
1376 QString msg =
"DecValue must be a valid double (>= 0; blank defaults to 0).";
1382 if (g->hasKeyword(
"DecSigma")) {
1384 d = (double)(g->findKeyword(
"DecSigma"));
1387 QString msg =
"DecSigma must be a valid double (>= 0; blank defaults to 0).";
1393 if (g->hasKeyword(
"DecVelocityValue")) {
1395 d = (double)(g->findKeyword(
"DecVelocityValue"));
1398 QString msg =
"DecVelocityValue must be a valid double (>= 0; blank defaults to 0).";
1404 if (g->hasKeyword(
"DecVelocitySigma")) {
1406 d = (double)(g->findKeyword(
"DecVelocitySigma"));
1409 QString msg =
"DecVelocitySigma must be a valid double (>= 0; blank defaults to 0).";
1415 if (g->hasKeyword(
"DecAccelerationValue")) {
1417 d = (double)(g->findKeyword(
"DecAccelerationValue"));
1420 QString msg =
"DecAccelerationValue must be a valid double (>= 0; blank defaults to 0).";
1426 if (g->hasKeyword(
"DecAccelerationSigma")) {
1428 d = (double)(g->findKeyword(
"DecAccelerationSigma"));
1431 QString msg =
"DecAccelerationSigma must be a valid double (>= 0; blank defaults to 0).";
1437 if (g->hasKeyword(
"PmValue")) {
1439 d = (double)(g->findKeyword(
"PmValue"));
1442 QString msg =
"PmValue must be a valid double (>= 0; blank defaults to 0).";
1448 if (g->hasKeyword(
"PmSigma")) {
1450 d = (double)(g->findKeyword(
"PmSigma"));
1453 QString msg =
"PmSigma must be a valid double (>= 0; blank defaults to 0).";
1460 if (g->hasKeyword(
"PmVelocityValue")) {
1462 d = (double)(g->findKeyword(
"PmVelocityValue"));
1465 QString msg =
"PmVelocityValue must be a valid double (>= 0; blank defaults to 0).";
1471 if (g->hasKeyword(
"PmVelocitySigma")) {
1473 d = (double)(g->findKeyword(
"PmVelocitySigma"));
1476 QString msg =
"PmVelocitySigma must be a valid double (>= 0; blank defaults to 0).";
1482 if (g->hasKeyword(
"PmAccelerationValue")) {
1484 d = (double)(g->findKeyword(
"PmAccelerationValue"));
1487 QString msg =
"PmAccelerationValue must be a valid double (>= 0; blank defaults to 0).";
1493 if (g->hasKeyword(
"PmAccelerationSigma")) {
1495 d = (double)(g->findKeyword(
"PmAccelerationSigma"));
1498 QString msg =
"PmAccelerationSigma must be a valid double (>= 0; blank defaults to 0).";
1504 if (g->hasKeyword(
"RadiusAValue")) {
1506 d = (double)(g->findKeyword(
"RadiusAValue"));
1509 QString msg =
"RadiusAValue must be a valid double (blank defaults to 0).";
1516 QString msg =
"RadiusAValue must be >= 0.";
1521 if (g->hasKeyword(
"RadiusASigma")) {
1523 d = (double)(g->findKeyword(
"RadiusASigma"));
1526 QString msg =
"RadiusASigma must be a valid double (blank defaults to 0).";
1533 QString msg =
"RadiusASigma must be >= 0.";
1538 if (g->hasKeyword(
"RadiusBValue")) {
1540 d = (double)(g->findKeyword(
"RadiusBValue"));
1543 QString msg =
"RadiusBValue must be a valid double (blank defaults to 0).";
1550 QString msg =
"RadiusBValue must be >= 0.";
1555 if (g->hasKeyword(
"RadiusBSigma")) {
1557 d = (double)(g->findKeyword(
"RadiusBSigma"));
1560 QString msg =
"RadiusBSigma must be a valid double (blank defaults to 0).";
1567 QString msg =
"RadiusBSigma must be >= 0.";
1572 if (g->hasKeyword(
"RadiusCValue")) {
1574 d = (double)(g->findKeyword(
"RadiusCValue"));
1577 QString msg =
"RadiusCValue must be a valid double (blank defaults to 0).";
1584 QString msg =
"RadiusCValue must be >= 0.";
1589 if (g->hasKeyword(
"RadiusCSigma")) {
1591 d = (double)(g->findKeyword(
"RadiusCSigma"));
1594 QString msg =
"RadiusCSigma must be a valid double (blank defaults to 0).";
1601 QString msg =
"RadiusCSigma must be >= 0.";
1606 if (g->hasKeyword(
"MeanRadiusValue")) {
1608 d = (double)(g->findKeyword(
"MeanRadiusValue"));
1611 QString msg =
"MeanRadiusValue must be a valid double (blank defaults to 0).";
1618 QString msg =
"MeanRadiusValue must be >= 0.";
1623 if (g->hasKeyword(
"MeanRadiusSigma")) {
1625 d = (double)(g->findKeyword(
"MeanRadiusSigma"));
1628 QString msg =
"MeanRadiusSigma must be a valid double (blank defaults to 0).";
1635 QString msg =
"MeanRadiusSigma must be >= 0.";
1654 aprioriPoleRA, poleRASigma,
1655 aprioriVelocityPoleRA, poleRAVelocitySigma,
1656 aprioriPoleDec, poleDecSigma,
1657 aprioriVelocityPoleDec, sigmaVelocityPoleDec,
1659 aprioriVelocityPM, sigmaVelocityPM,
1661 aprioriRadiusA, sigmaRadiusA,
1662 aprioriRadiusB, sigmaRadiusB,
1663 aprioriRadiusC, sigmaRadiusC,
1664 aprioriMeanRadius, sigmaMeanRadius);
1685 QString msg =
"Local radius can only be found if triaxial radii were solved for.";
1689 double a =
m_radii[0].kilometers();
1690 double b =
m_radii[1].kilometers();
1691 double c =
m_radii[2].kilometers();
1696 double xyradius = a * b / sqrt(pow(b * cos(rlon), 2) +
1697 pow(a * sin(rlon), 2));
1698 const double &radius = xyradius * c / sqrt(pow(c * cos(rlat), 2) +
1699 pow(xyradius * sin(rlat), 2));
This class is used to represent a target body in a bundle and how to solve for it.
virtual bool solvePoleRAVelocity()
If the pole right ascension velocity will be solved for with this target body.
LinearAlgebra::Vector & aprioriSigmas()
Returns the vector of apriori parameters sigmas.
Distance m_aprioriRadiusC
Apriori Radius C.
Distance m_sigmaRadiusA
Apriori Radius A Sigma.
std::vector< Angle > m_decPole
pole dec quadratic polynomial coefficients
static QString targetRadiiOptionToString(TargetRadiiSolveMethod targetRadiiSolveMethod)
Converts a TargetRadiiSolveMethod to a QString.
Distance m_sigmaRadiusB
Apriori Radius B Sigma.
Distance m_aprioriRadiusB
Apriori Radius B.
Distance localRadius(const Latitude &lat, const Longitude &lon)
Gets the local radius for the given latitude/longitude coordinate.
QString formatBundleOutputString(bool errorPropagation)
Formats and returns the parameter values as a QString.
Distance m_aprioriMeanRadius
Apriori Mean Radius.
double radians() const
Convert an angle to a double.
PvlGroupIterator endGroup()
Returns the ending group index.
virtual bool solvePM()
If the prime meridian angle will be solved for with this target body.
Distance m_aprioriRadiusA
Apriori Radius A.
QStringList parameterList()
Returns a list of all the parameters being solved for as QStrings.
This class is designed to encapsulate the concept of a Latitude.
Distance meanRadius()
Returns the mean radius.
The distance is being specified in kilometers.
virtual bool solvePoleRA()
If the pole right ascension angle will be solved for with this target body.
Unless noted otherwise, the portions of Isis written by the USGS are public domain.
static TargetRadiiSolveMethod stringToTargetRadiiOption(QString option)
Converts a QString to a TargetRadiiSolveMethod.
Distance m_meanRadius
Adjusted mean radius value.
LinearAlgebra::Vector m_adjustedSigmas
Adjusted parameter sigmas.
bool readFromPvl(PvlObject &tbPvlObject)
Set bundle solve parameters for target body from a pvl file.
int numberRadiusParameters()
Returns the number of radius parameters being solved for.
QString toString(bool boolToConvert)
Global function to convert a boolean to a string.
LinearAlgebra::Vector m_corrections
Cumulative parameter corrections.
LinearAlgebra::Vector & parameterWeights()
Returns the vector of parameter weights.
virtual bool solvePoleDec()
If the pole declination angle will be solved for with this target body.
This error is for when a programmer made an API call that was illegal.
double kilometers() const
Get the distance in kilometers.
Distance measurement, usually in meters.
double degrees() const
Get the angle in units of Degrees.
std::vector< Angle > m_raPole
pole ra quadratic polynomial coefficients
LinearAlgebra::Vector & adjustedSigmas()
Returns the vector of adjusted parameters sigmas.
LinearAlgebra::Vector & parameterSolution()
Returns the vector of parameters solution.
Distance m_sigmaRadiusC
Apriori Radius C Sigma.
This class is designed to encapsulate the concept of a Longitude.
void applyParameterCorrections(LinearAlgebra::Vector corrections)
Applies a vector of corrections to the parameters for the target body.
boost::numeric::ublas::vector< double > Vector
Definition for an Isis::LinearAlgebra::Vector of doubles.
std::vector< Distance > m_radii
Adjusted triaxial radii values.
std::vector< Angle > m_pm
pole pm quadratic polynomial coefficients
virtual bool solvePMVelocity()
If the prime meridian velocity will be solved for with this target body.
Degrees are generally considered more human readable, 0-360 is one circle, however most math does not...
Distance m_sigmaMeanRadius
Apriori Mean Radius Sigma.
std::vector< Angle > pmCoefs()
Returns the coefficients of the prime meridian polynomial.
BundleTargetBody()
Creates an empty BundleTargetBody object.
#define _FILEINFO_
Macro for the filename and line number.
TargetRadiiSolveMethod
Enumeration that defines how to solve for target radii.
LinearAlgebra::Vector m_solution
Parameter solution vector.
A type of error that could only have occurred due to a mistake on the user's part (e...
A type of error that cannot be classified as any of the other error types.
virtual bool solvePoleRAAcceleration()
If the pole right ascension acceleration will be solved for with this target body.
BundleTargetBody & operator=(const BundleTargetBody &src)
Assignment operator.
void setSolveSettings(std::set< int > targetParameterSolveCodes, Angle aprioriPoleRA, Angle sigmaPoleRA, Angle aprioriVelocityPoleRA, Angle sigmaVelocityPoleRA, Angle aprioriPoleDec, Angle sigmaPoleDec, Angle aprioriVelocityPoleDec, Angle sigmaVelocityPoleDec, Angle aprioriPM, Angle sigmaPM, Angle aprioriVelocityPM, Angle sigmaVelocityPM, TargetRadiiSolveMethod solveRadiiMethod, Distance aprioriRadiusA, Distance sigmaRadiusA, Distance aprioriRadiusB, Distance sigmaRadiusB, Distance aprioriRadiusC, Distance sigmaRadiusC, Distance aprioriMeanRadius, Distance sigmaMeanRadius)
Sets the solve settings for the target body.
double vtpv()
Calculates and returns the weighted sum of the squares of the corrections.
This class is used to create and store valid Isis3 targets.
QStringList m_parameterNamesList
List of all target parameters.
Defines an angle and provides unit conversions.
QList< Isis::PvlGroup >::iterator PvlGroupIterator
The counter for groups.
LinearAlgebra::Vector m_aprioriSigmas
A priori parameter sigmas.
virtual bool solvePMAcceleration()
If the prime meridian acceleration will be solved for with this target body.
TargetRadiiSolveMethod m_solveTargetBodyRadiusMethod
Which radii will be solved for.
std::set< int > m_parameterSolveCodes
Target parameter solve codes.
virtual bool solvePoleDecVelocity()
If the pole declination velocity will be solved for with this target body.
Namespace for ISIS/Bullet specific routines.
virtual int numberParameters()
Returns the total number of parameters being solved for.
virtual bool solveMeanRadius()
If the mean radius will be solved for with this target body.
virtual bool solveTriaxialRadii()
If the triaxial radii will be solved for with this target body.
LinearAlgebra::Vector m_weights
Parameter weights.
The distance is being specified in meters.
virtual ~BundleTargetBody()
Destructor.
Radians are generally used in mathematical equations, 0-2*PI is one circle, however these are more di...
Contains Pvl Groups and Pvl Objects.
virtual bool solvePoleDecAcceleration()
If the pole declination acceleration will be solved for with this target body.
std::vector< Angle > poleRaCoefs()
Returns the coefficients of the right ascension polynomial.
LinearAlgebra::Vector & parameterCorrections()
Returns the vector of corrections applied to the parameters.
std::vector< Distance > radii()
Returns the radius values.
PvlGroupIterator beginGroup()
Returns the beginning group index.
std::vector< Distance > radii() const
Returns the radii of the body in km.
std::vector< Angle > poleDecCoefs()
Returns the coefficients of the declination polynomial.