From edf2def079d2dba3acfebd592dfef059f6448847 Mon Sep 17 00:00:00 2001 From: Austin Sanders Date: Fri, 17 Nov 2023 12:57:22 -0700 Subject: [PATCH] Allow isis to delegate nadir pointing to ale drivers (#5118) * Allow isis to delegate nadir pointing to ale drivers * Updated changelog --- CHANGELOG.md | 1 + isis/src/base/apps/spiceinit/spiceinit.cpp | 1 - isis/src/base/objs/Spice/Spice.cpp | 13 +++++-------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce6c03c170..b68300e218 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -56,6 +56,7 @@ release. override the timestamp style naming convention of the output cube with their own name; if not specified retains existing behavior [#5125](https://github.com/USGS-Astrogeology/ISIS3/issues/5162) - Added new parameters ONERROR, ERRORLOG, and ERRORLIST to mosrange to provide better control over error behavior and provide diagnostics when problems are encountered processing the input file list.[#3606](https://github.com/DOI-USGS/ISIS3/issues/3606) +- Added ability to delegate calculation of nadir pointing to ALE [#5117](https://github.com/USGS-Astrogeology/ISIS3/issues/5117) ### Deprecated diff --git a/isis/src/base/apps/spiceinit/spiceinit.cpp b/isis/src/base/apps/spiceinit/spiceinit.cpp index 8c0e4dfac5..8ff35b9b63 100644 --- a/isis/src/base/apps/spiceinit/spiceinit.cpp +++ b/isis/src/base/apps/spiceinit/spiceinit.cpp @@ -255,7 +255,6 @@ namespace Isis { kernelSuccess = tryKernels(icube, p, ui, log, lk, pck, targetSpk, realCkKernel, fk, ik, sclk, spk, iak, dem, exk); } - if (!kernelSuccess) { throw IException(IException::Unknown, "Unable to initialize camera model", diff --git a/isis/src/base/objs/Spice/Spice.cpp b/isis/src/base/objs/Spice/Spice.cpp index 678b19d49e..d8c01e4355 100644 --- a/isis/src/base/objs/Spice/Spice.cpp +++ b/isis/src/base/objs/Spice/Spice.cpp @@ -194,19 +194,16 @@ namespace Isis { // ephemerides. (2008-02-27 (KJB)) if (m_usingNaif) { try { - // At this time ALE does not compute pointing for the nadir option in spiceinit - // If NADIR is turned on fail here so ISIS can create nadir pointing - if (kernels["InstrumentPointing"][0].toUpper() == "NADIR") { - QString msg = "Falling back to ISIS generation of nadir pointing"; - throw IException(IException::Programmer, msg, _FILEINFO_); - } - if (isd == NULL){ // try using ALE std::ostringstream kernel_pvl; kernel_pvl << kernels; json props; + if (kernels["InstrumentPointing"][0].toUpper() == "NADIR") { + props["nadir"] = true; + } + props["kernels"] = kernel_pvl.str(); isd = ale::load(lab.fileName().toStdString(), props.dump(), "ale", false, false, true); @@ -440,7 +437,7 @@ namespace Isis { // 2009-03-18 Tracie Sucharski - Removed test for old keywords, any files // with the old keywords should be re-run through spiceinit. - if (kernels["InstrumentPointing"][0].toUpper() == "NADIR") { + if (kernels["InstrumentPointing"][0].toUpper() == "NADIR" && !isUsingAle()) { if (m_instrumentRotation) { delete m_instrumentRotation; m_instrumentRotation = NULL; -- GitLab