Commit 43efaf59 authored by Janet Barrett's avatar Janet Barrett
Browse files

Modified footprintinit so that it can be run on mosaics. Fixes #2158.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5954 41f8697f-d340-4b68-9986-7bafba869bb8
parent 4a552ca5
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -17,15 +17,19 @@ void IsisMain() {
  UserInterface &ui = Application::GetUserInterface();
  Cube cube;
  cube.open(ui.GetFileName("FROM"), "rw");
  bool testXY = ui.GetBoolean("TESTXY");

  // Make sure cube has been run through spiceinit
  try {
    cube.camera();
  }
  catch(IException &e) {
    if (!cube.projection()) {
      string msg = "Spiceinit must be run before initializing the polygon";
      throw IException(e, IException::User, msg, _FILEINFO_);
    }
    testXY = false;
  }

  Progress prog;
  prog.SetMaximumSteps(1);
@@ -73,7 +77,7 @@ void IsisMain() {
    throw IException(e, IException::User, msg, _FILEINFO_);
  }

  if(ui.GetBoolean("TESTXY")) {
  if(testXY) {
    Pvl cubeLab(ui.GetFileName("FROM"));
    PvlGroup inst = cubeLab.findGroup("Instrument", Pvl::Traverse);
    QString target = inst["TargetName"];
+3 −0
Original line number Diff line number Diff line
@@ -144,6 +144,9 @@
    <change name="Debbie A. Cook" date="2012-12-10">
      Changed to use TProjection instead of Projection.  References #775
    </change>
    <change name="Janet Barrett" date="2014-08-04">
      Modified so that the program can be run on a mosaic file. Fixes #2158.
    </change>
  </history>
  
  <groups>
+18 −0
Original line number Diff line number Diff line
APPNAME = footprintinit

include $(ISISROOT)/make/isismake.tsts

# cp so I don't destroy the input cube
commands:
	$(CP) $(INPUT)/tychogrid.cub $(OUTPUT)/tychogrid.cub;
	$(APPNAME) from=$(OUTPUT)/tychogrid.cub \
	  testxy=true > /dev/null;
	$$ISISROOT/bin/blobdump \
	  from=$(OUTPUT)/tychogrid.cub \
	  to=$(OUTPUT)/tychogrid.txt \
	  name=footprint \
	  type=Polygon > /dev/null;
	$(CAT) $(OUTPUT)/tychogrid.txt | \
	  sed 's/\([0-9]\.[0-9]\{5\}\)\([0-9]*\)/\1/g' | \
	  sed -e '$$G' > $(OUTPUT)/tychogrid.trimmed.txt
	rm $(OUTPUT)/tychogrid.cub $(OUTPUT)/tychogrid.txt