Unverified Commit 778abcbb authored by Christine Kim's avatar Christine Kim Committed by GitHub
Browse files

Save and apply jigsaw adjustments (#5419)

* Current state

* Save and apply bundle values

* Add test

* Update changelog

* Update yaml and fix for loop issue

* Address test failures

* Make adjustment_output and _input optional

* Update workflow, added new param adjustmentout_h5, updated docs

* Add orientation check

* Update doc

* Address test failures

* Address comments
parent dd18e6bb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -70,6 +70,7 @@ release.
- Fixed gllssi2isis to support V1.1 data [#5396](https://github.com/DOI-USGS/ISIS3/issues/5396)

### Added
- Added option to save and apply bundle adjustment values in `jigsaw` [#4474](https://github.com/DOI-USGS/ISIS3/issues/4474)
- Added versioned default values to lrowacphomap's PHOALGO and PHOPARCUBE parameters and updated lrowacphomap to handle them properly. [#5452](https://github.com/DOI-USGS/ISIS3/pull/5452)

## [8.2.0] - 2024-04-18
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ dependencies:
  - graphviz
  - conda-forge::gsl >=2.6, <2.7
  - hdf5
  - highfive
  - icu
  - inja
  - jama
+21 −16
Original line number Diff line number Diff line
@@ -1880,6 +1880,11 @@ namespace Isis {
                                    const std::vector<double> &coeffAng3,
                                    const Source type) {

    if (type == PolyFunctionOverSpice && !m_orientation) {
      QString msg = "The quaternion SPICE tables are no longer available. " 
                    "Either re-run spiceinit or set OVEREXISTING to False.";
      throw IException(IException::User, msg, _FILEINFO_);
    }                             
    NaifStatus::CheckErrors();
    Isis::PolynomialUnivariate function1(p_degree);
    Isis::PolynomialUnivariate function2(p_degree);
+58 −0
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@ find files of those names at the top level of this repository. **/
#include "Table.h"

#include <fstream>
#include <sstream>
#include <string>

#include "Blob.h"
@@ -137,6 +138,63 @@ namespace Isis {
    }
  }

  /**
   * This constructor takes in a string to create a Table object.
   * 
   * @param tableName The name of the Table to be read
   * @param tableStr The table string
   * @param fieldDelimiter The delimiter to separate fields with
  */
  Table::Table(const QString &tableName, const std::string &tableString, const char &fieldDelimiter) {
    p_name = tableName;

    std::stringstream tableStream;
    tableStream << tableString;

    std::vector<std::string> tableLinesStringList;
    std::string line;
    while(std::getline(tableStream, line, '\n')) {
      tableLinesStringList.push_back(line);
    }

    int numOfFieldValues = tableLinesStringList.size() - 1; // minus the header line 

    std::string fieldNamesLineString = tableLinesStringList.front();
    std::stringstream fieldNamesStringStream;
    fieldNamesStringStream << fieldNamesLineString;

    std::vector<QString> fieldNames;
    std::string fieldNameString;
    while(std::getline(fieldNamesStringStream, fieldNameString, fieldDelimiter)) {
      fieldNames.push_back(QString::fromStdString(fieldNameString));
    }

    // Clear error flags and set pointer back to beginning
    tableStream.clear();
    tableStream.seekg(0, ios::beg);

    // Add records to table
    std::string recordString;
    int index = 0;
    while(std::getline(tableStream, recordString, '\n')) {
      // skip first line bc that's the header line
      if (index == 0) {
        index++;
        continue;
      }
      
      TableRecord tableRecord(recordString, fieldDelimiter, fieldNames, numOfFieldValues);
      p_record = tableRecord;
      this->operator+=(tableRecord);
      index++;
    }

    // Add fields
    for (int f = 0; f < p_record.Fields(); f++) {
      p_label.addGroup(p_record[f].pvlGroup());
    }
  }


  /**
   * Initialize a Table from a Blob that has been read from a file.
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ namespace Isis {
      Table(const QString &tableName, const QString &file,
            const Pvl &fileHeader);
      Table(const Table &other);
      Table(const QString &tableName, const std::string &tableString, const char &fieldDelimiter);
      Table &operator=(const Isis::Table &other);

      ~Table();
Loading