From 7c38ddec40d83f71c252f925d42b3c28ed70f306 Mon Sep 17 00:00:00 2001 From: kelvinrr Date: Thu, 31 Oct 2024 21:58:34 +0000 Subject: [PATCH 1/2] fixed bug where cks were using interval scope --- SpiceQL/src/utils.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/SpiceQL/src/utils.cpp b/SpiceQL/src/utils.cpp index ee72a82..bff4df2 100644 --- a/SpiceQL/src/utils.cpp +++ b/SpiceQL/src/utils.cpp @@ -1000,6 +1000,8 @@ namespace SpiceQL { pair getKernelStartStopTimes(string kpath) { + SPDLOG_TRACE("getKernelStartStopTimes({})", kpath); + double start_time = 0; double stop_time = 0; @@ -1013,6 +1015,7 @@ namespace SpiceQL { for(int j = 0; j < niv; j++) { //Get the endpoints of the jth interval. + SPDLOG_TRACE("Collecting start stop times"); wnfetd_c(&coverage, j, &begin, &end); checkNaifErrors(); @@ -1076,6 +1079,7 @@ namespace SpiceQL { SPICEDOUBLE_CELL(cover, 300000); ssize_c(0, &cover); ssize_c(300000, &cover); + SPDLOG_TRACE("Getting spk coverage"); spkcov_c(kpath.c_str(), body, &cover); getStartStopFromInterval(cover); } @@ -1084,9 +1088,11 @@ namespace SpiceQL { SPICEDOUBLE_CELL(cover, 300000); ssize_c(0, &cover); ssize_c(300000, &cover); + SPDLOG_TRACE("Getting ck coverage"); // A SPICE SEGMENT is composed of SPICE INTERVALS - ckcov_c(kpath.c_str(), body, SPICEFALSE, "INTERVAL", 0.0, "TDB", &cover); + ckcov_c(kpath.c_str(), body, SPICEFALSE, "SEGMENT", 0.0, "TDB", &cover); + SPDLOG_TRACE("collecting start stop times"); getStartStopFromInterval(cover); } From 25fef4114b7d55465711264b52fef2fa88b3ef83 Mon Sep 17 00:00:00 2001 From: kelvinrr Date: Mon, 4 Nov 2024 00:39:46 +0000 Subject: [PATCH 2/2] fixed sclk bugs --- SpiceQL/db/mess.json | 5 +++-- SpiceQL/src/spice_types.cpp | 19 ++++++++++++------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/SpiceQL/db/mess.json b/SpiceQL/db/mess.json index 9850788..fa5b8dd 100644 --- a/SpiceQL/db/mess.json +++ b/SpiceQL/db/mess.json @@ -30,14 +30,15 @@ "kernels" : "pck00010_msgr_v[0-9]{2}.tpc" } }, - "deps" : ["/mdis_att", "/messenger"] + "deps" : ["/mdis_att"] }, "mdis_att" : { "ck" : { "reconstructed" : { "kernels" : "msgr_mdis_sc[0-9]{6}_[0-9]{6}_sub_v[0-9]{1}.bc" } - } + }, + "deps" : ["/messenger"] }, "messenger" : { "ck" : { diff --git a/SpiceQL/src/spice_types.cpp b/SpiceQL/src/spice_types.cpp index d38e32b..1b56137 100644 --- a/SpiceQL/src/spice_types.cpp +++ b/SpiceQL/src/spice_types.cpp @@ -236,15 +236,20 @@ namespace SpiceQL { KernelSet sclkSet(sclks); KernelSet lskSet(lsks); - // we want the platforms code, if they passs in an instrument code (e.g. -85600), truncate it to (-85) - frameCode = (abs(frameCode / 1000) > 0) ? frameCode/1000 : frameCode; - SpiceDouble et; checkNaifErrors(); - scs2e_c(frameCode, sclk.c_str(), &et); - checkNaifErrors(); - SPDLOG_DEBUG("strsclktoet({}, {}, {}) -> {}", frameCode, mission, sclk, et); - + try { + scs2e_c(frameCode, sclk.c_str(), &et); + checkNaifErrors(); + SPDLOG_DEBUG("strsclktoet({}, {}, {}) -> {}", frameCode, mission, sclk, et); + } + catch(exception &e) { + // we want the platforms code, if they passs in an instrument code (e.g. -85600), truncate it to (-85) + frameCode = (abs(frameCode / 1000) > 0) ? frameCode/1000 : frameCode; + scs2e_c(frameCode, sclk.c_str(), &et); + checkNaifErrors(); + SPDLOG_DEBUG("strsclktoet({}, {}, {}) -> {}", frameCode, mission, sclk, et); + } return et; }