Commit 38ae28e7 authored by Kristin's avatar Kristin Committed by Jesse Mapel
Browse files

Fixes Jenkins errors: Revert "updated with new isd format" (#3888)

* Revert "updated with new isd format (#3839)"

This reverts commit e926548c.

* Un-revert environment.yml and include changes
parent 3aad7e19
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -120,8 +120,8 @@ namespace Isis {
  void Spice::init(Pvl &lab, bool noTables, json isd) {
    NaifStatus::CheckErrors();
    // Initialize members
    m_solarLongitude = new Longitude;
    
    m_solarLongitude = new Longitude;
    m_et = NULL;
    m_kernels = new QVector<QString>;

@@ -197,7 +197,7 @@ namespace Isis {
          isd = ale::load(lab.fileName().toStdString(), props.dump(), "isis");
        }
        
        json aleNaifKeywords = isd["naif_keywords"];
        json aleNaifKeywords = isd["NaifKeywords"];
        m_naifKeywords = new PvlObject("NaifKeywords", aleNaifKeywords);

        // Still need to load clock kernels for now 
@@ -379,8 +379,8 @@ namespace Isis {
    // Check to see if we have nadir pointing that needs to be computed &
    // See if we have table blobs to load 
    if (m_usingAle) {
      m_sunPosition->LoadCache(isd["sun_position"]);
      m_bodyRotation->LoadCache(isd["body_rotation"]);
      m_sunPosition->LoadCache(isd["SunPosition"]);
      m_bodyRotation->LoadCache(isd["BodyRotation"]);
      solarLongitude();
    }
    else if (kernels["TargetPosition"][0].toUpper() == "TABLE") {
@@ -421,7 +421,7 @@ namespace Isis {
      m_instrumentRotation = new SpiceRotation(*m_ikCode, *m_spkBodyCode);
    }
    else if (m_usingAle) {
     m_instrumentRotation->LoadCache(isd["instrument_pointing"]);
     m_instrumentRotation->LoadCache(isd["InstrumentPointing"]);
    }
    else if (kernels["InstrumentPointing"][0].toUpper() == "TABLE") {
      Table t("InstrumentPointing", lab.fileName(), lab);
@@ -436,7 +436,7 @@ namespace Isis {
    }
    
    if (m_usingAle) {
      m_instrumentPosition->LoadCache(isd["instrument_position"]);
      m_instrumentPosition->LoadCache(isd["InstrumentPosition"]);
    }
    else if (kernels["InstrumentPosition"][0].toUpper() == "TABLE") {
      Table t("InstrumentPosition", lab.fileName(), lab);
@@ -965,7 +965,8 @@ namespace Isis {


  /**
   * This returns the PvlObject that stores all of the requested Naif data  *   and can be a replacement for furnishing text kernels.
   * This returns the PvlObject that stores all of the requested Naif data
   *   and can be a replacement for furnishing text kernels.
   */
  PvlObject Spice::getStoredNaifKeywords() const {
    return *m_naifKeywords;
+7 −7
Original line number Diff line number Diff line
@@ -354,22 +354,22 @@ namespace Isis {
    }

    // Load the full cache time information from the label if available
    p_fullCacheStartTime = isdPos["spk_table_start_time"].get<double>();
    p_fullCacheEndTime = isdPos["spk_table_end_time"].get<double>();
    p_fullCacheSize = isdPos["spk_table_original_size"].get<double>();
    p_cacheTime = isdPos["ephemeris_times"].get<std::vector<double>>();
    p_fullCacheStartTime = isdPos["SpkTableStartTime"].get<double>();
    p_fullCacheEndTime = isdPos["SpkTableEndTime"].get<double>();
    p_fullCacheSize = isdPos["SpkTableOriginalSize"].get<double>();
    p_cacheTime = isdPos["EphemerisTimes"].get<std::vector<double>>();

    for (auto it = isdPos["positions"].begin(); it != isdPos["positions"].end(); it++) {
    for (auto it = isdPos["Positions"].begin(); it != isdPos["Positions"].end(); it++) {
      std::vector<double> pos = {it->at(0).get<double>(), it->at(1).get<double>(), it->at(2).get<double>()};
      p_cache.push_back(pos);
    }

    p_cacheVelocity.clear();

    bool hasVelocityKey = isdPos.find("velocities") != isdPos.end();
    bool hasVelocityKey = isdPos.find("Velocities") != isdPos.end();

    if (hasVelocityKey) {
      for (auto it = isdPos["velocities"].begin(); it != isdPos["velocities"].end(); it++) {
      for (auto it = isdPos["Velocities"].begin(); it != isdPos["Velocities"].end(); it++) {
        std::vector<double> vel = {it->at(0).get<double>(), it->at(1).get<double>(), it->at(2).get<double>()};
        p_cacheVelocity.push_back(vel);
      }
+6 −6
Original line number Diff line number Diff line
@@ -296,11 +296,11 @@ int main(int argc, char *argv[]) {

  // Test loading cache from an ALE ISD without velocities
  cout << "Test loading cache from an ALE ISD with velocities" << endl;
  json aleIsd = {{"spk_table_start_time"    , -10.0},
                 {"spk_table_end_time"      , 10.0},
                 {"spk_table_original_size" , 3},
                 {"ephemeris_times"       , {-10.0, 0.0, 10.0}},
                 {"positions"            , {{-10.0, -10.0, -10.0},
  json aleIsd = {{"SpkTableStartTime"    , -10.0},
                 {"SpkTableEndTime"      , 10.0},
                 {"SpkTableOriginalSize" , 3},
                 {"EphemerisTimes"       , {-10.0, 0.0, 10.0}},
                 {"Positions"            , {{-10.0, -10.0, -10.0},
                                            {0.0,  0.0,  0.0},
                                            {10.0,  10.0,  10.0}}}};
  SpicePosition alePos(-94, 499);
@@ -319,7 +319,7 @@ int main(int argc, char *argv[]) {
  // Test loading cache from an ALE ISD with velocities
  cout << "Test loading cache from an ALE ISD with velocities" << endl;
  json aleVelIsd = aleIsd;
  aleVelIsd["velocities"] = {{1.0, 1.0, 1.0},
  aleVelIsd["Velocities"] = {{1.0, 1.0, 1.0},
                             {1.0, 1.0, 1.0},
                             {1.0, 1.0, 1.0}};
  SpicePosition aleVelPos(-94, 499);
+11 −11
Original line number Diff line number Diff line
@@ -429,32 +429,32 @@ namespace Isis {
    m_frameType = CK;

    // Load the full cache time information from the label if available
    p_fullCacheStartTime = isdRot["ck_table_start_time"].get<double>();
    p_fullCacheEndTime = isdRot["ck_table_end_time"].get<double>();
    p_fullCacheSize = isdRot["ck_table_original_size"].get<double>();
    p_cacheTime = isdRot["ephemeris_times"].get<std::vector<double>>();
    p_timeFrames = isdRot["time_dependent_frames"].get<std::vector<int>>();
    p_fullCacheStartTime = isdRot["CkTableStartTime"].get<double>();
    p_fullCacheEndTime = isdRot["CkTableEndTime"].get<double>();
    p_fullCacheSize = isdRot["CkTableOriginalSize"].get<double>();
    p_cacheTime = isdRot["EphemerisTimes"].get<std::vector<double>>();
    p_timeFrames = isdRot["TimeDependentFrames"].get<std::vector<int>>();

    for (auto it = isdRot["quaternions"].begin(); it != isdRot["quaternions"].end(); it++) {
    for (auto it = isdRot["Quaternions"].begin(); it != isdRot["Quaternions"].end(); it++) {
        std::vector<double> quat = {it->at(0).get<double>(), it->at(1).get<double>(), it->at(2).get<double>(), it->at(3).get<double>()};
        Quaternion q(quat);
        std::vector<double> CJ = q.ToMatrix();
        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["AngularVelocity"].size() != 0) {
      for (auto it = isdRot["AngularVelocity"].begin(); it != isdRot["AngularVelocity"].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);
      }
      p_hasAngularVelocity = true;
    }

    bool hasConstantFrames = isdRot.find("constant_frames") != isdRot.end();
    bool hasConstantFrames = isdRot.find("ConstantFrames") != isdRot.end();

    if (hasConstantFrames) {
      p_constantFrames = isdRot["constant_frames"].get<std::vector<int>>();
      p_TC = isdRot["constant_rotation"].get<std::vector<double>>();
      p_constantFrames = isdRot["ConstantFrames"].get<std::vector<int>>();
      p_TC = isdRot["ConstantRotation"].get<std::vector<double>>();

    }
    else {
+10 −10
Original line number Diff line number Diff line
@@ -620,12 +620,12 @@ int main(int argc, char *argv[]) {
  // [-90, 0, 0],
  // [-90, 180, 0],
  // [-90, 180, 90]
  json aleQuatIsd = {{"ck_table_start_time"    , 0.0},
                     {"ck_table_end_time"      , 3.0},
                     {"ck_table_original_size" , 4},
                     {"ephemeris_times"      , {0.0, 1.0, 2.0, 3.0}},
                     {"time_dependent_frames" , {-94031, 10014, 1}},
                     {"quaternions"         , {{0.0, 0.0, 0.0, 1.0},
  json aleQuatIsd = {{"CkTableStartTime"    , 0.0},
                     {"CkTableEndTime"      , 3.0},
                     {"CkTableOriginalSize" , 4},
                     {"EphemerisTimes"      , {0.0, 1.0, 2.0, 3.0}},
                     {"TimeDependentFrames" , {-94031, 10014, 1}},
                     {"Quaternions"         , {{0.0, 0.0, 0.0, 1.0},
                                               {-1.0 / sqrt(2), 0.0, 0.0, 1.0 / sqrt(2)},
                                               {0.0, 1.0 / sqrt(2), 1.0 / sqrt(2), 0.0},
                                               {-0.5, -0.5, 0.5, 0.5}}}};
@@ -664,7 +664,7 @@ int main(int argc, char *argv[]) {
  cout << endl << endl << "Testing loading cache from ALE ISD with time dependent quaternions and AV ..." << endl;
  SpiceRotation aleQuatAVRot(-94031);
  json aleQuatAVIsd(aleQuatIsd);
  aleQuatAVIsd["angular_velocity"] = {{-Isis::PI / 2, 0.0, 0.0},
  aleQuatAVIsd["AngularVelocity"] = {{-Isis::PI / 2, 0.0, 0.0},
                                     {0.0, Isis::PI, 0.0},
                                     {0.0, 0.0, Isis::PI / 2},
                                     {0.0, 0.0, Isis::PI / 2}};
@@ -675,9 +675,9 @@ int main(int argc, char *argv[]) {
  cout << endl << endl << "Testing loading cache from ALE ISD with time dependent quaternions and constant rotation ..." << endl;
  SpiceRotation aleQuatConstRot(-94031);
  json aleQuatConstIsd(aleQuatIsd);
  aleQuatConstIsd["time_dependent_frames"] = {-94030, 10014, 1};
  aleQuatConstIsd["constant_frames"] = {-94031, -94030};
  aleQuatConstIsd["constant_rotation"] = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
  aleQuatConstIsd["TimeDependentFrames"] = {-94030, 10014, 1};
  aleQuatConstIsd["ConstantFrames"] = {-94031, -94030};
  aleQuatConstIsd["ConstantRotation"] = {1.0, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0};
  aleQuatConstRot.LoadCache(aleQuatConstIsd);
  timeDepChain = aleQuatConstRot.TimeFrameChain();
  cout << "Time dependent frame chain = { ";
Loading