Commit ce2dd259 authored by Christine Kim's avatar Christine Kim
Browse files

some fixes

parent 41043319
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -4,7 +4,9 @@
      "kernels" : ["naif[0-9]{4}.tls"]
    },
    "spk" : {
      "noquality" : {
        "kernels" : ["^de[0-9]{3}.bsp$", "^mar[0-9]{3}.bsp$", "^nep[0-9]{3}.bsp$", "^sat[0-9]{3}.bsp$", "^ura[0-9]{3}.bsp$"]
      }
    },
    "pck" : {
      "kernels" : ["pck0000[0-9].tpc"]
+2 −2
Original line number Diff line number Diff line
@@ -43,12 +43,12 @@ namespace SpiceQL {
       * @brief Enumeration representing the different possible kernel qualities
       **/
      enum class Quality  {
        NOQUALITY=0,       // Either Quaility doesn't apply (e.g. text kernels) -or-
                           // we dont care about quality (e.g. CK of any quality)
        NADIR = 1,         // Assumes Nadir pointing
        PREDICTED = 2,     // Based on predicted future location of the spacecraft/body
        RECONSTRUCTED = 3, // Supplemented by real spacecraft/body data
        SMITHED = 4,       // Controlled Kernels
        NA = SMITHED       // Either Quaility doesn't apply (e.g. text kernels) -or-
                           // we dont care about quality (e.g. CK of any quality)
      };

      /**
+1 −5
Original line number Diff line number Diff line
@@ -150,10 +150,6 @@ namespace SpiceQL {
      for (auto &[mission, kernels] : json_kernels.items()) {
        fmt::print("mission: {}\n", mission);    

        if (mission == "Base") { 
            continue;
        }

        for(auto &[kernel_type, kernel_obj] : kernels.items()) { 
          if (kernel_type == "ck" || kernel_type == "spk") { 
            // we need to log the times
@@ -255,7 +251,7 @@ namespace SpiceQL {
        }

        // iterate down the qualities 
        for(int i = (int)quality; i > 0 && !found; i--) { 
        for(int i = (int)quality; i >= 0 && !found; i--) { 
          string key = instrument+"/"+Kernel::translateType(type)+"/"+Kernel::QUALITIES.at(i)+"/"+"kernels";
          SPDLOG_DEBUG("Key: {}", key);
          quality = (Kernel::Quality)i; 
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ namespace SpiceQL {
                                                    "iak", "ik", "fk",
                                                    "dsk", "pck", "ek"};

  const std::vector<std::string> Kernel::QUALITIES = { "na",
  const std::vector<std::string> Kernel::QUALITIES = { "noquality",
                                                       "predicted",
                                                       "nadir",
                                                       "reconstructed",
+15 −1
Original line number Diff line number Diff line
@@ -209,17 +209,25 @@ namespace SpiceQL {

    json ephemKernels = {};
    json lskKernels = {};
    json pckKernels = {};
    json spkKernels = {};

    if (searchKernels) {
      ephemKernels = Inventory::search_for_kernelset(mission, {"sclk", "ck", "spk", "pck", "tspk"}, ets.front(), ets.back(), ckQuality, spkQuality);
      lskKernels = Inventory::search_for_kernelset("base", {"lsk"});
      pckKernels = Inventory::search_for_kernelset("base", {"pck"});
      spkKernels = Inventory::search_for_kernelset("base", {"spk"}, ets.front(), ets.back(), "noquality", "noquality");
      SPDLOG_DEBUG("LSK Kernels : {}", lskKernels.dump(4));
      SPDLOG_DEBUG("{} Kernels : {}", mission, ephemKernels.dump(4));
      SPDLOG_DEBUG("PCK Kernels : {}", pckKernels.dump(4));
      SPDLOG_DEBUG("SPK Kernels : {}", spkKernels.dump(4)); 
    }

    auto start = high_resolution_clock::now();
    KernelSet ephemSet(ephemKernels);
    KernelSet lskSet(lskKernels);
    KernelSet pckSet(pckKernels);
    KernelSet spkSet(spkKernels);
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    SPDLOG_INFO("Time in microseconds to furnish kernel sets: {}", duration.count());
@@ -455,15 +463,18 @@ namespace SpiceQL {

    json ephemKernels = {};
    json lskKernels = {};
    json pckKernels = {};

    if (searchKernels) {
      ephemKernels = Inventory::search_for_kernelset(mission, {"sclk", "ck", "pck", "fk", "tspk"}, ets.front(), ets.back(), ckQuality, "na");
      lskKernels = Inventory::search_for_kernelset("base", {"lsk"});
      pckKernels = Inventory::search_for_kernelset("base", {"pck"});
    }

    auto start = high_resolution_clock::now();
    KernelSet ephemSet(ephemKernels);
    KernelSet lskSet(lskKernels);
    KernelSet pckSet(pckKernels);
    auto stop = high_resolution_clock::now();
    auto duration = duration_cast<microseconds>(stop - start);
    SPDLOG_INFO("Time in microseconds to furnish kernel sets: {}", duration.count());
@@ -489,14 +500,17 @@ namespace SpiceQL {
    // json missionJson;
    json ephemKernels;
    json lskKernels;
    json pckKernels;

    if (searchKernels) {
      ephemKernels = Inventory::search_for_kernelset(mission, {"sclk", "ck", "pck", "fk", "tspk"}, et, et, ckQuality, "na");
      lskKernels = Inventory::search_for_kernelset("base", {"lsk"});
      pckKernels = Inventory::search_for_kernelset("base", {"pck"});
    }

    KernelSet ephemSet(ephemKernels);
    KernelSet lskSet(lskKernels);
    KernelSet pckSet(pckKernels);

    checkNaifErrors();
    // The code for this method was extracted from the Naif routine rotget written by N.J. Bachman &