Commit e3016f1c authored by Stuart Sides's avatar Stuart Sides Committed by Adam Paquette
Browse files

Hayabusa2 fy19 (#693)

* Preliminary camera model changes and faked distortion for Hayabusa 2

* Delete trackingAndVirtualLabels.pvl

* Modified model to use alpha cube, new distortion map, and not use a distortion when using L2c or L2d images

* Updated unittest after putting boresight into iak
parent 2c337216
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -103,7 +103,7 @@ namespace Isis {

    // Setup distortion map (use default for now)
    // Level L2a and L2b images have not been corrected for optical distortion (false)
    // Level L2d and up images have been corrected for optical distortion (true)
    // Level L2c and L2d images have been corrected for optical distortion (true)
    // Create an appropriate DistortionMap based on the processing level IDed in the ingestion app
    if ((!inst.hasKeyword("DistortionCorrection")) ||
        (inst.hasKeyword("DistortionCorrection")  &&  toBool(inst["DistortionCorrection"]) == false)) {
+45 −45
Original line number Diff line number Diff line
@@ -2,7 +2,7 @@ Unit Test for Hyb2OncCamera...

----------------------------------------------
Test for Telecopic Camera...
FileName:  "hyb2_onc_20151204_041012_tbf_l2a.fit.cub"
FileName:  "hyb2_onc_20151204_041012_tbf_l2a.cub"
CK Frame:  -37100

Kernel IDs: 
@@ -19,32 +19,32 @@ Instrument Name Short: "ONC-T"
Shutter open  =  "502474280.7291458"
Shutter close =  "502474280.7291541"

For upper left corner ...
DeltaSample =  -522.936
DeltaLine   =  -489.534
For upper left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For upper right corner ...
DeltaSample =  500.132
DeltaLine   =  -489.531
For upper right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower left corner ...
DeltaSample =  -522.943
DeltaLine   =  533.544
For lower left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower right corner ...
DeltaSample =  500.138
DeltaLine   =  533.54
For lower right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For center pixel position ...
Latitude OK
Longitude OK
DeltaSample =  -11.9
DeltaLine   =  21.5
Delta Sample less than 0.001
Delta Line less than 0.001


----------------------------------------------
Test for W1 Camera...
FileName:  "hyb2_onc_20151204_045429_w1f_l2a.fit_crop.cub"
FileName:  "hyb2_onc_20151204_045429_w1f_l2a_crop.cub"
CK Frame:  -37110

Kernel IDs: 
@@ -61,32 +61,32 @@ Instrument Name Short: "ONC-W1"
Shutter open  =  "502476937.6921466"
Shutter close =  "502476937.6921548"

For upper left corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For upper left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For upper right corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For upper right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower left corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For lower left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower right corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For lower right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For center pixel position ...
Latitude OK
Longitude OK
DeltaSample =  0.804601
DeltaLine   =  0.683101
Delta Sample less than 0.001
Delta Line less than 0.001


----------------------------------------------
Test for W2 Camera...
FileName:  "hyb2_onc_20151203_072958_w2f_l2a.fit_crop.cub"
FileName:  "hyb2_onc_20151203_072958_w2f_l2a_crop.cub"
CK Frame:  -37120

Kernel IDs: 
@@ -103,25 +103,25 @@ Instrument Name Short: "ONC-W2"
Shutter open  =  "502399866.4151246"
Shutter close =  "502399866.4151273"

For upper left corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For upper left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For upper right corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For upper right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower left corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For lower left of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For lower right corner ...
DeltaSample = No Intersection
DeltaLine   = No Intersection
For lower right of target ...
Delta Sample less than 0.001
Delta Line less than 0.001

For center pixel position ...
Latitude OK
Longitude OK
DeltaSample =  1.87917
DeltaLine   =  -3.92022
Delta Sample less than 0.001
Delta Line less than 0.001
+6 −6
Original line number Diff line number Diff line
@@ -118,11 +118,11 @@ namespace Isis {
    p_undistortedFocalPlaneY = uy;

// TEMP GET IT COMPILING REMOVE BEFORE REAL WORK
    if (1 == 1) {
      p_focalPlaneX = ux;
      p_focalPlaneY = uy;
      return true;
    }
//    if (1 == 1) {
//      p_focalPlaneX = ux;
//      p_focalPlaneY = uy;
//      return true;
//    }

    double xt = ux;
    double yt = uy;
@@ -150,7 +150,7 @@ namespace Isis {

      // Radial distortion
      // dr is the radial distortion contribution
      dr = p_odk[0] + p_odk[1] * rr + p_odk[2] * rrrr;
      dr = (p_odk[0]-1.0) + p_odk[1] * rr + p_odk[2] * rrrr;

      // Distortion at the current point location
      xdistortion = xt * dr;
+1 −0
Original line number Diff line number Diff line
@@ -29,6 +29,7 @@ namespace Isis {
   *   @history 2018-12-11 Stuart Sides - Loop in
   *            SetUndistortedFocalPlane was not being exicuted.
   *            Modified to use both itteration and convergence.
   *            NOTE: A new iak was installed at the same time.
   *
   */
  class Hyb2OncDistortionMap : public CameraDistortionMap {
+18 −24
Original line number Diff line number Diff line
@@ -61,33 +61,26 @@ int main(void) {
    qDebug() << "";
    qDebug() << "----------------------------------------------";
    qDebug() << "Test for Telecopic Camera...";
    double knownLat = -47.23506367622795;
    double knownLon = 45.06713880290044;
    Cube c("$hayabusa2/testData/hyb2_onc_20151204_041012_tbf_l2a.fit.cub", "r");
    testCamera(c, knownLat, knownLon, 
               512.5, 512.5, 602.0, 334.0, 378.0, 557.0, 594.0, 580.0);
//    362.0, 352.0, 602.0, 334.0, 378.0, 557.0, 594.0, 580.0);
    double knownLat = -39.18374913423203;
    double knownLon = 48.06875707620756;
    Cube c("$hayabusa2/testData/hyb2_onc_20151204_041012_tbf_l2a.cub", "r");
    testCamera(c, knownLat, knownLon, 357.0, 359.0, 602.0, 334.0, 378.0, 557.0, 594.0, 580.0);

    qDebug() << "";
    qDebug() << "----------------------------------------------";
    qDebug() << "Test for W1 Camera...";
    knownLat = -50.66777190122887;
    knownLon = 97.68522302461859;
    Cube w1("$hayabusa2/testData/hyb2_onc_20151204_045429_w1f_l2a.fit_crop.cub", "r");
    testCamera(w1, knownLat, knownLon,
               21.0, 20.0, 31.0, 11.0, 16.0, 29.0, 32.0, 28.0);
//    16.0, 14.0, 31.0, 11.0, 16.0, 29.0, 32.0, 28.0);
    knownLat = -54.25951996619505;
    knownLon = 67.72017401996563;
    Cube w1("$hayabusa2/testData/hyb2_onc_20151204_045429_w1f_l2a_crop.cub", "r");
    testCamera(w1, knownLat, knownLon, 21.0, 20.0, 31.0, 11.0, 16.0, 29.0, 32.0, 28.0);

    qDebug() << "";
    qDebug() << "----------------------------------------------";
    qDebug() << "Test for W2 Camera...";
//    knownLat = 4.676892803564044;
//    knownLon = -12.46121470106279;
    knownLat = 30.06610722049293;
    knownLon = 78.40416492096558;
    Cube w2("$hayabusa2/testData/hyb2_onc_20151203_072958_w2f_l2a.fit_crop.cub", "r");
    testCamera(w2, knownLat, knownLon,
               51.0, 42.0, 173.0, 21.0, 54.0, 149.0, 174.0, 155.0);
    knownLat = 29.68691258558313;
    knownLon = 78.57599766268363;
    Cube w2("$hayabusa2/testData/hyb2_onc_20151203_072958_w2f_l2a_crop.cub", "r");
    testCamera(w2, knownLat, knownLon, 51.0, 42.0, 173.0, 21.0, 54.0, 149.0, 174.0, 155.0);

  }
  catch (IException &e) {
@@ -97,7 +90,8 @@ int main(void) {
}


void testCamera(Cube &c, double knownLat, double knownLon,
void testCamera(Cube &c,
                double knownLat, double knownLon,
                double s1, double l1, 
                double s2, double l2, 
                double s3, double l3, 
@@ -134,16 +128,16 @@ void testCamera(Cube &c, double knownLat, double knownLon,
  qDebug() << "";

  // Test all four corners to make sure the conversions are right
  qDebug() << "For upper left corner ...";
  qDebug() << "For upper left of target ...";
  testLineSamp(cam, s1, l1);

  qDebug() << "For upper right corner ...";
  qDebug() << "For upper right of target ...";
  testLineSamp(cam, s2, l2);

  qDebug() << "For lower left corner ...";
  qDebug() << "For lower left of target ...";
  testLineSamp(cam, s3, l3);

  qDebug() << "For lower right corner ...";
  qDebug() << "For lower right of target ...";
  testLineSamp(cam, s4, l4);

  qDebug() << "For center pixel position ...";