Skip to content

Commit

Permalink
Moved logic around a bit for cameraPointInfo allowError option (#5474)
Browse files Browse the repository at this point in the history
  • Loading branch information
acpaquette authored Apr 19, 2024
1 parent 58dc946 commit 668181b
Showing 1 changed file with 13 additions and 16 deletions.
29 changes: 13 additions & 16 deletions isis/src/base/objs/CameraPointInfo/CameraPointInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -349,23 +349,21 @@ namespace Isis {
}

if (!noErrors) {
if (!allowErrors) {
for (int i = 0; i < gp->keywords(); i++) {
QString name = (*gp)[i].name();
// These three keywords have 3 values, so they must have 3 NULLs
if (name == "BodyFixedCoordinate" || name == "SpacecraftPosition" ||
name == "SunPosition") {
(*gp)[i].addValue("NULL");
(*gp)[i].addValue("NULL");
(*gp)[i].addValue("NULL");
}
else {
(*gp)[i].setValue("NULL");
}
for (int i = 0; i < gp->keywords(); i++) {
QString name = (*gp)[i].name();
// These three keywords have 3 values, so they must have 3 NULLs
if (name == "BodyFixedCoordinate" || name == "SpacecraftPosition" ||
name == "SunPosition") {
(*gp)[i].addValue("NULL");
(*gp)[i].addValue("NULL");
(*gp)[i].addValue("NULL");
}
else {
(*gp)[i].setValue("NULL");
}
}
else {
double pB[3], spB[3], sB[3];
if (!allowErrors) {
double spB[3], sB[3];

m_camera->instrumentPosition(spB);
gp->findKeyword("SpacecraftPosition").addValue(toString(spB[0]), "km");
Expand Down Expand Up @@ -413,7 +411,6 @@ namespace Isis {
gp->findKeyword("LookDirectionCamera").addValue("Null");
gp->findKeyword("LookDirectionCamera").addValue("Null");
}

}

// Set all keywords that still have valid information
Expand Down

0 comments on commit 668181b

Please sign in to comment.