Loading isis/src/base/objs/SpicePosition/SpicePosition.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading isis/src/base/objs/SpicePosition/SpicePosition.truth +5 −0 Original line number Diff line number Diff line Loading @@ -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 isis/src/base/objs/SpicePosition/unitTest.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -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; } Loading
isis/src/base/objs/SpicePosition/SpicePosition.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -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) { Loading
isis/src/base/objs/SpicePosition/SpicePosition.truth +5 −0 Original line number Diff line number Diff line Loading @@ -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
isis/src/base/objs/SpicePosition/unitTest.cpp +23 −0 Original line number Diff line number Diff line Loading @@ -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; }