Unverified Commit ac11b26f authored by acpaquette's avatar acpaquette Committed by GitHub
Browse files

ALE Spice Reduction (#3940)



* Reduced incoming ALE ephemeris data to be in the same source state as it would be from an ISIS spiceinit

* Fixed keys accessing ale json

* Minor doc string fix

* Updated test for SpicePosition to check the cache size

* Updated SpiceRotation unit test to check the cache size

* Updated linux truth data

* Added zerod out angular velocities to the spice rotation unit test

* Updated mac 10.13 truth data

* Updated angular velocity unit test

* Updated linux truth data

* Updated mac 10.15 truth data

* Updated linux truth again

* One more change to linux truth data

* Re-add space to SpiceRotation truth data

Co-authored-by: default avatarJesse Mapel <jam826@nau.edu>
parent 0048427c
Loading
Loading
Loading
Loading
+81 −67
Original line number Diff line number Diff line
@@ -380,7 +380,14 @@ namespace Isis {
    // See if we have table blobs to load
    if (m_usingAle) {
      m_sunPosition->LoadCache(isd["sun_position"]);
      if (m_sunPosition->cacheSize() > 3) {
        m_sunPosition->Memcache2HermiteCache(0.01);
      }
      m_bodyRotation->LoadCache(isd["body_rotation"]);
      m_bodyRotation->MinimizeCache(SpiceRotation::DownsizeStatus::Yes);
      if (m_bodyRotation->cacheSize() > 5) {
        m_bodyRotation->LoadTimeCache();
      }
      solarLongitude();
    }
    else if (kernels["TargetPosition"][0].toUpper() == "TABLE") {
@@ -422,6 +429,10 @@ namespace Isis {
    }
    else if (m_usingAle) {
     m_instrumentRotation->LoadCache(isd["instrument_pointing"]);
     m_instrumentRotation->MinimizeCache(SpiceRotation::DownsizeStatus::Yes);
     if (m_instrumentRotation->cacheSize() > 5) {
       m_instrumentRotation->LoadTimeCache();
     }
    }
    else if (kernels["InstrumentPointing"][0].toUpper() == "TABLE") {
      Table t("InstrumentPointing", lab.fileName(), lab);
@@ -437,6 +448,9 @@ namespace Isis {

    if (m_usingAle) {
      m_instrumentPosition->LoadCache(isd["instrument_position"]);
      if (m_instrumentPosition->cacheSize() > 3) {
        m_instrumentPosition->Memcache2HermiteCache(0.01);
      }
    }
    else if (kernels["InstrumentPosition"][0].toUpper() == "TABLE") {
      Table t("InstrumentPosition", lab.fileName(), lab);
+5 −0
Original line number Diff line number Diff line
@@ -250,6 +250,11 @@ namespace Isis {
        return (p_cache.size() > 0);
      };

      //! Get the size of the current cached positions
      int cacheSize() const {
        return p_cache.size();
      };

      void SetPolynomial(const Source type = PolyFunction);

      void SetPolynomial(const std::vector<double>& XC,
+1 −0
Original line number Diff line number Diff line
@@ -62,6 +62,7 @@ Velocity (J) = -3.5732696 1.5440214 -2.5639247
Time           = -69382512
Spacecraft (J) = -2908.5545 -1132.3409 1981.0142
Velocity (J) = -3.4897306 1.5779899 -2.6234689
Cache Size: 10

Testing tables ... 
Time           = -69382819
+1 −0
Original line number Diff line number Diff line
@@ -61,6 +61,7 @@ int main(int argc, char *argv[]) {
    cout << "Spacecraft (J) = " << p[0] << " " << p[1] << " " << p[2] << endl;
    cout << "Velocity (J) = " << v[0] << " " << v[1] << " " << v[2] << endl;
  }
  std::cout << "Cache Size: " << pos.cacheSize() << '\n';
  cout << endl;

  // Test table options
+2 −2
Original line number Diff line number Diff line
@@ -442,8 +442,8 @@ namespace Isis {
        p_cache.push_back(CJ);
    }

    if (isdRot["angular_velocity"].size() != 0) {
      for (auto it = isdRot["angular_velocity"].begin(); it != isdRot["angular_velocity"].end(); it++) {
    if (isdRot["angular_velocities"].size() != 0) {
      for (auto it = isdRot["angular_velocities"].begin(); it != isdRot["angular_velocities"].end(); it++) {
          std::vector<double> av = {it->at(0).get<double>(), it->at(1).get<double>(), it->at(2).get<double>()};
          p_cacheAv.push_back(av);
      }
Loading