Commit 98d4db7e authored by Kaj Williams's avatar Kaj Williams
Browse files

Modified intermediate filenames to enable parallel processing. Ref #4862

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@7748 41f8697f-d340-4b68-9986-7bafba869bb8
parent a3566e1e
Loading
Loading
Loading
Loading
+10 −8
Original line number Diff line number Diff line
@@ -65,9 +65,10 @@ void IsisMain() {
  // Algorithm: lowpass(from, temp) -> hipass(temp, noise) -> to = from-noise

  // Run lowpass filter on input
  QString tempFileName = FileName::createTempFile("$TEMPORARY/dstripe.temporary.cub").expanded();
  QString lowParams = "";
  lowParams += "from= " + ui.GetFileName("FROM");
  lowParams += " to= dstripe.temporary.cub ";
  lowParams += " to= " + tempFileName + " ";
  lowParams += " samples= " + toString(lowSamples);
  lowParams += " lines= " + toString(lowLines);

@@ -84,23 +85,24 @@ void IsisMain() {
  }

  // Run highpass filter after lowpass is done, i.e. highpass(lowpass(input))
  QString tempNoiseFileName = FileName::createTempFile("$TEMPORARY/dstripe.noise.temporary.cub").expanded();
  QString highParams = "";
  highParams += "from= dstripe.temporary.cub ";
  highParams += " to= " + ui.GetFileName("NOISE") + " ";
  highParams += " from= "+tempFileName + " ";
  highParams += " to= " + tempNoiseFileName + " ";
  highParams += " samples= " + toString(highSamples);
  highParams += " lines= " + toString(highLines);

  ProgramLauncher::RunIsisProgram("highpass", highParams);
  remove("dstripe.temporary.cub");
  QFile::remove(tempFileName);

  // Take the difference (FROM-NOISE) and write it to output
  p.SetInputCube("NOISE");
  CubeAttributeInput att;
  p.SetInputCube(tempNoiseFileName, att);
  p.SetOutputCube("TO");
  p.StartProcess(difference);
  p.EndProcess();
  if(ui.GetBoolean("DELETENOISE")) {
    QString noiseFile(FileName(ui.GetFileName("NOISE")).expanded());
    QFile::remove(noiseFile);
    QFile::remove(tempNoiseFileName);
  }
}

+3 −0
Original line number Diff line number Diff line
@@ -80,6 +80,9 @@
    <change name="Steven Lambright" date="2008-05-13">
      Removed references to CubeInfo 
    </change>
     <change name="Kaj Williams" date="2017-06-05">
      Now names the temp files with unique names, enabling parallel execution.
    </change>
  </history>

  <groups>