Unverified Commit eed39475 authored by Jesse Mapel's avatar Jesse Mapel Committed by GitHub
Browse files

Fixed caching 0 degree polynomials (#4546)

* Fixed caching single position

* Added changelog
parent e16b3149
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -56,6 +56,7 @@ release.
- Fixed Thm2isis to properly use output attributes [#4213](https://github.com/USGS-Astrogeology/ISIS3/issues/4213)
- Fixed caminfo uselabel SegFault. [#4401](https://github.com/USGS-Astrogeology/ISIS3/issues/4401)
- Fixed ISIS docs for incorrect path and -WEBHELP issues [#4510](https://github.com/USGS-Astrogeology/ISIS3/issues/4510)
- Fixed a bug where writing out updated positions for framing cameras in jigsaw caused an error. [#4545](https://github.com/USGS-Astrogeology/ISIS3/issues/4545)

## [5.0.0] - 2021-04-01

+1 −1
Original line number Diff line number Diff line
@@ -762,7 +762,7 @@ namespace Isis {
      p_et = p_cacheTime[0];
      SetEphemerisTime(p_et);
      std::vector<ale::State> stateCache;
      stateCache.push_back(p_coordinate);
      stateCache.push_back(ale::Vec3d(p_coordinate));
      std::vector<double> timeCache;
      timeCache.push_back(p_cacheTime[0]);
      if (m_state != NULL) {
+5 −0
Original line number Diff line number Diff line
@@ -384,3 +384,8 @@ Velocity (J) = 1 1 1
Test loading cache from an ALE ISD with non-SPICE SpicePosition
**PROGRAMMER ERROR** SpicePosition::LoadCache(json) only supports Spice source.

Test loading cache from 0th degree polynomial
Source = 1
Has velocity? No
Time           = 1
Spacecraft (J) = 1 2 3
+23 −0
Original line number Diff line number Diff line
@@ -354,4 +354,27 @@ int main(int argc, char *argv[]) {
  }

  cout <<endl;

  // Test loading cache from 0th degree polynomial
  cout << "Test loading cache from 0th degree polynomial" << endl;
  json zeroDegreeIsd = {{"spk_table_start_time"    , 1.0},
                        {"spk_table_end_time"      , 1.0},
                        {"spk_table_original_size" , 1},
                        {"ephemeris_times"       , {1.0}},
                        {"positions"            , {{1.0, 2.0, 3.0}}}};
  SpicePosition zeroDegreePoly(-94, 499);
  zeroDegreePoly.LoadCache(zeroDegreeIsd);
  zeroDegreePoly.ComputeBaseTime();
  zeroDegreePoly.SetPolynomialDegree(0);
  zeroDegreePoly.SetPolynomial();
  Table zeroDegreeTable = zeroDegreePoly.Cache("TestZeroDegree");
  SpicePosition singlePosition(-94, 499);
  singlePosition.LoadCache(zeroDegreeTable);
  cout << "Source = " << singlePosition.GetSource() << endl;
  cout << "Has velocity? " << (singlePosition.HasVelocity() ? "Yes" : "No") << endl;
  singlePosition.SetEphemerisTime(1.0);
  vector<double> singlePos = singlePosition.Coordinate();
  cout << "Time           = " << 1.0 << endl;
  cout << "Spacecraft (J) = " << singlePos[0] << " " << singlePos[1] << " " << singlePos[2] << endl;

}