diff --git a/SpiceQL/db/base.json b/SpiceQL/db/base.json index c2af2cad820c4a41814b372915e37553e62bd8e3..c551a8786b2f7841aa5abfe4bd249741b08fc586 100644 --- a/SpiceQL/db/base.json +++ b/SpiceQL/db/base.json @@ -4,7 +4,9 @@ "kernels" : ["naif[0-9]{4}.tls"] }, "spk" : { - "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$"] + "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"] diff --git a/SpiceQL/include/spice_types.h b/SpiceQL/include/spice_types.h index 3cd0fd2fc8439f8925798c831bf97780291cca1f..c047d92ef598900a3cf031fcf553e9e219ea4d5a 100644 --- a/SpiceQL/include/spice_types.h +++ b/SpiceQL/include/spice_types.h @@ -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) }; /** diff --git a/SpiceQL/src/inventoryimpl.cpp b/SpiceQL/src/inventoryimpl.cpp index 4f3b4e2e928e4ebf3f53a0b9850d986f36ab8ad5..c26ca5b2d0baa9d20b16dd9093fcd613a292cd66 100644 --- a/SpiceQL/src/inventoryimpl.cpp +++ b/SpiceQL/src/inventoryimpl.cpp @@ -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; diff --git a/SpiceQL/src/spice_types.cpp b/SpiceQL/src/spice_types.cpp index 6427c1800588b827f7a5015c4bc795e12170aeaf..a5e52003f6bbfacdfe488f00982ebca34e248888 100644 --- a/SpiceQL/src/spice_types.cpp +++ b/SpiceQL/src/spice_types.cpp @@ -47,7 +47,7 @@ namespace SpiceQL { "iak", "ik", "fk", "dsk", "pck", "ek"}; - const std::vector Kernel::QUALITIES = { "na", + const std::vector Kernel::QUALITIES = { "noquality", "predicted", "nadir", "reconstructed", diff --git a/SpiceQL/src/utils.cpp b/SpiceQL/src/utils.cpp index c706f775a29b1bc3ec542cc6f0bcd8e722c57b9e..e6392e5d22114d316f63504adce7b1bfd20db033 100644 --- a/SpiceQL/src/utils.cpp +++ b/SpiceQL/src/utils.cpp @@ -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("{} 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(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(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 &