Unverified Commit 58415b93 authored by Kelvin Rodriguez's avatar Kelvin Rodriguez Committed by GitHub
Browse files

Jigsaw camsolveall (#4078)



* jigsaw to app conversion and remove unnecessary tests

* init jigsaw test

* prints

* prints

* all my homies hate control networks

* working tests

* updated bundleadjust

* bin 2 pvl

* added csv check, addressed comments

* removed header test

* renamed to observation

* also renamed in fixture

* removed old tests

Co-authored-by: default avatarKristin <kberry@usgs.gov>
parent d8567b1d
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -208,6 +208,7 @@ namespace Isis {
        m_usingAle = true;
      }
      catch(...) {

        // Backup to stadnard ISIS implementation
        if (noTables) {
          load(kernels["TargetPosition"], noTables);
+8 −0
Original line number Diff line number Diff line
@@ -148,6 +148,14 @@ namespace Isis {
        gp += PvlKeyword("Status", "Camera pointing NOT updated");
      }
      if (log) {
        Pvl summary;
        std::istringstream iss (bundleAdjustment->iterationSummaryGroup().toStdString());
        iss >> summary; 
        
        for (auto grpIt = summary.beginGroup(); grpIt!= summary.endGroup(); grpIt++) {
          log->addGroup(*grpIt);
        }
        
        log->addGroup(gp);
      }
      delete bundleSolution;
+0 −43
Original line number Diff line number Diff line
APPNAME = jigsaw
# Adapted originally from observation_mode_cholmod test.
#
# This test exercises the bundle adjustment of images from the HiRISE camera onboard MRO.
# sparse method with observation mode; solving for angles (3rd degree polynomial, using 
# camsolve=all).
#
# NOTE: This test can be removed if another test tests the CAMSOLVE=ALL option.
#
# 2014-07-23 Jeannie Backer - Commented out references to bundleout_images.csv.
#                Removed default parameters.
# 2016-08-20 Ian Humphrey - Removed analogous case01 test and renamed this test from
#                observation_mode_cholmod to camsolveAll. References #4122.
include $(ISISROOT)/make/isismake.tsts

commands:
	$(CP) $(INPUT)/*.cub $(OUTPUT) > /dev/null;
	$(LS) -1 $(OUTPUT)/*.cub > $(OUTPUT)/cube.lis;
	$(APPNAME) fromlist=$(OUTPUT)/cube.lis \
	  cnet=$(INPUT)/redPntreg.net \
	  onet=$(OUTPUT)/obsmode_cholmod_out.net \
	  observations=yes \
	  update=yes \
	  cksolvedegree=3 \
	  camsolve=all \
	  bundleout_txt=no \
	  twist=no > /dev/null;
	# The above command 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
	# 5. remove number of iterations
	$(CAT) residuals.csv | $(SED) 's/,[^,]*\/\([^,\/]*\.cub\)/,\1/g'\
	       > $(OUTPUT)/obsmode_cholmod_residuals.csv
	$(CAT) bundleout_images.csv | $(SED) 's/\/[^,]*\/\([^,\/]*\.cub\)/\1/g' \
	       > $(OUTPUT)/obsmode_cholmod_bundleout_images.csv
	$(RM) bundleout_images.csv > /dev/null;
	$(RM) residuals.csv > /dev/null;
	$(MV) bundleout_points.csv $(OUTPUT)/obsmode_cholmod_bundleout_points.csv > /dev/null;
	$(RM) $(OUTPUT)/cube.lis > /dev/null;
	cathist from=$(OUTPUT)/PSP_002733_1880_RED4.crop.cub > $(OUTPUT)/PSP4.pvl;
	cathist from=$(OUTPUT)/PSP_002733_1880_RED5.crop.cub > $(OUTPUT)/PSP5.pvl;
+9 −2
Original line number Diff line number Diff line
@@ -3062,9 +3062,13 @@ namespace Isis {
    std::ostringstream ostr;
    ostr << summaryGroup << std::endl;
    m_iterationSummary += QString::fromStdString( ostr.str() );
    if (m_printSummary) {
    
    if (m_printSummary && iApp != NULL) {
      Application::Log(summaryGroup);
    }
    else {
      std::cout << summaryGroup << std::endl;
    }
  }


@@ -3110,7 +3114,10 @@ namespace Isis {
   *                           -Wformat-security warning during the build.
   */
  void BundleAdjust::outputBundleStatus(QString status) {
    if (QCoreApplication::applicationName() != "ipce") {
    if (iApp == NULL) { // in a function call
      printf("%s", status.toStdString().c_str());
    }
    else if (QCoreApplication::applicationName() != "ipce") {
      printf("%s", status.toStdString().c_str());
    }
  }
+47 −2
Original line number Diff line number Diff line
@@ -255,6 +255,53 @@ namespace Isis {
  }
  

  void ObservationPair::SetUp() {
      FileName labelPathL = FileName("data/observationPair/observationImageL.pvl");
      FileName labelPathR = FileName("data/observationPair/observationImageR.pvl");

      isdPathL = new FileName("data/observationPair/observationImageL.isd");
      isdPathR = new FileName("data/observationPair/observationImageR.isd");

      cubeL = new Cube();
      cubeR = new Cube();

      cubeLPath = tempDir.path() + "/observationPairL.cub";
      cubeRPath = tempDir.path() + "/observationPairR.cub";

      cubeL->fromIsd(cubeLPath, labelPathL, *isdPathL, "rw");    
      cubeR->fromIsd(cubeRPath, labelPathR, *isdPathR, "rw");    

      cubeList = new FileList();
      cubeList->append(cubeL->fileName());
      cubeList->append(cubeR->fileName());

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

      cnetPath = "data/observationPair/observationPair.net";
      network = new ControlNet();
      network->ReadControl(cnetPath);
  }


  void ObservationPair::TearDown() {
    delete cubeList;
    delete network;

    if (cubeL) {
      delete cubeL;
    }
    
    if (cubeR) {
      delete cubeR;
    }

    delete isdPathL;
    delete isdPathR;

  }


  void MroCube::setInstrument(QString ikid, QString instrumentId, QString spacecraftName) {
    PvlGroup &kernels = testCube->label()->findObject("IsisCube").findGroup("Kernels");
    kernels.findKeyword("NaifFrameCode").setValue(ikid);    
@@ -407,6 +454,4 @@ namespace Isis {
    }
  }



}
Loading