Skip to content

Commit

Permalink
Implemented push broom distortion. (#4574)
Browse files Browse the repository at this point in the history
Co-authored-by: Stuart Sides <ssides@usgs.gov>
  • Loading branch information
amystamile-usgs and scsides authored Jul 30, 2021
1 parent 5aa38ac commit e720c80
Show file tree
Hide file tree
Showing 5 changed files with 1,875 additions and 167,933 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,12 @@ namespace Isis {

// Set up focal plane map
CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
if (m_instrumentNameShort == "EIS-PBNAC") {
focalMap->SetDetectorOrigin(2048.5, 1024.5);
}
else {
focalMap->SetDetectorOrigin(2092.5, 1112.5);
}
// center of array (same for WAC and NAC based on XY origin in EIS_Sensor_summary.xlsx)
focalMap->SetDetectorOrigin(2048.5, 1024.5);

// Set up distortion map
new CameraDistortionMap(this);
// TODO: set distortion
CameraDistortionMap *distMap = new CameraDistortionMap(this);
distMap->SetDistortion(naifIkCode());

// Set up the ground and sky map
new LineScanCameraGroundMap(this);
Expand Down
90 changes: 49 additions & 41 deletions isis/tests/ClipperPushBroomCameraTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,45 @@ TEST_F(ClipperPbCube, ClipperPushBroomCameraNacTest) {
EXPECT_EQ(cam->SpkTargetId(), -159);
EXPECT_EQ(cam->SpkReferenceId(), 1);

EXPECT_NEAR(cam->FocalLength(), 150.402, 0.0001);
EXPECT_NEAR(cam->FocalLength(), 993.8834414, 0.0001);

EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->spacecraftNameLong(), "Europa Clipper");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->spacecraftNameShort(), "Clipper");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameLong(), "Europa Imaging System Push Broom Narrow Angle Camera");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameShort(), "EIS-PBNAC");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentId(), "EIS-NAC-PB");

// Upper Left
EXPECT_TRUE(cam->SetImage(1, 1));
EXPECT_NEAR(cam->UniversalLatitude(), 1.2968475577607894, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 80.39050360283612, 0.05);
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -12.117595283473364);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 66.463853428869669);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1, 0.0001);
EXPECT_NEAR(cam->Line(), 1, 0.05);
EXPECT_NEAR(cam->Sample(), 1, 0.001);
EXPECT_NEAR(cam->Line(), 1, 0.001);

EXPECT_TRUE(cam->SetImage(1, 1056));
EXPECT_NEAR(cam->UniversalLatitude(), 1.2907489089492752, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 80.37388357344733, 0.05);
// Upper Right
EXPECT_TRUE(cam->SetImage(1, 1000));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -12.096927266599458);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 66.374968500075056);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1, 0.0001);
EXPECT_NEAR(cam->Line(), 1056, 0.05);
EXPECT_NEAR(cam->Sample(), 1, 0.001);
EXPECT_NEAR(cam->Line(), 1000, 0.001);

EXPECT_TRUE(cam->SetImage(1204, 1056));
EXPECT_NEAR(cam->UniversalLatitude(), -9.5034882814574857, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 76.218290471624172, 0.05);
// Lower Right
EXPECT_TRUE(cam->SetImage(4096, 1000));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -15.707723103010919);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 64.991443017841291);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1204, 0.0001);
EXPECT_NEAR(cam->Line(), 1056, 0.05);
EXPECT_NEAR(cam->Sample(), 4096, 0.001);
EXPECT_NEAR(cam->Line(), 1000, 0.001);

EXPECT_TRUE(cam->SetImage(1204, 1));
EXPECT_NEAR(cam->UniversalLatitude(), -9.5037826167213435, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 76.232648851710138, 0.05);
// Lower Left
EXPECT_TRUE(cam->SetImage(4096, 1));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -15.746353121956448);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 65.074729620675669);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1204, 0.0001);
EXPECT_NEAR(cam->Line(), 1, 0.05);
EXPECT_NEAR(cam->Sample(), 4096, 0.001);
EXPECT_NEAR(cam->Line(), 1, 0.001);
}

