Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jigsaw camsolveall #4078

Merged
merged 15 commits into from
Oct 27, 2020
1 change: 1 addition & 0 deletions isis/src/base/objs/Spice/Spice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,7 @@ namespace Isis {
m_usingAle = true;
}
catch(...) {

// Backup to stadnard ISIS implementation
if (noTables) {
load(kernels["TargetPosition"], noTables);
Expand Down
8 changes: 6 additions & 2 deletions isis/src/control/objs/BundleAdjust/BundleAdjust.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3062,9 +3062,13 @@ namespace Isis {
std::ostringstream ostr;
ostr << summaryGroup << std::endl;
m_iterationSummary += QString::fromStdString( ostr.str() );
if (m_printSummary) {

if (m_printSummary && iApp != NULL) {
Application::Log(summaryGroup);
}
else {
std::cout << summaryGroup << std::endl;
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved
}
}


Expand Down Expand Up @@ -3110,7 +3114,7 @@ namespace Isis {
* -Wformat-security warning during the build.
*/
void BundleAdjust::outputBundleStatus(QString status) {
if (QCoreApplication::applicationName() != "ipce") {
if (iApp != NULL && QCoreApplication::applicationName() != "ipce") {
printf("%s", status.toStdString().c_str());
}
}
Expand Down
41 changes: 39 additions & 2 deletions isis/tests/Fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,45 @@ namespace Isis {
}


void StereoPair::SetUp() {
FileName labelPathL = FileName("data/stereoPair/stereoImageL.pvl");
FileName labelPathR = FileName("data/stereoPair/stereoImageR.pvl");

isdPathL = new FileName("data/stereoPair/stereoImageL.isd");
isdPathR = new FileName("data/stereoPair/stereoImageR.isd");

cubeL = new Cube();
cubeR = new Cube();

cubeL->fromIsd(tempDir.path() + "/stereoPairL.cub", labelPathL, *isdPathL, "rw");
cubeR->fromIsd(tempDir.path() + "/stereoPairR.cub", labelPathR, *isdPathR, "rw");

cubeList = new FileList();
cubeList->append(cubeL->fileName());
cubeList->append(cubeR->fileName());

cubeListFile = "/tmp/cubes.lis";
cubeList->write(cubeListFile);

cnetPath = "data/stereoPair/stereoPair.net";
network = new ControlNet();
network->ReadControl(cnetPath);
}


void StereoPair::TearDown() {
delete cubeList;
delete network;

delete cubeL;
delete cubeR;

delete isdPathL;
delete isdPathR;
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved

}


void MroCube::setInstrument(QString ikid, QString instrumentId, QString spacecraftName) {
PvlGroup &kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels");
kernels.findKeyword("NaifFrameCode").setValue(ikid);
Expand Down Expand Up @@ -407,6 +446,4 @@ namespace Isis {
}
}



}
20 changes: 20 additions & 0 deletions isis/tests/Fixtures.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,26 @@ namespace Isis {
void TearDown() override;
};


class StereoPair : public TempTestingFiles {
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved
protected:

Cube *cubeL;
Cube *cubeR;

FileName *isdPathL;
FileName *isdPathR;

FileList *cubeList;
QString cubeListFile;

ControlNet *network;
QString cnetPath;

void SetUp() override;
void TearDown() override;
};

class MroCube : public DefaultCube {
protected:
QString ckPath = "data/mroKernels/mroCK.bc";
Expand Down
32 changes: 32 additions & 0 deletions isis/tests/FunctionalTestsJigsaw.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
#include "Fixtures.h"
#include "Pvl.h"
#include "PvlGroup.h"
#include "TestUtilities.h"

#include "jigsaw.h"

#include "gtest/gtest.h"

using namespace Isis;

static QString APP_XML = FileName("$ISISROOT/bin/xml/jigsaw.xml").expanded();

TEST_F(StereoPair, FunctionalTestJigsawCamSolveAll) {
QTemporaryDir prefix;
QString outCnetFileName = prefix.path() + "/outTemp.net";
QVector<QString> args = {"fromlist="+cubeListFile, "cnet="+cnetPath, "onet="+outCnetFileName,
"observations=yes", "update=yes", "Cksolvedegree=3",
"Camsolve=all", "twist=no", "Spsolve=none", "Radius=no", "Residuals_csv=off"};

UserInterface options(APP_XML, args);

Pvl log;
try {
jigsaw(options, &log);
}
catch (IException &e) {
FAIL() << "Unable to open image: " << e.what() << std::endl;
}
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved

// Assert some stuff
}
Kelvinrr marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions isis/tests/data/stereoPair/stereoImageL.isd

Large diffs are not rendered by default.

Loading