Unverified Commit 72074011 authored by AustinSanders's avatar AustinSanders Committed by GitHub
Browse files

Add distortion to EIS WAC Frame Camera + add test (#4562)



* Added distortion and modified test data

* Added TestImageToGroundToImage() to reduce repeated code

Co-authored-by: default avatarAustin Sanders <arsanders@ugs.gov>
parent c4cd70f0
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -47,7 +47,11 @@ namespace Isis {
    // Set up detector map, focal plane map, and distortion map
    new CameraDetectorMap(this);
    new CameraFocalPlaneMap(this, naifIkCode());
    CameraFocalPlaneMap *focalMap = new CameraFocalPlaneMap(this, naifIkCode());
    focalMap->SetDetectorOrigin(2092.5, 1112.5);
    new CameraDistortionMap(this);
    CameraDistortionMap *distMap = new CameraDistortionMap(this);
    distMap->SetDistortion(naifIkCode());

    // Setup the ground and sky map
    new CameraGroundMap(this);
+14 −1
Original line number Diff line number Diff line
@@ -25,6 +25,15 @@ void TestLineSamp(Camera *cam, double samp, double line) {
  }
}

void TestImageToGroundToImage(Camera *cam, double samp, double line, double lat, double lon){
  ASSERT_TRUE(cam->SetImage(samp, line));
  EXPECT_DOUBLE_EQ(cam->UniversalLatitude(), lat);
  EXPECT_DOUBLE_EQ(cam->UniversalLongitude(), lon);
  ASSERT_TRUE(cam->SetUniversalGround(cam->UniversalLatitude(), cam->UniversalLongitude()));
  EXPECT_NEAR(cam->Sample(), samp, 0.001);
  EXPECT_NEAR(cam->Line(), line, 0.001);
}


TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) {
  ClipperWacFcCamera *cam;
@@ -57,6 +66,10 @@ TEST_F(ClipperWacFcCube, ClipperWacFcCameraUnitTest) {
  TestLineSamp(cam, nline, nsamp);
  TestLineSamp(cam, nline, samp);

  TestImageToGroundToImage(cam, 145, 161, 8.5881709286625423, 253.71621132953456);
  TestImageToGroundToImage(cam, 3655, 157, 12.445262207724664, 255.73569853485378);
  TestImageToGroundToImage(cam, 289, 1767, 7.7976578051658336, 255.60927064348147);
  TestImageToGroundToImage(cam, 3767, 1579, 11.80993221278302, 257.50821511090754);

  // Simple test for ClipperWacFcCamera::ShutterOpenCloseTimes
  PvlGroup &inst = label.findGroup("Instrument", Pvl::Traverse);
+6 −1
Original line number Diff line number Diff line
@@ -1584,12 +1584,17 @@ namespace Isis {
      // 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-159104_FOCAL_LENGTH = 150.40199
        INS-159104_PIXEL_PITCH  = 0.014
        INS-159104_TRANSX       = (0.0, 0.014004651, 0.0)
        INS-159104_TRANSY       = (0.0, 0.0, 0.01399535)
        INS-159104_ITRANSS      = (0.0, 71.404849, 0.0)
        INS-159104_ITRANSL      = (0.0, 0.0, 71.4523)
        INS-159104_OD_K         = (0.0, -0.0000538628307258204, -4.57142010849732E-09)
      End_Object
    )");
    PvlObject newWacNkPvl; newWacNk >> newWacNkPvl;