Commit d12cc8a6 authored by Kristin Berry's avatar Kristin Berry
Browse files

Update SpiceRotation to only set the time cache explicitly if one has not...

Update SpiceRotation to only set the time cache explicitly if one has not already been loaded from the InstrumentPosition table attached to the cube
parent dcede611
Loading
Loading
Loading
Loading
+14 −11
Original line number Diff line number Diff line
@@ -306,9 +306,9 @@ namespace Isis {
   * @param status The DownsizeStatus enumeration value.
   */
  void SpiceRotation::MinimizeCache(DownsizeStatus status) {
    if (p_minimizeCache != DownsizeStatus::Fixed) {
//    if (p_minimizeCache != DownsizeStatus::Fixed) {
      p_minimizeCache = status; 
    }
//    }
  }


@@ -609,9 +609,9 @@ namespace Isis {
      if (p_degree > 0 && p_cacheAv.size() > 1)  p_cacheAv.clear();

      // Load the time cache first
      if (p_minimizeCache != Fixed) {
//      if (p_minimizeCache != Fixed) {
        p_minimizeCache = No; 
      }
//      }
      LoadTimeCache();

      if (p_fullCacheSize > 1) {
@@ -639,9 +639,9 @@ namespace Isis {
      p_cacheAv.clear();

      // Reload the time cache first
      if (p_minimizeCache != Fixed) {
//      if (p_minimizeCache != Fixed) {
        p_minimizeCache = No; 
      }
//      }
      LoadTimeCache();

      for (std::vector<double>::size_type pos = 0; pos < maxSize; pos++) {
@@ -721,9 +721,9 @@ namespace Isis {

      //std::cout << "Full cache size is " << p_cache.size() << endl;
      
      if (p_minimizeCache != Fixed) {
//      if (p_minimizeCache != Fixed) {
        p_minimizeCache = Yes; 
      }
//      }
      LoadTimeCache();

      //std::cout << "Minimized cache size is " << p_cache.size() << endl;
@@ -1941,9 +1941,12 @@ namespace Isis {

  // NEW: sets the cache time
  void SpiceRotation::SetCacheTime(std::vector<double> cacheTime) {
    MinimizeCache(DownsizeStatus::Fixed); // look at this later. Needed for VIRTIS-M 
//    MinimizeCache(DownsizeStatus::Fixed); // look at this later. Needed for VIRTIS-M 
    // Do not reset the cache times if they are already loaded. 
    if (p_cacheTime.size() <= 0) {
      p_cacheTime = cacheTime; 
    }
  }

  /**
   * Evaluate the derivative of the fit polynomial defined by the
@@ -2501,7 +2504,7 @@ namespace Isis {
      // could try to change the kernels: type, resample, something else? check on type 2 or 3, concerned about interpolation
      // it's already type 2 or 3... 
      // FIXME
      if (p_source == Nadir && (p_minimizeCache != Fixed)) {
      if (p_source == Nadir) { //&& (p_minimizeCache != Fixed)) {
        p_minimizeCache = No;
      }
    }