-
Notifications
You must be signed in to change notification settings - Fork 173
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* first few test cases, needs work * two working tests * add test for correlation tolerance * improve test data creation code
- Loading branch information
Showing
8 changed files
with
288 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
/** | ||
* @file | ||
* $Revision: 1.19 $ | ||
* $Date: 2010/03/22 19:44:53 $ | ||
* | ||
* Unless noted otherwise, the portions of Isis written by the USGS are | ||
* public domain. See individual third-party library and package descriptions | ||
* for intellectual property information, user agreements, and related | ||
* information. | ||
* | ||
* Although Isis has been used by the USGS, no warranty, expressed or | ||
* implied, is made by the USGS as to the accuracy and functioning of such | ||
* software and related material nor shall the fact of distribution | ||
* constitute any such warranty, and no responsibility is assumed by the | ||
* USGS in connection therewith. | ||
* | ||
* For additional information, launch | ||
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html | ||
* in a browser or see the Privacy & Disclaimers page on the Isis website, | ||
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on | ||
* http://www.usgs.gov/privacy.html. | ||
*/ | ||
#include <QMessageBox> | ||
|
||
#include "FindGapsFunctor.h" | ||
#include "IException.h" | ||
#include "IString.h" | ||
#include "MultivariateStatistics.h" | ||
#include "ProcessByLine.h" | ||
#include "ProcessBySample.h" | ||
#include "SpecialPixel.h" | ||
#include "Statistics.h" | ||
#include "findgaps.h" | ||
|
||
using namespace std; | ||
|
||
namespace Isis { | ||
|
||
void findgaps(UserInterface &ui) { | ||
double corTol = ui.GetDouble("CORTOL"); // The correlation tolerance | ||
int bufferSizeBeforeGap = ui.GetInteger("ABOVE"); | ||
int bufferSizeAfterGap = ui.GetInteger("BELOW"); | ||
bool outputCubeSpecified = (ui.GetAsString("TO") != "none"); | ||
bool logFileSpecified = (ui.GetAsString("LOG") != "none"); | ||
|
||
CubeAttributeOutput &att = ui.GetOutputAttribute("TO"); | ||
|
||
Cube *iCube = new Cube(); | ||
iCube->open(ui.GetFileName("FROM"), "r"); | ||
|
||
if (outputCubeSpecified || logFileSpecified) { | ||
ProcessByLine p; | ||
p.SetInputCube(iCube); | ||
|
||
FindGapsFunctor gapsFunctor(iCube->lineCount(), corTol, bufferSizeBeforeGap, | ||
bufferSizeAfterGap); | ||
p.ProcessCubeInPlace(gapsFunctor, false); | ||
|
||
if (outputCubeSpecified) { | ||
gapsFunctor.setModification("NULL buffers added to output cube"); | ||
|
||
p.SetOutputCube(ui.GetFileName("TO"), att); | ||
|
||
p.ProcessCube(gapsFunctor, false); | ||
} | ||
|
||
if (logFileSpecified) { | ||
gapsFunctor.gaps().write(ui.GetFileName("LOG")); | ||
} | ||
} | ||
else { | ||
throw IException(IException::User, | ||
"At least one form of output (a log file or cube) needs to be entered.", | ||
_FILEINFO_); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef findgaps_h | ||
#define findgaps_h | ||
|
||
/** This is free and unencumbered software released into the public domain. | ||
The authors of ISIS do not claim copyright on the contents of this file. | ||
For more details about the LICENSE terms and the AUTHORS, you will | ||
find files of those names at the top level of this repository. **/ | ||
|
||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
#include "UserInterface.h" | ||
|
||
namespace Isis{ | ||
extern void findgaps(UserInterface &ui); | ||
} | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,72 +1,19 @@ | ||
/** | ||
* @file | ||
* $Revision: 1.19 $ | ||
* $Date: 2010/03/22 19:44:53 $ | ||
* | ||
* Unless noted otherwise, the portions of Isis written by the USGS are | ||
* public domain. See individual third-party library and package descriptions | ||
* for intellectual property information, user agreements, and related | ||
* information. | ||
* | ||
* Although Isis has been used by the USGS, no warranty, expressed or | ||
* implied, is made by the USGS as to the accuracy and functioning of such | ||
* software and related material nor shall the fact of distribution | ||
* constitute any such warranty, and no responsibility is assumed by the | ||
* USGS in connection therewith. | ||
* | ||
* For additional information, launch | ||
* $ISISROOT/doc//documents/Disclaimers/Disclaimers.html | ||
* in a browser or see the Privacy & Disclaimers page on the Isis website, | ||
* http://isis.astrogeology.usgs.gov, and the USGS privacy and disclaimers on | ||
* http://www.usgs.gov/privacy.html. | ||
*/ | ||
/** This is free and unencumbered software released into the public domain. | ||
#include "Isis.h" | ||
The authors of ISIS do not claim copyright on the contents of this file. | ||
For more details about the LICENSE terms and the AUTHORS, you will | ||
find files of those names at the top level of this repository. **/ | ||
|
||
#include <QMessageBox> | ||
/* SPDX-License-Identifier: CC0-1.0 */ | ||
|
||
#include "FindGapsFunctor.h" | ||
#include "IException.h" | ||
#include "IString.h" | ||
#include "MultivariateStatistics.h" | ||
#include "ProcessByLine.h" | ||
#include "ProcessBySample.h" | ||
#include "SpecialPixel.h" | ||
#include "Statistics.h" | ||
#include "Isis.h" | ||
#include "findgaps.h" | ||
#include "Application.h" | ||
|
||
using namespace std; | ||
using namespace Isis; | ||
|
||
void IsisMain() { | ||
|
||
UserInterface &ui = Application::GetUserInterface(); | ||
double corTol = ui.GetDouble("CORTOL"); // The correlation tolerance | ||
int bufferSizeBeforeGap = ui.GetInteger("ABOVE"); | ||
int bufferSizeAfterGap = ui.GetInteger("BELOW"); | ||
bool outputCubeSpecified = (ui.GetAsString("TO") != "none"); | ||
bool logFileSpecified = (ui.GetAsString("LOG") != "none"); | ||
|
||
if (outputCubeSpecified || logFileSpecified) { | ||
ProcessByLine p; | ||
Cube *iCube = p.SetInputCube("FROM"); | ||
|
||
FindGapsFunctor gapsFunctor(iCube->lineCount(), corTol, bufferSizeBeforeGap, | ||
bufferSizeAfterGap); | ||
p.ProcessCubeInPlace(gapsFunctor, false); | ||
|
||
if (outputCubeSpecified) { | ||
gapsFunctor.setModification("NULL buffers added to output cube"); | ||
p.SetOutputCube("TO"); | ||
p.ProcessCube(gapsFunctor, false); | ||
} | ||
|
||
if (logFileSpecified) { | ||
gapsFunctor.gaps().write(ui.GetFileName("LOG")); | ||
} | ||
} | ||
else { | ||
throw IException(IException::User, | ||
"At least one form of output (a log file or cube) needs to be entered.", | ||
_FILEINFO_); | ||
} | ||
findgaps(ui); | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.