TEST_F(ClipperPbCube, ClipperPushBroomCameraWacTest) {
Expand All @@ -63,39 +67,43 @@ TEST_F(ClipperPbCube, ClipperPushBroomCameraWacTest) {
EXPECT_EQ(cam->SpkTargetId(), -159);
EXPECT_EQ(cam->SpkReferenceId(), 1);

EXPECT_NEAR(cam->FocalLength(), 150.402, 0.0001);
EXPECT_NEAR(cam->FocalLength(), 44.95757712, 0.0001);

EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->spacecraftNameLong(), "Europa Clipper");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->spacecraftNameShort(), "Clipper");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameLong(), "Europa Imaging System Push Broom Wide Angle Camera");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentNameShort(), "EIS-PBWAC");
EXPECT_PRED_FORMAT2(AssertQStringsEqual, cam->instrumentId(), "EIS-WAC-PB");

EXPECT_TRUE(cam->SetImage(1, 1));
EXPECT_NEAR(cam->UniversalLatitude(), 1.5088267433142744, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 81.378861952389798, 0.05);
// Top
EXPECT_TRUE(cam->SetImage(2130, 30));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -22.133032614015832);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 87.101796154127783);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1, 0.0001);
EXPECT_NEAR(cam->Line(), 1, 0.05);
EXPECT_NEAR(cam->Sample(), 2130, 0.001);
EXPECT_NEAR(cam->Line(), 30, 0.0011);

EXPECT_TRUE(cam->SetImage(1, 2048));
EXPECT_NEAR(cam->UniversalLatitude(), 1.4965915498699245, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 81.345482351767558, 0.05);
// Bottom
EXPECT_TRUE(cam->SetImage(2130, 2030));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -22.016871728071468);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 86.674027874092516);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 1, 0.0001);
EXPECT_NEAR(cam->Line(), 2048, 0.05);
EXPECT_NEAR(cam->Sample(), 2130, 0.001);
EXPECT_NEAR(cam->Line(), 2030, 0.0017);

EXPECT_TRUE(cam->SetImage(4096, 2048));
EXPECT_NEAR(cam->UniversalLatitude(), -34.782957391682949, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 68.590363919992924, 0.05);
// Right
EXPECT_TRUE(cam->SetImage(3580, 1024));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), -72.765663853451784);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 108.87646404992245);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 4096, 0.0001);
EXPECT_NEAR(cam->Line(), 2048, 0.05);
EXPECT_NEAR(cam->Sample(), 3580, 0.001);
EXPECT_NEAR(cam->Line(), 1024, 0.037);

EXPECT_TRUE(cam->SetImage(4096, 1));
EXPECT_NEAR(cam->UniversalLatitude(), -34.782957391682949, 0.05);
EXPECT_NEAR(cam->UniversalLongitude(), 68.590363919992924, 0.05);
// Left
EXPECT_TRUE(cam->SetImage(544, 1024));
EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), 20.853469071265028);
EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), 113.21575238420702);
EXPECT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
EXPECT_NEAR(cam->Sample(), 4096, 0.0001);
EXPECT_NEAR(cam->Line(), 1, 0.05);
EXPECT_NEAR(cam->Sample(), 544, 0.001);
EXPECT_NEAR(cam->Line(), 1024, 0.034);
}
20 changes: 0 additions & 20 deletions isis/tests/Fixtures.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1658,25 +1658,5 @@ namespace Isis {
QFile::copy("data/clipper/ClipperWacPb.cub", testPath);
testCube = new Cube(testPath, "rw");
}

PvlGroup &inst = testCube->label()->findObject("IsisCube").findGroup("Instrument");

TableField ephTimeField("MinimumRadius", TableField::Double);
TableField expTimeField("MaximumRadius", TableField::Double);
TableField lineStartField("LineStart", TableField::Integer);

TableRecord timesRecord;
timesRecord += ephTimeField;
timesRecord += expTimeField;
timesRecord += lineStartField;

Table timesTable("LineScanTimes", timesRecord);

timesRecord[0] = 893716269.18552;
timesRecord[1] = (double) inst["LineExposureDuration"] / 1000;
timesRecord[2] = 1;
timesTable += timesRecord;

testCube->write(timesTable);
}
}
1,406 changes: 1,319 additions & 87 deletions isis/tests/data/clipper/ClipperNacPb.cub

Large diffs are not rendered by default.

168,280 changes: 503 additions & 167,777 deletions isis/tests/data/clipper/ClipperWacPb.cub

Large diffs are not rendered by default.

0 comments on commit e720c80

Please sign in to comment.