Skip to content

Commit

Permalink
Updates WAC FC tests to use new data (#4571)
Browse files Browse the repository at this point in the history
* Updated tests to use real data

* Updated test cub

* Updated frame ids

Co-authored-by: Austin Sanders <arsanders@ugs.gov>
  • Loading branch information
AustinSanders and Austin Sanders authored Jul 29, 2021
1 parent 0a86c83 commit 98ebcc8
Show file tree
Hide file tree
Showing 6 changed files with 783 additions and 55 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ namespace Isis {
* @return int The appropriate instrument code for the "Camera-Matrix" Kernel Frame ID.
*/
int ClipperNacRollingShutterCamera::CkFrameId() const {
return (-159101);
return (-159000);
}


Expand All @@ -146,7 +146,7 @@ namespace Isis {
* @return int The appropriate instrument code for the "Camera-matrix" Kernel Reference ID.
*/
int ClipperNacRollingShutterCamera::CkReferenceId() const {
return (-159010);
return (1);
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace Isis {
* @return @b int The appropriate instrument code for the "Camera-matrix"
* Kernel Frame ID
*/
virtual int CkFrameId() const { return (-159102); }
virtual int CkFrameId() const { return (-159000); }


/**
Expand Down
4 changes: 2 additions & 2 deletions isis/tests/ClipperNacRollingShutterCameraTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ TEST_F(ClipperNacRsCube, ClipperNacRsCameraUnitTest) {

ClipperNacRollingShutterCamera *cam = (ClipperNacRollingShutterCamera *)testCube->camera();

EXPECT_EQ(cam->CkFrameId(), -159101);
EXPECT_EQ(cam->CkReferenceId(), -159010);
EXPECT_EQ(cam->CkFrameId(), -159000);
EXPECT_EQ(cam->CkReferenceId(), 1);
EXPECT_EQ(cam->SpkTargetId(), -159);
EXPECT_EQ(cam->SpkReferenceId(), 1);

Expand Down
15 changes: 7 additions & 8 deletions isis/tests/ClipperWacFcCameraTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) {

// Camera info
//EXPECT_EQ(cam->instrumentRotation()->Frame(), -27002); // from the defaultcube isd
EXPECT_EQ(cam->CkFrameId(), -159102);
EXPECT_EQ(cam->CkFrameId(), -159000);
EXPECT_EQ(cam->CkReferenceId(), 1);
EXPECT_EQ(cam->SpkTargetId(), -159);
EXPECT_EQ(cam->SpkReferenceId(), 1);
Expand All @@ -56,7 +56,6 @@ TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) {
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameLong(), "Europa Imaging System Framing Wide Angle Camera");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameShort(), "EIS-FWAC");


// Check SetImage on corners
int line, samp, nline, nsamp;
line = 1.0; samp = 1.0;
Expand All @@ -66,13 +65,13 @@ TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) {
TestLineSamp(cam, nline, nsamp);
TestLineSamp(cam, nline, samp);

TestImageToGroundToImage(cam, 145, 161, 8.5839718675128971, 253.72747262733904);
TestImageToGroundToImage(cam, 3655, 157, 12.477189586257952, 255.76543090545474);
TestImageToGroundToImage(cam, 289, 1767, 7.7936575791457452, 255.62130722292261);
TestImageToGroundToImage(cam, 3767, 1579, 11.843295382436571, 257.54360381024532);
TestImageToGroundToImage(cam, 145, 161, 1.0318106954644963, 79.845106263190786);
TestImageToGroundToImage(cam, 3655, 157, -30.257524123457561, 68.491558949717344);
TestImageToGroundToImage(cam, 289, 1767, 4.3522464978639448, 65.049067459499526);
TestImageToGroundToImage(cam, 3767, 1579, -26.240527197710811, 54.405682822879818);

// Simple test for ClipperWacFcCamera::ShutterOpenCloseTimes
PvlGroup &inst = label.findGroup("Instrument", Pvl::Traverse);
PvlGroup &inst = wacFcCube->label()->findObject("IsisCube").findGroup("Instrument", Pvl::Traverse);
QString startTime = inst["StartTime"];
iTime etStart(startTime);

Expand Down
45 changes: 3 additions & 42 deletions isis/tests/Fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1554,52 +1554,13 @@ namespace Isis {
void ClipperWacFcCube::SetUp() {
TempTestingFiles::SetUp();

// Use defaultCube label and isd for now
std::ifstream isdFile("data/defaultImage/defaultCube.isd");
std::ifstream cubeLabel("data/defaultImage/defaultCube.pvl");
isdFile >> isd;
cubeLabel >> label;

// Define WAC cube
wacFcCube = new Cube();
FileName wacFn(tempDir.path() + "/ClipperWAC.cub");
wacFcCube->fromIsd(wacFn, label, isd, "rw");
QString testPath = tempDir.path() + "/test.cub";
QFile::copy("data/clipper/ClipperWacFc.cub", testPath);
wacFcCube = new Cube(testPath);

PvlGroup &wacKernels = wacFcCube->label()->findObject("IsisCube").findGroup("Kernels");
wacKernels.findKeyword("NaifFrameCode").setValue("-159102");

// Instruments Group
PvlGroup &realWacInst = wacFcCube->label()->findObject("IsisCube").findGroup("Instrument");
std::istringstream newWacInst(R"(
Group = Instrument
SpacecraftName = Clipper
InstrumentId = EIS-WAC-FC
TargetName = Europa
StartTime = 2025-01-01T00:00:00.000
End_Group
)");
PvlGroup newWacInstPvl; newWacInst >> newWacInstPvl;
realWacInst = newWacInstPvl;

// NaifKeywords Group
PvlObject &realWacNk = wacFcCube->label()->findObject("NaifKeywords");
std::istringstream newWacNk(R"(
Object = NaifKeywords
BODY_CODE = 502
BODY502_RADII = (1562.6, 1560.3, 1559.5)
BODY_FRAME_CODE = 10024
INS-159102_FOCAL_LENGTH = 150.40199
INS-159102_PIXEL_PITCH = 0.014
INS-159102_TRANSX = (0.0, 0.014004651, 0.0)
INS-159102_TRANSY = (0.0, 0.0, 0.01399535)
INS-159102_ITRANSS = (0.0, 71.404849, 0.0)
INS-159102_ITRANSL = (0.0, 0.0, 71.4523)
INS-159102_OD_K = (0.0, -0.0000538628307258204, -4.57142010849732E-09)
End_Object
)");
PvlObject newWacNkPvl; newWacNk >> newWacNkPvl;
realWacNk = newWacNkPvl;

double offset = 10;
AlphaCube aCube(wacFcCube->sampleCount(), wacFcCube->lineCount(),
wacFcCube->sampleCount()-offset, wacFcCube->lineCount() - offset,
Expand Down
Loading

0 comments on commit 98ebcc8

Please sign in to comment.