Skip to content

Commit

Permalink
Added failure for images with missing original label in caminfo (#4999)
Browse files Browse the repository at this point in the history
* Added error for no OriginalLabel in caminfo

* Added changelog entry.

* Updated caminfo tests
  • Loading branch information
amystamile-usgs authored Jul 20, 2022
1 parent 5838acb commit de865f6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ release.
- Re-added and refactored the LRO photometry application lrowacphomap to be callable for testing purposes. Issue: [#4960](https://github.com/USGS-Astrogeology/ISIS3/issues/4960), PR: [#4961](https://github.com/USGS-Astrogeology/ISIS3/pull/4961)
- Added check to determine if poles were a valid projection point in ImagePolygon when generating footprint for a map projected image. [#4390](https://github.com/USGS-Astrogeology/ISIS3/issues/4390)
- Added changes to lronaccal to use time-dependent dark files for dark correction and use of specific dark files for images with exp code of zero. Also added GTests for lronaccal and refactored code to make callable. Added 3 truth cubes to testing directory. PR[#4520](https://github.com/USGS-Astrogeology/ISIS3/pull/4520)
- Added failure for images with missing original label in caminfo. [#4817](https://github.com/USGS-Astrogeology/ISIS3/pull/4817)

### Deprecated

Expand Down
17 changes: 12 additions & 5 deletions isis/src/base/apps/caminfo/caminfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,18 @@ namespace Isis{
}

// Add the orginal label blob
if(ui.GetBoolean("ORIGINALLABEL") && incube->label()->hasObject("OriginalLabel")) {
OriginalLabel orig = incube->readOriginalLabel();
Pvl p = orig.ReturnLabels();
p.setName("OriginalLabel");
params.addObject(p);
if(ui.GetBoolean("ORIGINALLABEL")) {
if (incube->label()->hasObject("OriginalLabel")) {
OriginalLabel orig = incube->readOriginalLabel();
Pvl p = orig.ReturnLabels();
p.setName("OriginalLabel");
params.addObject(p);
}
else {
QString msg = "Could not find OriginalLabel "
"in input file [" + incube->fileName() + "].";
throw IException(IException::User, msg, _FILEINFO_);
}
}

// Add the stats
Expand Down
6 changes: 3 additions & 3 deletions isis/tests/FunctionalTestsCaminfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) {

QString outFileName = tempDir.path() + "/outTemp.csv";
QVector<QString> args = {"to="+outFileName,
"ISISLABEL=true", "ORIGINAL=true", "STATISTICS=true", "CAMSTATS=true",
"ISISLABEL=true", "STATISTICS=true", "CAMSTATS=true",
"POLYGON=true", "polysinc=100", "polylinc=100"};

UserInterface options(APP_XML, args);
Expand Down Expand Up @@ -367,7 +367,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoDefault) {
TEST_F(DefaultCube, FunctionalTestCaminfoPoly) {
QString outFileName = tempDir.path() + "/outTemp.pvl";
QVector<QString> args = {"from="+ testCube->fileName(), "to="+outFileName,
"ISISLABEL=false", "ORIGINAL=false", "STATISTICS=false", "CAMSTATS=false",
"ISISLABEL=false", "STATISTICS=false", "CAMSTATS=false",
"POLYGON=true", "inctype=vertices", "numvertices=3"};

UserInterface options(APP_XML, args);
Expand Down Expand Up @@ -398,7 +398,7 @@ TEST_F(DefaultCube, FunctionalTestCaminfoPoly) {
TEST_F(DefaultCube, FunctionalTestCaminfoBoundary) {
QString outFileName = tempDir.path() + "/outTemp.cub";
QVector<QString> args = {"from="+ testCube->fileName(), "to="+outFileName,
"ISISLABEL=false", "ORIGINAL=false", "STATISTICS=true", "CAMSTATS=true",
"ISISLABEL=false", "STATISTICS=true", "CAMSTATS=true",
"POLYGON=true", "LINC=25", "SINC=25", "POLYSINC=100", "POLYLINC=100"};

UserInterface options(APP_XML, args);
Expand Down

0 comments on commit de865f6

Please sign in to comment.