Commit 6909fdfd authored by Amy Stamile's avatar Amy Stamile Committed by Jesse Mapel
Browse files

Jigsaw Test Conversions (sccconfig, scconfigHeld, radar) (#4463)

* Converted jigsaw scconfig tests.

* Added jigsaw radar test

* Updated tests to reflect PR #4446 changes & removed makefile tests

* Updates to scconfig tests
parent 28fb5798
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
BLANKS = "%-6s"    
LENGTH = "%-40s"

include $(ISISROOT)/make/isismake.tststree
+0 −61
Original line number Diff line number Diff line
APPNAME = jigsaw
# These tests exercise the bundle adjustment of images from the MiniRF radar instrument onboard LRO.
# Test 1: solving for position only, with error propagation
# Test 2: solving for position, velocity, acceleration, using polynomial over a constant hermite 
#         spline, with error propagation

# The "cat bundleout.txt" command in these tests uses sed to do the following (in order):
# 1. remove cube filename paths
# 2. remove net filename paths
# 3. remove digits beyond the fifth decimal place of decimal numbers
# 4. remove date and time
#
# 2014-07-23 Jeannie Backer - Commented out references to bundleout_images.csv.  
#                Removed default parameters.
# 2016-08-11 Jeannie Backer - Updated documentation
# 2016-10-05 Ian Humphrey - Removed no longer relevant RM command to remove inverseMatrix.dat
#                as jigsaw no longer generates this file during error propagation.
#                References #4315.

include $(ISISROOT)/make/isismake.tsts

commands:
	$(LS) -1 $(INPUT)/*.cub > $(OUTPUT)/cube.lis;
	$(APPNAME) fromlist=$(OUTPUT)/cube.lis \
	           cnet=$(INPUT)/Cabeus_Orbit400_withSS_AprioriPts.net \
	           onet=$(OUTPUT)/radar_sparse_poh_out.net \
	           maxits=10 \
	           errorprop=yes \
		   bundleout_txt=no \
	           spsolve=accelerations \
	           camsolve=no > /dev/null;
	$(CAT) residuals.csv | $(SED) 's/,[^,]*\/\([^,\/]*\.cub\)/,\1/g'\
	       > $(OUTPUT)/radar_sparse_poh_residuals.csv;
#	$(CAT) bundleout_images.csv \
#	       | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2>/dev/null \
#	       | $(SED) 's/\([0-9]*\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)\([0-9]*\)/\1/g' \
#	       > $(OUTPUT)/radar_sparse_poh_bundleout_images.csv;
#	$(RM) bundleout_images.csv > /dev/null;
	$(MV) bundleout_points.csv $(OUTPUT)/radar_sparse_poh_bundleout_points.csv > /dev/null;
	$(RM) print.prt > /dev/null;
	$(RM) residuals.csv  > /dev/null;
	$(APPNAME) fromlist=$(OUTPUT)/cube.lis \
	           cnet=$(INPUT)/Cabeus_Orbit400_withSS_AprioriPts.net \
	           onet=$(OUTPUT)/radar_sparse_out.net \
	           maxits=10 \
	           errorprop=yes \
	           spsolve=position \
	           overhermite=yes \
		   bundleout_txt=no \
	           camsolve=no > /dev/null;
	$(CAT) residuals.csv | $(SED) 's/,[^,]*\/\([^,\/]*\.cub\)/,\1/g'\
	       > $(OUTPUT)/radar_sparse_residuals.csv
	$(CAT) bundleout_images.csv \
	       | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2>/dev/null \
	       | $(SED) 's/\([0-9]*\.[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\)\([0-9]*\)/\1/g' \
	       > $(OUTPUT)/radar_sparse_bundleout_images.csv
	$(RM) bundleout_images.csv > /dev/null;
	$(MV) bundleout_points.csv $(OUTPUT)/radar_sparse_bundleout_points.csv > /dev/null;
	$(RM) $(OUTPUT)/cube.lis > /dev/null;
	$(RM) print.prt > /dev/null;
	$(RM) residuals.csv  > /dev/null;
+0 −27
Original line number Diff line number Diff line
APPNAME = jigsaw

include $(ISISROOT)/make/isismake.tsts

commands:
	$(LS) -1 $(INPUT)/*cub > $(OUTPUT)/cubes.lis;
	$(APPNAME) fromlist=$(OUTPUT)/cubes.lis \
	  cnet=$(INPUT)/themis_dayir_VO_arcadia_extract_hand.net \
	  onet=$(OUTPUT)/themis_dayir_VO_arcadia_extract_hand_jig.net \
	  scconfig=$(INPUT)/themis_vo.pvl \
	  radius=true \
	  point_radius_sigma=50\
	  bundleout_txt=no \
	  output_csv=no \
	  residuals_csv=no > /dev/null;
	$(CAT) bundleout_images_MARS_ODYSSEY_THEMIS_IR.csv \
	  | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
	  > $(OUTPUT)/bundleout_scconfig_images_themis.csv;
	$(CAT) bundleout_images_VIKING_ORBITER_1_VISUAL_IMAGING_SUBSYSTEM_CAMERA_B.csv \
	  | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
	  > $(OUTPUT)/bundleout_scconfig_images_viking_1.csv;
	$(CAT) bundleout_images_VIKING_ORBITER_2_VISUAL_IMAGING_SUBSYSTEM_CAMERA_A.csv \
	  | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
	  > $(OUTPUT)/bundleout_scconfig_images_viking_2.csv;
	$(RM) $(OUTPUT)/cubes.lis > /dev/null;
	$(RM) $(OUTPUT)/*.net > /dev/null;
	$(RM) *.csv > /dev/null;
+0 −31
Original line number Diff line number Diff line
APPNAME = jigsaw

include $(ISISROOT)/make/isismake.tsts

commands:
	$(LS) -1 $(INPUT)/*cub > $(OUTPUT)/cubes.lis;
	$(LS) $(INPUT)/I28234014RDR.cub > $(OUTPUT)/hold.lis;
	$(APPNAME) fromlist=$(OUTPUT)/cubes.lis \
	  heldlist=$(OUTPUT)/hold.lis \
	  cnet=$(INPUT)/themis_dayir_VO_arcadia_extract_hand.net \
	  onet=$(OUTPUT)/themis_dayir_VO_arcadia_extract_hand_jig.net \
	  scconfig=$(INPUT)/themis_vo.pvl \
	  bundleout_txt=no \
	  output_csv=no \
	  residuals_csv=no > /dev/null;
	$(CAT) bundleout_images_MARS_ODYSSEY_THEMIS_IR.csv \
	   | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
	   > $(OUTPUT)/bundleout_scconfig_images_themis.csv;
	$(CAT) bundleout_images_VIKING_ORBITER_1_VISUAL_IMAGING_SUBSYSTEM_CAMERA_B.csv \
	   | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
	   > $(OUTPUT)/bundleout_scconfig_images_viking_1.csv;
	$(CAT) bundleout_images_VIKING_ORBITER_2_VISUAL_IMAGING_SUBSYSTEM_CAMERA_A.csv \
          | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
          > $(OUTPUT)/bundleout_scconfig_images_viking_2.csv;
	$(CAT) bundleout_images_held.csv \
          | perl -pe 's/(^|,|: )([^,:]+\/)([^,\/:]*\.)(net|cub)/\1\3\4/g' 2> /dev/null \
          > $(OUTPUT)/bundleout_scconfig_images_held.csv;
	$(RM) $(OUTPUT)/cubes.lis > /dev/null;
	$(RM) $(OUTPUT)/hold.lis > /dev/null;
	$(RM) $(OUTPUT)/*.net > /dev/null;
	$(RM) *.csv > /dev/null;
+93 −2
Original line number Diff line number Diff line
@@ -1389,6 +1389,7 @@ namespace Isis {
    testCube.reset();
  }


  void NullPixelCube::SetUp() {
    TempTestingFiles::SetUp();

@@ -1406,6 +1407,7 @@ namespace Isis {
    }
  }


  void NullPixelCube::TearDown() {
    if (testCube->isOpen()) {
      testCube->close();
@@ -1416,4 +1418,93 @@ namespace Isis {
    }
  }


  void MiniRFNetwork::SetUp() {
    TempTestingFiles::SetUp();

    testCube1 = new Cube("data/miniRFImage/LSZ_00455_1CD_XKU_87S324_V1_S1_Null.crop.cub");
    testCube2 = new Cube("data/miniRFImage/LSZ_00457_1CD_XKU_87S321_V1_S1_Null.crop.cub");
    testCube3 = new Cube("data/miniRFImage/LSZ_00459_1CD_XKU_88S327_V1_S1_Null.crop.cub");

    cubeList = new FileList();

    cubeList->append(testCube1->fileName());
    cubeList->append(testCube2->fileName());
    cubeList->append(testCube3->fileName());


    cubeListFile = tempDir.path() + "/cubes.lis";
    cubeList->write(cubeListFile);

    network = new ControlNet("data/miniRFImage/Cabeus_Orbit400_withSS_AprioriPts.net");
    controlNetPath = tempDir.path() + "/miniRFNet.net";
    network->Write(controlNetPath);
  }

  void MiniRFNetwork::TearDown() {
    if (testCube1->isOpen()) {
      testCube1->close();
    }
    delete testCube1;
    if (testCube2->isOpen()) {
      testCube2->close();
    }
    delete testCube2;
    if (testCube3->isOpen()) {
      testCube3->close();
    }
    delete testCube3;

    if (cubeList) {
      delete cubeList;
    }
  }

  void VikThmNetwork::SetUp() {
    TempTestingFiles::SetUp();

    testCube1 = new Cube("data/vikingThemisNetwork/F704b51.lev1_slo_crop.cub");
    testCube2 = new Cube("data/vikingThemisNetwork/F857a32.lev1_slo_crop.cub");
    testCube3 = new Cube("data/vikingThemisNetwork/I28234014RDR_crop.cub");
    testCube4 = new Cube("data/vikingThemisNetwork/I52634011RDR_crop.cub");

    cubeList = new FileList();

    cubeList->append(testCube1->fileName());
    cubeList->append(testCube2->fileName());
    cubeList->append(testCube3->fileName());
    cubeList->append(testCube4->fileName());


    cubeListFile = tempDir.path() + "/cubes.lis";
    cubeList->write(cubeListFile);

    network = new ControlNet("data/vikingThemisNetwork/themis_dayir_VO_arcadia_extract_hand.net");
    controlNetPath = tempDir.path() + "/vikThmNet.net";
    network->Write(controlNetPath);
  }

  void VikThmNetwork::TearDown() {
    if (testCube1->isOpen()) {
      testCube1->close();
    }
    delete testCube1;
    if (testCube2->isOpen()) {
      testCube2->close();
    }
    delete testCube2;
    if (testCube3->isOpen()) {
      testCube3->close();
    }
    delete testCube3;
    if (testCube4->isOpen()) {
      testCube4->close();
    }
    delete testCube4;

    if (cubeList) {
      delete cubeList;
    }
  }

}
Loading