Skip to content
Snippets Groups Projects
Unverified Commit ae7eccf3 authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

8.0.4 LTS Release Prep (#5686)


* Adds HRSC support in socetlinescankeywords (#5669)

* Adds HRSC support in socetlinescankeywords

* Add test cube

* Fixed tests

* Converted skypt to a callable app. Converted existing Makefile tests to gtests. Removed existing Makefile tests.  (#5444)

* Converted skypt to a callable app. Converted existing makefile tests to gtest format and removed old makefile tests and data. Addresses #5443.

* Updated contributor list to add Sarah S. Sutton. Addresses #5443.

---------

Co-authored-by: default avatarSarah Sutton <ssutton@dhcp-10-142-214-177.uawifi.arizona.edu>

* Noseam has been refactored to be callable. Makefile test has been converted to a gtest and removed. (#5600)

* Noseam has been refactored to be callable. Makefile test has been converted to a gtest and removed. Addresses #5599.

* Modifications to address gtest failures. Also added addtional input parameter error checking to ensure noseam exits prior to generation of temporary files. Finally modified gtests to remove the print.prt file if generated. Addresses #5599.

* The explode application has been refactored to be callable and Makefile test converted to a gtest. (#5590)

* Updated explode application gtest to use DefaultCube fixture instead of cube in isis/tests/data. Addresses #5557.

* Cleaned up includes in default explode gtest. Added history entry to explode.xml. Addresses #5557.

* Updating main.cpp and removed Makefile tests for explode conversion to callable app. Addresses #5557.

* Added CHANGELOG entry for conversion of explode app to callable function. Addresses #5557.

---------

Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>

* Isisminer has been refactored to be callable and Makefile tests converted to gtest format (#5579)

* Fixed minor misspellings in error messages. Addresses #5516.

* Test data added for isisminer. Addresses #5516.

* Converted isisminer Makefile tests to gtest format. Addresses #5516.

* Converted isisminer application to callable function. Addresses #5516.

* Minor tweak to isisminer csvwriter test. Addresses #5516.

* Added compareCsvLineCustomDelimiter method, specifically for isisminer testing support. Addresses #5516.

* Removed isisminer Makefile tests (replaced by gtests) and updated CHANGELOG reflecting conversion of isisminer to callable app. Addresses #5516.

* Replace isis cube in /isis/tests/data/isisminer/gistest with isd and label files. Minor tweaks to FunctionalTestsIsisminer.cpp. History entry added to isisminer.xml. Addresses #5516.

* Minor changes for conversion of isisminer to callable app. Addresses #5516.

* Had to add data file index.lbl to the .gitignore file for it to be uploaded. Addresses #5516.

* Algebra has been refactored to be callable; old Makefile tests have been converted to gtests and removed. Addresses #5594. (#5597)

* Photrim has been refactored to be callable; old Makefile tests have been converted to gtests and removed. (#5582)

* Photrim has been converted to a callable app. Corresponding Makefile tests have been converted to gtests and removed. Addresses #5581.

* Tweaks to FunctionalTestsPhotrim.cpp. Addresses #5581.

* Bandtrim has been refactored to be callable; old Makefile tests have been converted to gtests. (#5572)

* Bandtrim has been refactored to be callable; old Makefile tests have been removed and replaced by gtests. Addresses #5571.

* Update FunctionalTestsBandtrim.cpp

Minor documentation change.

* Updated kaguyasp2ascii to support newer (detached) data (#5568)

* Modified to work with new (detached) data

* Updated changelog

* Allow data specification outside current directory

* Jigsaw csm error message (#5562)

* Added fail-early + error message for csminit'd images without csm solve parameters

* Updated changelog

* Bug fix in noproj to remove persistent temporary lbl file (#5578)

* Added line to close match cube in noproj.cpp. Not closing the cube resulted in a temporary "*.lbl" file that remained after running the noproj application. Addresses #5577.

* CHANGELOG entry for noproj bug fix. Addresses #5577.

* Added history entry in noproj.xml. Addresses #5577.

* Remove restrictive validity check in caminfo (#5553)

* Removed preemptive validity check for polygon

* Removed unused import

* Updated changelog

* Qview command line Fix (#5505)

* Avoid double image load when opening cubes from cmdline in qview

* Added changelog entry

* Revert interval change

* Change qt to qt-main

* Update deps and pcl cmake

* Add float.h

* CsmSerialNumber.trn - typo and PVL compilant fix (#5561)

* Fixed typo

* PVL compliant

* PR feedback changes

* hrsc2isis support for level 3 images (#5560)

* Remove label check for level3

* update changelog

* fix test

* addressed PR feedback

* fixed grammar

* Fixed gllssi2isis to support V1.1 data (#5570)

* Removed a debug output statement inadvertently left in noseam.cpp. Addresses #5660. (#5661)

* Bug fixes to address incorrect handling of RADIUS in the jigsaw GUI and in the bundleout.txt file when performing a rectangular (XYZ) bundle adjustment, originally implemented in UofA OSIRIS-REx code on 2019-07-30. Addresses #5642. (#5643)

* The RADIUS checkbox in the GUI is excluded when a RECTANGULAR solution is selected.

* In the bundleout.txt file, for rectangular solutions, 1) RADIUS is set to N/A in the SOLVE OPTIONS section; and 2) the POINTS UNCERTAINTY SECTION was fixed to properly display adjusted point uncertainty statistics with Error Propagation turned on.

* Spacing for point labels was cleaned up in the INPUT: GLOBAL IMAGE PARAMETER UNCERTAINTIES section.

* Finally, a slight modification was added to the FunctionalTestJigsawBundleXYZ ctest to verify that RADIUS is N/A in a RECTANGULAR solution.

* Updated kaguyasp2ascii to support newer (detached) data (#5568)

* Modified to work with new (detached) data

* Updated changelog

* Allow data specification outside current directory

* Speeds up FunctionalTestCamstatsDefaultParameters (#5647)

* speed up camstats

* add changelog

* fixes photomet not accepting backplanes (#5658)

* fixes photomet not accepting backplanes

* fix changelog

* Converted to gtests

* Add input cube attributes

* Convert dstripe to gtests (#5665)

* Convert dstripe to gtests

* add changelog

* Fixed build error

* trigger build

* trigger build

* Update docs

---------

Co-authored-by: default avatarAmy Stamile <74275278+amystamile-usgs@users.noreply.github.com>
Co-authored-by: default avatarSarah Sutton <ssutton@lpl.arizona.edu>
Co-authored-by: default avatarSarah Sutton <ssutton@dhcp-10-142-214-177.uawifi.arizona.edu>
Co-authored-by: default avatarkledmundson <6842706+kledmundson@users.noreply.github.com>
Co-authored-by: default avatarAdam Paquette <acpaquette@usgs.gov>
Co-authored-by: default avatarAustin Sanders <arsanders@usgs.gov>
Co-authored-by: default avatarShin-ya Murakami <86389420+murashinln@users.noreply.github.com>
parent 5ac230a8
No related branches found
No related tags found
No related merge requests found
Showing
with 515 additions and 241 deletions
#include "Isis.h"
#include "ProcessByBrick.h"
#include "SpecialPixel.h"
/** This is free and unencumbered software released into the public domain.
using namespace std;
using namespace Isis;
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. **/
void BandTrim(Buffer &in, Buffer &out);
/* SPDX-License-Identifier: CC0-1.0 */
void IsisMain() {
ProcessByBrick p;
Cube *icube = p.SetInputCube("FROM");
p.SetBrickSize(1, 1, icube->bandCount());
p.SetOutputCube("TO");
p.StartProcess(BandTrim);
p.EndProcess();
}
#include "Isis.h"
// Trim spectral pixels if anyone of them is null
void BandTrim(Buffer &in, Buffer &out) {
// Copy input to output and check to see if we should null
bool nullPixels = false;
for(int i = 0; i < in.size(); i++) {
out[i] = in[i];
if(in[i] == Isis::Null) nullPixels = true;
}
#include "bandtrim.h"
// Null all pixels in the spectra if necessary
if(nullPixels) {
for(int i = 0; i < in.size(); i++) {
out[i] = Isis::Null;
}
}
#include "Application.h"
using namespace Isis;
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
bandtrim(ui);
}
BLANKS = "%-6s"
LENGTH = "%-40s"
include $(ISISROOT)/make/isismake.tststree
APPNAME = bandtrim
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) FROM=$(INPUT)/input.cub TO=$(OUTPUT)/truth.cub > /dev/null;
APPNAME = bandtrim
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) FROM=$(INPUT)/input.cub TO=$(OUTPUT)/truth.cub > /dev/null;
/** 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 "dstripe.h"
#include <QFile>
#include "Application.h"
#include "ProcessByLine.h"
#include "ProgramLauncher.h"
#include "SpecialPixel.h"
using namespace std;
namespace Isis {
void difference(vector<Buffer *> &input, vector<Buffer *> &output);
void dstripe(UserInterface &ui) {
Cube icube;
CubeAttributeInput inAtt = ui.GetInputAttribute("FROM");
if (inAtt.bands().size() != 0) {
icube.setVirtualBands(inAtt.bands());
}
icube.open(ui.GetCubeName("FROM"));
dstripe(&icube, ui);
}
void dstripe(Cube *icube, UserInterface &ui) {
ProcessByLine p;
int highLines, highSamples, lowLines, lowSamples;
p.SetInputCube(icube);
// Get the boxcar sizes to be used by the low and highpass filters
// All numbers have to be odd. If nothing is entered into the UI,
// NS and/or NL are used.
if (ui.GetString("MODE") == "VERTICAL") {
if (ui.WasEntered("VHNS")) {
highSamples = ui.GetInteger("VHNS");
} else {
highSamples = icube->sampleCount();
if (highSamples % 2 == 0) highSamples -= 1;
}
if (ui.WasEntered("VLNL")) {
lowLines = ui.GetInteger("VLNL");
} else {
lowLines = icube->lineCount();
if (lowLines % 2 == 0) lowLines -= 1;
}
lowSamples = ui.GetInteger("VLNS");
highLines = ui.GetInteger("VHNL");
} else {
if (ui.WasEntered("HHNL")) {
highLines = ui.GetInteger("HHNL");
} else {
highLines = icube->lineCount();
if (highLines % 2 == 0) highLines -= 1;
}
if (ui.WasEntered("HLNS")) {
lowSamples = ui.GetInteger("HLNS");
} else {
lowSamples = icube->sampleCount();
if (lowSamples % 2 == 0) lowSamples -= 1;
}
highSamples = ui.GetInteger("HHNS");
lowLines = ui.GetInteger("HLNL");
}
// 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.GetCubeName("FROM");
lowParams += " to= " + tempFileName + " ";
lowParams += " samples= " + toString(lowSamples);
lowParams += " lines= " + toString(lowLines);
ProgramLauncher::RunIsisProgram("lowpass", lowParams);
// Make a copy of the lowpass filter results if the user wants it
if (!ui.GetBoolean("DELETENOISE")) {
QString lowParams = "";
lowParams += "from= " + ui.GetCubeName("FROM");
lowParams += " to= " + ui.GetCubeName("LPFNOISE");
lowParams += " samples= " + toString(lowSamples);
lowParams += " lines= " + toString(lowLines);
ProgramLauncher::RunIsisProgram("lowpass", lowParams);
}
// 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= " + tempFileName + " ";
highParams += " to= " + tempNoiseFileName + " ";
highParams += " samples= " + toString(highSamples);
highParams += " lines= " + toString(highLines);
ProgramLauncher::RunIsisProgram("highpass", highParams);
QFile::remove(tempFileName);
// Take the difference (FROM-NOISE) and write it to output
CubeAttributeInput inatt;
p.SetInputCube(tempNoiseFileName, inatt);
CubeAttributeOutput &outatt = ui.GetOutputAttribute("TO");
p.SetOutputCube(ui.GetCubeName("TO"), outatt);
p.StartProcess(difference);
p.EndProcess();
if (ui.GetBoolean("DELETENOISE")) {
QFile::remove(tempNoiseFileName);
}
}
// Subtracts noise from the input buffer, resulting in a cleaner output image
void difference(vector<Buffer *> &input, vector<Buffer *> &output) {
Buffer &from = *input[0];
Buffer &noise = *input[1];
Buffer &to = *output[0];
for(int i = 0; i < from.size(); i++) {
if(IsSpecial(from[i]) || IsSpecial(noise[i])) {
to[i] = from[i];
}
else {
to[i] = from[i] - noise[i];
}
}
}
} // namespace Isis
\ No newline at end of file
/** 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 */
#ifndef dstripe_h
#define dstripe_h
#include "Cube.h"
#include "UserInterface.h"
namespace Isis {
extern void dstripe(Cube *icube, UserInterface &ui);
extern void dstripe(UserInterface &ui);
}
#endif
\ No newline at end of file
#include "Isis.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. **/
#include <QFile>
/* SPDX-License-Identifier: CC0-1.0 */
#include "Isis.h"
#include "dstripe.h"
#include "Application.h"
#include "ProcessByLine.h"
#include "ProgramLauncher.h"
#include "SpecialPixel.h"
using namespace std;
using namespace Isis;
void difference(vector<Buffer *> &input, vector<Buffer *> &output);
void IsisMain() {
ProcessByLine p;
Cube *icube = p.SetInputCube("FROM");
UserInterface &ui = Application::GetUserInterface();
int highLines, highSamples, lowLines, lowSamples;
// Get the boxcar sizes to be used by the low and highpass filters
// All numbers have to be odd. If nothing is entered into the UI,
// NS and/or NL are used.
if(ui.GetString("MODE") == "VERTICAL") {
if(ui.WasEntered("VHNS")) {
highSamples = ui.GetInteger("VHNS");
}
else {
highSamples = icube->sampleCount();
if(highSamples % 2 == 0) highSamples -= 1;
}
if(ui.WasEntered("VLNL")) {
lowLines = ui.GetInteger("VLNL");
}
else {
lowLines = icube->lineCount();
if(lowLines % 2 == 0) lowLines -= 1;
dstripe(ui);
}
lowSamples = ui.GetInteger("VLNS");
highLines = ui.GetInteger("VHNL");
}
else {
if(ui.WasEntered("HHNL")) {
highLines = ui.GetInteger("HHNL");
}
else {
highLines = icube->lineCount();
if(highLines % 2 == 0) highLines -= 1;
}
if(ui.WasEntered("HLNS")) {
lowSamples = ui.GetInteger("HLNS");
}
else {
lowSamples = icube->sampleCount();
if(lowSamples % 2 == 0) lowSamples -= 1;
}
highSamples = ui.GetInteger("HHNS");
lowLines = ui.GetInteger("HLNL");
}
// 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.GetCubeName("FROM");
lowParams += " to= " + tempFileName + " ";
lowParams += " samples= " + toString(lowSamples);
lowParams += " lines= " + toString(lowLines);
ProgramLauncher::RunIsisProgram("lowpass", lowParams);
// Make a copy of the lowpass filter results if the user wants it
if(!ui.GetBoolean("DELETENOISE")) {
QString lowParams = "";
lowParams += "from= " + ui.GetCubeName("FROM");
lowParams += " to= " + ui.GetCubeName("LPFNOISE");
lowParams += " samples= " + toString(lowSamples);
lowParams += " lines= " + toString(lowLines);
ProgramLauncher::RunIsisProgram("lowpass", lowParams);
}
// 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= "+tempFileName + " ";
highParams += " to= " + tempNoiseFileName + " ";
highParams += " samples= " + toString(highSamples);
highParams += " lines= " + toString(highLines);
ProgramLauncher::RunIsisProgram("highpass", highParams);
QFile::remove(tempFileName);
// Take the difference (FROM-NOISE) and write it to output
CubeAttributeInput att;
p.SetInputCube(tempNoiseFileName, att);
p.SetOutputCube("TO");
p.StartProcess(difference);
p.EndProcess();
if(ui.GetBoolean("DELETENOISE")) {
QFile::remove(tempNoiseFileName);
}
}
// Subtracts noise from the input buffer, resulting in a cleaner output image
void difference(vector<Buffer *> &input, vector<Buffer *> &output) {
Buffer &from = *input[0];
Buffer &noise = *input[1];
Buffer &to = *output[0];
for(int i = 0; i < from.size(); i++) {
if(IsSpecial(from[i]) || IsSpecial(noise[i])) {
to[i] = from[i];
}
else {
to[i] = from[i] - noise[i];
}
}
}
BLANKS = "%-6s"
LENGTH = "%-40s"
include $(ISISROOT)/make/isismake.tststree
APPNAME = dstripe
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub \
to=$(OUTPUT)/dstrTruth1.cub > /dev/null;
APPNAME = dstripe
include $(ISISROOT)/make/isismake.tsts
commands:
cat $(INPUT)/root.lis | xargs -n1 -P 2 -IX $(APPNAME) from=$(INPUT)/X.cub to=$(OUTPUT)/X.dstr.cub mode=vert vlnl=51 vhns=51 > /dev/null;
/** 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 "explode.h"
#include "ProcessByLine.h"
#include "IException.h"
#include "FileName.h"
namespace Isis {
// Line processing routine
void CopyBand(Buffer &in, Buffer &out);
/**
* Extracts each band of the input cube into a separate one band cube file.
* Given the output base name of "base", each output cube will be named
* e.g. base.band#.cub. The appropiate BandBin group will be created.
*
* @param ui User Interface with application parameters
*/
void explode(UserInterface &ui) {
// open input cube
Cube icube;
icube.open(ui.GetCubeName("FROM"));
explode(&icube, ui);
}
/**
* Extracts each band of the input cube into a separate one band cube file.
* Given the output base name of "base", each output cube will be named
* e.g. base.band#.cub. The appropiate BandBin group will be created.
*
* @param ui User Interface with application parameters
* @param icube Input cube
*/
void explode(Cube *icube, UserInterface &ui) {
Process p;
p.SetInputCube(icube);
int samps = icube->sampleCount();
int lines = icube->lineCount();
int bands = icube->bandCount();
QString infile = icube->fileName();
// We get the output filename so we can add attributes and extensions
QString outbase = ui.GetCubeName("TO");
CubeAttributeOutput &outatt = ui.GetOutputAttribute("TO");
// Loop and extract each band
for(int band = 1; band <= bands; band++) {
int pband = icube->physicalBand(band);
QString sband(toString(pband));
ProcessByLine p2;
Progress *prog = p2.Progress();
prog->SetText("Exploding band " + sband);
CubeAttributeInput inatt("+" + sband);
p2.SetInputCube(infile, inatt);
QString outfile = outbase + ".band";
if(pband / 1000 == 0) {
outfile += "0";
if(pband / 100 == 0) {
outfile += "0";
if(pband / 10 == 0) {
outfile += "0";
}
}
}
outfile += sband + ".cub";
p2.SetOutputCube(outfile, outatt, samps, lines, 1);
p2.StartProcess(CopyBand);
p2.EndProcess();
}
// Cleanup
p.EndProcess();
}
// Line processing routine
void CopyBand(Buffer &in, Buffer &out) {
for(int i = 0; i < in.size(); i++) {
out[i] = in[i];
}
}
}
/** 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 */
#ifndef explode_h
#define explode_h
#include "UserInterface.h"
namespace Isis{
extern void explode(UserInterface &ui);
extern void explode(Cube *icube, UserInterface &ui);
}
#endif
......@@ -35,6 +35,9 @@
<change name="Steven Lambright" date="2008-05-12">
Removed references to CubeInfo
</change>
<change name="Ken Edmundson" date="2024-08-15">
Converted to callable app and converted Makefile test to gtest.
</change>
</history>
<groups>
......
#include "Isis.h"
#include "ProcessByLine.h"
#include "IException.h"
#include "FileName.h"
/** This is free and unencumbered software released into the public domain.
using namespace std;
using namespace Isis;
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. **/
void CopyBand(Buffer &in, Buffer &out);
/* SPDX-License-Identifier: CC0-1.0 */
void IsisMain() {
// Get the cube to explode
Process p;
Cube *icube = p.SetInputCube("FROM");
int samps = icube->sampleCount();
int lines = icube->lineCount();
int bands = icube->bandCount();
QString infile = icube->fileName();
// We the output filename so we can add attributes and extensions
UserInterface &ui = Application::GetUserInterface();
QString outbase = ui.GetCubeName("TO");
CubeAttributeOutput &outatt = ui.GetOutputAttribute("TO");
// Loop and extract each band
for(int band = 1; band <= bands; band++) {
int pband = icube->physicalBand(band);
QString sband(toString(pband));
ProcessByLine p2;
Progress *prog = p2.Progress();
prog->SetText("Exploding band " + sband);
CubeAttributeInput inatt("+" + sband);
p2.SetInputCube(infile, inatt);
#include "Isis.h"
QString outfile = outbase + ".band";
if(pband / 1000 == 0) {
outfile += "0";
if(pband / 100 == 0) {
outfile += "0";
if(pband / 10 == 0) {
outfile += "0";
}
}
}
outfile += sband + ".cub";
p2.SetOutputCube(outfile, outatt, samps, lines, 1);
#include "explode.h"
p2.StartProcess(CopyBand);
p2.EndProcess();
}
#include "Application.h"
// Cleanup
p.EndProcess();
}
using namespace Isis;
// Line processing routine
void CopyBand(Buffer &in, Buffer &out) {
for(int i = 0; i < in.size(); i++) {
out[i] = in[i];
}
void IsisMain() {
UserInterface &ui = Application::GetUserInterface();
explode(ui);
}
BLANKS = "%-6s"
LENGTH = "%-40s"
include $(ISISROOT)/make/isismake.tststree
APPNAME = explode
include $(ISISROOT)/make/isismake.tsts
commands:
$(APPNAME) from=$(INPUT)/isisTruth.cub \
to= $(OUTPUT)/explTruth1 > /dev/null;
......@@ -61,7 +61,7 @@ namespace Isis {
* @param definition ResourceManager Strategy PVL object
* definition
* @param globals List of global keywords to use in argument substitutions
* @throw IException::User "Invalid operations requestined in ResourceManager."
* @throw IException::User "Invalid operations requested in ResourceManager."
*/
ResourceManagerStrategy::ResourceManagerStrategy(const PvlObject &definition,
const ResourceList &globals) :
......@@ -89,7 +89,7 @@ namespace Isis {
// Handle any errors encountered
if ( !exceptions.empty() ) {
IException ie(IException::User,
"Invalid operations requestined in ResourceManager.",
"Invalid operations requested in ResourceManager.",
_FILEINFO_);
BOOST_FOREACH ( IException e, exceptions ) {
ie.append(e);
......
......@@ -64,6 +64,7 @@ namespace Isis {
* @history 2015-05-08 Kris Becker - Modify constructor to take a global
* resources list; modified apply() method to accept
* a global resource list.
* @history 2024-07-15 Ken Edmundson - Fixed minor mispellings in error messages.
*/
class ResourceManagerStrategy : public Strategy {
......
/** 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 */
// std library
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
// Qt library
#include <QList>
#include <QScopedPointer>
//#include <QString>
#include <QStringList>
#include <QTime>
#include <QElapsedTimer>
// boost library
#include <boost/foreach.hpp>
// ISIS
#include "Application.h"
#include "Database.h"
#include "FileName.h"
#include "GisGeometry.h"
#include "IString.h"
#include "Progress.h"
#include "Pvl.h"
#include "PvlFlatMap.h"
#include "Resource.h"
#include "SqlQuery.h"
#include "SqlRecord.h"
#include "Strategy.h"
#include "StrategyFactory.h"
#include "isisminer.h"
using namespace std;
namespace Isis {
// Program constants
const QString isisminer_program = "isisminer";
const QString isisminer_version = "1.0";
const QString isisminer_revision = "$Revision: 6513 $";
const QString isisminer_runtime = Application::DateTime();
/**
* Isisminer assists in the identification, manipulation,
* and output of data from a variety of data sources. It
* runs a series of algorithms (or Strategies) that perform
* various operations on input sources (or Resources).
*
* @param ui UserInterface object containing parameters
*/
void isisminer(UserInterface &ui) {
// File containing isisminer configuration run
QString configFile = ui.GetFileName("CONFIG");
// open optional, global parameter file if provided
// file is for use in global variable pool
if ( ui.WasEntered("GLOBALS") ) {
Pvl pvl_globals(ui.GetFileName("GLOBALS"));
return isisminer(configFile, ui, &pvl_globals);
}
return isisminer(configFile, ui);
}
/**
* Isisminer assists in the identification, manipulation,
* and output of data from a variety of data sources. It
* runs a series of algorithms (or Strategies) that perform
* various operations on input sources (or Resources).
*
* @param ui UserInterface object containing parameters
*
* @throws IException::User "Ill-formed PARAMETERS [PARAMETERS] - use form @key:val"
*
*/
void isisminer(QString &configFileName, UserInterface &ui,
Pvl *pvl_globals) {
StrategyFactory *factory = StrategyFactory::instance();
SharedResource globals(new Resource("Globals"));
globals->add("Program", isisminer_program);
globals->add("Version", isisminer_version);
globals->add("Revision", isisminer_revision);
globals->add("RunTime", isisminer_runtime);
// File containing isisminer configuration run
globals->add("CONFIG", configFileName);
// Add parameters provided by user to global resources
if ( ui.WasEntered("PARAMETERS") ) {
QString parameters = ui.GetString("PARAMETERS");
globals->add("PARAMETERS", parameters);
// Split by separate parameters
QStringList parmlist = parameters.split("@", Qt::SkipEmptyParts);
BOOST_FOREACH (QString parm, parmlist) {
// Split values from keyword name
QStringList keyval = parm.split(":", Qt::SkipEmptyParts);
if ( keyval.size() != 2 ) {
QString mess = "Ill-formed PARAMETERS (" + parm + ") - use form @key:val";
throw IException(IException::User, mess, _FILEINFO_);
}
// Now split multi string values and construct the Pvl keyword
QString keyname = keyval[0];
QStringList values = keyval[1].split(",", Qt::SkipEmptyParts);
PvlKeyword keyword(keyname);
BOOST_FOREACH ( QString val, values) {
keyword.addValue(val);
}
// Add the parameter to global parameters
globals->add(keyword);
}
}
// Add to factory
factory->addGlobal(globals);
// If provided, load optional, global parameter
// file for use in global variable pool
if ( pvl_globals != nullptr ) {
SharedResource gfile(new Resource("GlobalFileResources", PvlFlatMap(*pvl_globals)));
factory->addGlobal(gfile);
globals->add("GLOBALS", ui.GetFileName("GLOBALS"));
}
// Create strategies (computations, constraints, ranks, sorts, etc...)
cout << "\nCreating strategies...\n";
StrategyList strategies = factory->buildRun(configFileName);
cout << "Finished creating " << factory->manufactured() << " strategies...\n";
// Input resource list preserved for subsequent processing
ResourceList resources;
QTime runTime = QTime::currentTime();
BOOST_FOREACH ( SharedStrategy strategy, strategies ) {
QTime stime = QTime::currentTime();
cout << "\nRunning " << strategy->type() << "::" << strategy->name()
<< " (TimeIn: " << stime.toString("hh:mm:ss.zzz")
<< ")\n"
<< "Description: " << strategy->description() << "\n";
QElapsedTimer stimer;
stimer.start();
int n = strategy->apply(resources);
unsigned int ntotal = strategy->totalProcessed();
cout << n << " of " << ntotal << " processed in "
<< strategy->type() << "::" << strategy->name()
<< " (TimeOut: " << QTime::currentTime().toString("hh:mm:ss.zzz") << ")\n";
cout << "ElapsedTime(s): " << stimer.elapsed() / 1000 << "\n";
}
// Get total elapsed time
QTime totalT(0,0);
totalT = totalT.addMSecs(runTime.msecsTo(QTime::currentTime()));
cout << "\nSession complete in " << totalT.toString("hh:mm:ss.zzz")
<< " of elapsed time\n";
return;
}
}
/** 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 */
#ifndef isisminer_h
#define isisminer_h
#include "Pvl.h"
#include "UserInterface.h"
#include <QString>
namespace Isis{
extern void isisminer(UserInterface &ui);
extern void isisminer(QString &configFileName, UserInterface &ui,
Pvl *pvl_globals=nullptr);
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment