Commit f4879388 authored by Jeannie Backer's avatar Jeannie Backer
Browse files

PROG: Modified thmvistrim to test that input cube is valid before creating output cube.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@5970 41f8697f-d340-4b68-9986-7bafba869bb8
parent fed08865
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -23,13 +23,13 @@ void IsisMain() {
  // Grab the file to import
  ProcessByLine p;
  UserInterface &ui = Application::GetUserInterface();

  Cube *icube = p.SetInputCube("FROM");
  p.SetOutputCube("TO");

  // Make sure it is a Themis EDR/RDR
  FileName inFileName = ui.GetFileName("FROM");
  try {
    if(icube->group("Instrument")["InstrumentID"][0] != "THEMIS_VIS") {
      FileName inFileName = ui.GetFileName("FROM");
      QString msg = "This program is intended for use on THEMIS VIS images only. [";
      msg += inFileName.expanded() + "] does not appear to be a THEMIS VIS image.";
      throw IException(IException::User, msg, _FILEINFO_);
@@ -40,6 +40,8 @@ void IsisMain() {
                     "Unable to run thmvistrim with the given input cube.", _FILEINFO_);
  }

  p.SetOutputCube("TO");

  frameletSize = 192 / toInt(icube->group("Instrument")["SpatialSumming"][0]);
  frameletTopTrimSize = ui.GetInteger("TOPTRIM");
  frameletLeftTrimSize = ui.GetInteger("LEFTTRIM");
+2 −2
Original line number Diff line number Diff line
@@ -10,5 +10,5 @@ commands:
	TO=$(OUTPUT)/I00831002RDR.trimmed.cub 2>> $(OUTPUT)/error_temp.txt > /dev/null;

	$(SED) 's+\[/.*/input/+\[input/+' $(OUTPUT)/error_temp.txt > $(OUTPUT)/error.txt;
	$(RM) $(OUTPUT)/I00831002RDR.trimmed.cube;
	$(RM) $(OUTPUT)/error_temp.txt;
	$(RM) $(OUTPUT)/I00831002RDR.trimmed.cube 2> /dev/null;
	$(RM) $(OUTPUT)/error_temp.txt 2> /dev/null;