Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SCLK Bug fixes #44

Merged
merged 3 commits into from
Nov 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions SpiceQL/db/mess.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@
"kernels" : "pck00010_msgr_v[0-9]{2}.tpc"
}
},
"deps" : ["/mdis_att", "/messenger"]
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this caused errors when loading mdis CKs

"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" : {
Expand Down
19 changes: 12 additions & 7 deletions SpiceQL/src/spice_types.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Comment on lines +241 to +252
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some missions like Viking need to use the full IK ID in order to get correct SCLK times, forcing the frame code from -43010 to -43 for some these mission caused confusing errors because it loaded the wrong SLCK ID.

The try except should solve this, try the key as passed in, if it fails try the short code. So for MRO Crism, -74010 will fail then try -74 and pass. But for Viking, which wants the code -27999 will pass the first time and won't get the incorrect code -74.

return et;
}

Expand Down
Loading