Commit faa28a0d authored by Lauren Adoram-Kershner's avatar Lauren Adoram-Kershner Committed by Kelvin Rodriguez
Browse files

Updating Kaguya Distortion Model with Boresight (Finishing #3492) (#3498)

* added warning if anglesource option is used with mixed or topo normalization method; based on github tickets 3451 and 3452

* adding tests

* changes to KaguyaTC distortion map

* Fixed test on Aarons PR

* updated unit test

* reseting test data location

* Adding camera uptick
parent 1f7dc1df
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
Group = KAGUYA/TC1
  Version = 1
  Version = 2
  Library = KaguyaTcCamera
  Routine = KaguyaTcCameraPlugin
EndGroup

Group = KAGUYA/TC2
  Version = 1
  Version = 2
  Library = KaguyaTcCamera
  Routine = KaguyaTcCameraPlugin
EndGroup
+24 −21
Original line number Diff line number Diff line
@@ -46,11 +46,16 @@ namespace Isis {
      : CameraDistortionMap(parent) {
    QString odtxkey = "INS" + toString(naifIkCode) + "_DISTORTION_COEF_X";
    QString odtykey = "INS" + toString(naifIkCode) + "_DISTORTION_COEF_Y";
    QString boresightkey = "INS" + toString(naifIkCode) + "_BORESIGHT";

    for(int i = 0; i < 4; ++i) {
      p_odkx.push_back(p_camera->getDouble(odtxkey, i));
      p_odky.push_back(p_camera->getDouble(odtykey, i));
    }

    // add boresight x and y to coefficients vector
    p_odkx[0] = p_odkx[0] + p_camera->getDouble(boresightkey, 0);
    p_odky[0] = p_odky[0] + p_camera->getDouble(boresightkey, 1);
  }


@@ -108,9 +113,8 @@ namespace Isis {
    double r = qSqrt(r2);
    double r3 = r2 * r;

    // Apply distortion correction
    double dr_x = p_odkx[0] + p_odkx[1] * r + p_odkx[2] * r2 + p_odkx[3] * r3;
    double dr_y = p_odky[0] + p_odky[1] * r + p_odky[2] * r2 + p_odky[3] * r3;
    double dr_x = p_odkx[0] + p_odkx[1] * r + p_odkx[2] * r2 + p_odkx[3] * r3; //add boresight offset
    double dr_y = p_odky[0] + p_odky[1] * r + p_odky[2] * r2 + p_odky[3] * r3; //add boresight offset

    p_undistortedFocalPlaneX = x + dr_x;
    p_undistortedFocalPlaneY = y + dr_y;
@@ -203,4 +207,3 @@ namespace Isis {
    return bConverged;
  }
}
+4 −4
Original line number Diff line number Diff line
@@ -51,8 +51,8 @@ int main(void) {
    // These should be lat/lon at center of image. To obtain these numbers for a new cube/camera,
    // set both the known lat and known lon to zero and copy the unit test output
    // "Latitude off by: " and "Longitude off by: " values directly into these variables.
    double knownLat = 58.3498029142273396;
    double knownLon = 311.458498980458671;
    double knownLat = 58.3524398749999;
    double knownLon = 311.457363494321;

    qDebug() << "Testing TC2 w L2B0 image...";
    Cube c("$kaguya/testData/TC2W2B0_01_02735N583E3115.cub", "r");
@@ -114,8 +114,8 @@ int main(void) {
    qDebug() << "";
    qDebug() << "";
    qDebug() << "Testing TC1 s L2B0 image...";
    knownLat = -82.0214347373044603;
    knownLon = 46.4180177580203335;
    knownLat = -82.0195024182112;
    knownLon = 46.4153943800818;

    Cube c2("$kaguya/testData/TC1S2B0_01_06691S820E0465.cub", "r");
    KaguyaTcCamera *cam2 = (KaguyaTcCamera *) CameraFactory::Create(c2);