From ef35abd2bb9030dbc442ff3cf109d5a49b445c5c Mon Sep 17 00:00:00 2001
From: Austin Sanders <arsanders@usgs.gov>
Date: Tue, 14 Jan 2025 10:48:50 -0700
Subject: [PATCH] Updates for 9.0.0 RC2 (#5706)

* Jigsaw Fixes (#5703)

* Add some fixes

* Update changelog

* Require update

* Test fix

* Version ticks for RC2

* Fix truth data for isis 9.0

* Moved bugfix version and rc back to appended string

---------

Co-authored-by: Christine Kim <125395064+chkim-usgs@users.noreply.github.com>
---
 CHANGELOG.md                                     |  1 +
 isis/src/base/objs/Environment/Environment.truth |  2 +-
 isis/src/control/apps/jigsaw/jigsaw.cpp          |  2 +-
 isis/src/control/apps/jigsaw/jigsaw.xml          | 11 ++++++-----
 isis/tests/FunctionalTestsJigsaw.cpp             |  9 +++++----
 recipe/meta.yaml                                 |  4 ++--
 6 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 6b447be92a..b7cabe3e30 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -64,6 +64,7 @@ file. Slightly modified the FunctionalTestJigsawBundleXYZ ctest accordingly. Iss
 - Fixed PHOTOMET not accepting backplanes [#5281](https://github.com/DOI-USGS/ISIS3/issues/5281)
 - Fixed dstripe parallel test failing by converting tests to gtests [#5613](https://github.com/DOI-USGS/ISIS3/issues/5613)
 - Fixed autoseed SeedDomain = SampleLine only working for first overlap [#5673](https://github.com/DOI-USGS/ISIS3/issues/5673)
+- 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)
 
 ## [8.3.0] - 2024-09-30
 
diff --git a/isis/src/base/objs/Environment/Environment.truth b/isis/src/base/objs/Environment/Environment.truth
index 9676f572ad..6b38e5c812 100644
--- a/isis/src/base/objs/Environment/Environment.truth
+++ b/isis/src/base/objs/Environment/Environment.truth
@@ -1,3 +1,3 @@
 userName: eclipse
 hostName: wang
-version:  isis8
+version:  isis9
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 @@
         <default>
           <item>No</item>
         </default>
-        <exclusions>
-          <item>ADJUSTMENT_INPUT</item>
-        </exclusions>
       </parameter>
 
       <parameter name="OUTLIER_REJECTION">
@@ -1880,7 +1877,7 @@
           </description>
           <type>boolean</type>
           <default>
-            <item>yes</item>
+            <item>no</item>
           </default>
         </parameter>
 
@@ -1898,6 +1895,11 @@
           <filter>
             *.h5
           </filter>
+          <inclusions>
+            <item>
+              UPDATE
+            </item>
+          </inclusions>
           <exclusions>
             <item>ONET</item>
             <item>CNET</item>
@@ -1907,7 +1909,6 @@
             <item>SCCONFIG</item>
             <item>OBSERVATIONS</item>
             <item>RADIUS</item>
-            <item>UPDATE</item>
             <item>OUTLIER_REJECTION</item>
             <item>REJECTION_MULTIPLIER</item>
             <item>ERRORPROPAGATION</item>
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<QString> 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<std::string>();
   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<std::string>();
diff --git a/recipe/meta.yaml b/recipe/meta.yaml
index f4160f1b03..b665ffd8c8 100644
--- a/recipe/meta.yaml
+++ b/recipe/meta.yaml
@@ -18,7 +18,7 @@
 #       A Public Release for ISIS3.6.1:                        {% set version = "3.6.1" %}
 #       A Release Candidate for ISIS3.6.1:                     {% set version = "3.6.1_RC" %}
 #       A custom build of ISIS3.6.1 for the CaSSIS mission:    {% set version = "3.6.1_cassis" %}
-{% set version = "8.3" %}
+{% set version = "9.0" %}
 
 # This is the build number for the current version you are building. If this is the first build of
 # this version, the build number will be 0. It is incremented by 1 with every consecutive build of
@@ -27,7 +27,7 @@
 
 package:
   name: isis
-  version: {{ version }}.0_RC1
+  version: {{ version }}.0_RC2
 
 source:
   git_url: 'https://github.com/DOI-USGS/ISIS3.git'