Repository navigation
Fix spiceInterface GPS time and Julian date - #1617
Merged
Merged
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
schaubh
reviewed
Oct 16, 2026
schaubh
left a comment
Contributor
There was a problem hiding this comment.
The issue in #1612 is valid, and the TAI-based GPS correction looks sound. I found one reproducible Julian-date regression that should be addressed before merging. The 41 focused tests pass, but an additional test sampling inside a leap second passes on the original implementation and fails on this PR.
… date from deltet
schaubh
force-pushed
the
hotfix/bsk-1612-gps_time
branch
from
October 17, 2026 01:12
5531980 to
251806e
Compare
schaubh
approved these changes
Oct 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
spiceInterfacefilled the GPS and Julian date fields ofspiceTimeOutMsgincorrectly:GPSSecondswas off by the periodic TDB - TT term, andGPSWeek/GPSRolloverscould be one week early near a week boundary.JulianDateCurrentwas parsed from the SPICEet2utc_cJulian date string. That string has at most seven decimals, so the value was quantized to 1e-7 day.GPSSecondswas computed asJDDifference - GPSWeek*7*86400in integer arithmetic, which overflows a signed 32-bit integer after GPS week 3550.uint16_t).Changes:
deltet_c(ET - UTC), which removes the string round trip and the now-unusedspiceBuffermember.uint64_tand the seconds of week are computed indouble.initTimeData()and stored inTAIGPSEpoch(replacingJDGPSEpoch). Negative GPS time is not modeled: if the initial time is before the GPS epoch, aBSK_WARNINGis emitted at reset and the GPS outputs are held at zero until the epoch is reached.Verification
src/simulation/environment/spiceInterface/_UnitTest/test_spiceTimeOutput.py.test_unitSpice.py: the expected GPS time now removes the periodic TDB - TT term of the SPICE leap seconds kernel, since GPS time is atomic time.test_spiceBufferOwnership.py: tightened the Julian date tolerance from 5e-8 day to 1e-9 day, and removed thespiceBufferparameter of the private storage test.Documentation
spiceInterface.rst: new section describing the time scales ofspiceTimeOutMsgand the behavior before the GPS epoch.SpiceTimeMsgPayload.handspiceInterface.h: clarified field comments and units.bskKnownIssues.rst: added the GitHub issue 1612 entry.Future work