From d2486e7f0925e8b57a97583a8ac0c5e26cf24ef4 Mon Sep 17 00:00:00 2001
From: Christine Kim <125395064+chkim-usgs@users.noreply.github.com>
Date: Mon, 13 Jan 2025 11:33:55 -0500
Subject: [PATCH] Jigsaw Fixes (#5703)
* Add some fixes
* Update changelog
* Require update
* Test fix
---
CHANGELOG.md | 1 +
isis/src/control/apps/jigsaw/jigsaw.cpp | 2 +-
isis/src/control/apps/jigsaw/jigsaw.xml | 11 ++++++-----
isis/tests/FunctionalTestsJigsaw.cpp | 9 +++++----
4 files changed, 13 insertions(+), 10 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b7b9406401..9c9320cdc5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -42,6 +42,7 @@ release.
### Fixed
- Fixed kaguyatc2isis invalid BandBin values [#5629](https://github.com/DOI-USGS/ISIS3/issues/5629)
- Fixed SpiceClient to handle redirect requests.
+- Fixed jigsaw to default OUTADJUSTMENTH5 option to false and allow this feature to run on read-only images [#5700](https://github.com/DOI-USGS/ISIS3/issues/5700)
## [9.0.0] - 09-25-2024
diff --git a/isis/src/control/apps/jigsaw/jigsaw.cpp b/isis/src/control/apps/jigsaw/jigsaw.cpp
index 9dc7bac4ce..91d906c002 100644
--- a/isis/src/control/apps/jigsaw/jigsaw.cpp
+++ b/isis/src/control/apps/jigsaw/jigsaw.cpp
@@ -240,7 +240,7 @@ namespace Isis {
for (int i = 0; i < bundleAdjustment->numberOfImages(); i++) {
Process p;
CubeAttributeInput inAtt;
- Cube *c = p.SetInputCube(bundleAdjustment->fileName(i), inAtt, ReadWrite);
+ Cube *c = p.SetInputCube(bundleAdjustment->fileName(i), inAtt, 0); // 0 for read only
// Only for ISIS adjustment values
if (!c->hasBlob("CSMState", "String")) {
diff --git a/isis/src/control/apps/jigsaw/jigsaw.xml b/isis/src/control/apps/jigsaw/jigsaw.xml
index 1dc590d335..b5f57b3bb8 100644
--- a/isis/src/control/apps/jigsaw/jigsaw.xml
+++ b/isis/src/control/apps/jigsaw/jigsaw.xml
@@ -921,9 +921,6 @@
- No
-
- - ADJUSTMENT_INPUT
-
@@ -1880,7 +1877,7 @@
boolean
- - yes
+ - no
@@ -1898,6 +1895,11 @@
*.h5
+
+ -
+ UPDATE
+
+
- ONET
- CNET
@@ -1907,7 +1909,6 @@
- SCCONFIG
- OBSERVATIONS
- RADIUS
- - UPDATE
- OUTLIER_REJECTION
- REJECTION_MULTIPLIER
- ERRORPROPAGATION
diff --git a/isis/tests/FunctionalTestsJigsaw.cpp b/isis/tests/FunctionalTestsJigsaw.cpp
index 6135b34b31..b8fcfa9d15 100644
--- a/isis/tests/FunctionalTestsJigsaw.cpp
+++ b/isis/tests/FunctionalTestsJigsaw.cpp
@@ -1875,12 +1875,13 @@ TEST_F(LidarNetwork, FunctionalTestJigsawLidar) {
TEST_F(ApolloNetwork, FunctionalTestJigsawSaveApplyValues) {
QVector args = {"spsolve=position",
- "update=yes",
+ "update=no",
"bundleout_txt=no",
"cnet="+controlNetPath,
"fromlist="+tempDir.path() + "/cubes.lis",
"onet="+tempDir.path()+"/apollo_out.net",
- "file_prefix="+tempDir.path()+"/"};
+ "file_prefix="+tempDir.path()+"/",
+ "outadjustmenth5=yes"};
UserInterface ui(APP_XML, args);
@@ -1888,7 +1889,7 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawSaveApplyValues) {
// Check apollo_jigsaw.h5 was created
QString bundleOutput = tempDir.path()+"/adjustment_out.h5";
- HighFive::File file(bundleOutput.toStdString(), HighFive::File::ReadWrite);
+ HighFive::File file(bundleOutput.toStdString(), HighFive::File::ReadOnly);
std::string datasetName = "/APOLLO15/METRIC/1971-08-01T15:37:39.428";
QString cmatrixName = "InstrumentPointing";
@@ -1899,7 +1900,7 @@ TEST_F(ApolloNetwork, FunctionalTestJigsawSaveApplyValues) {
HighFive::DataSet datasetRead = file.getDataSet(cmatrixKey);
auto cmatrixData = datasetRead.read();
Table cmatrixTable(cmatrixName, cmatrixData, ',');
- std::string cmatrixTableStr = Table::toString(cmatrixTable).toStdString();
+ std::string cmatrixTableStr = Table::toString(cmatrixTable).toStdString();
datasetRead = file.getDataSet(spvectorKey);
auto spvectorData = datasetRead.read();