From a3e21f1c0b26ab169bc962fab11c14acad5e58f4 Mon Sep 17 00:00:00 2001
From: Christine Kim <125395064+chkim-usgs@users.noreply.github.com>
Date: Thu, 17 Aug 2023 11:57:15 -0700
Subject: [PATCH] cubeit attribute fix (#5268)
* cubeit attribute fix
* Update changelog
---
CHANGELOG.md | 1 +
isis/src/base/objs/Cube/Cube.cpp | 13 +++++++++----
2 files changed, 10 insertions(+), 4 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bc91829f99..c69f6bed0f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -63,6 +63,7 @@ release.
- Fixed findfeatures use of projected mosaics with correct check for TargetName in the Mapping labels. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
- Fixed a bug in the cnetwinnow test that did not clean/remove it during test runs.
- Fixed findfeatures instantiation and use of projection classes to correctly return geometry data from projected images and mosaics. [#4772](https://github.com/DOI-USGS/ISIS3/issues/4772)
+- Fixed `cubeit` attribute error to allow attribute specification on the output cube filename [#5234](https://github.com/DOI-USGS/ISIS3/issues/5234)
## [8.0.0] - 2023-04-19
diff --git a/isis/src/base/objs/Cube/Cube.cpp b/isis/src/base/objs/Cube/Cube.cpp
index 4cd3594f75..b55507cd51 100644
--- a/isis/src/base/objs/Cube/Cube.cpp
+++ b/isis/src/base/objs/Cube/Cube.cpp
@@ -629,10 +629,15 @@ namespace Isis {
initLabelFromFile(cubeFileName, (access == "rw"));
- Isis::CubeAttributeInput att(cubeFileName);
- if(att.bands().size() != 0) {
- vector bands = att.bands();
- setVirtualBands(bands);
+ try {
+ Isis::CubeAttributeInput att(cubeFileName);
+ if(att.bands().size() != 0) {
+ vector bands = att.bands();
+ setVirtualBands(bands);
+ }
+ } catch(IException& e) {
+ // Either the cube is an output cube that has already been opened or
+ // there is an exception parsing and adding an attribute
}
// Figure out the name of the data file
--
GitLab