Skip to content

Important: Make GPS/UTC/TAI/TT conversions leap-second aware #169

Description

@zoglauer

Currently, MReadOutAssembly performs time conversion using fixed offsets for UTC/TAI/TT/GPS conversions, e.g. GPS - UTC = 18 s, TAI - UTC = 37 s, and TT - TAI = 32.184 s. These are correct for the current leap-second state, but the UTC-related offsets can change when IERS announces a new leap second - next one could happen 1/1/2027.

This a category of bug, which doesn't show up now, but will knowingly and definitely show up some time in the future.

Suggestion:

  • Add a nuclearizer-wide time conversion helper for GPS <-> UTC <-> TAI <-> TT (e.g. MTimeConversions) and remove them from MReadOutAssembly

  • Avoid hard-coding leap-second offsets in individual classes.

  • Track leap seconds via either:
    - a small local leap-second table, or
    - a standard library such as ERFA, or
    - NAIF CSPICE if we want a broader mission/space-science time system.

  • Keep TT - TAI = 32.184 s as a named constant.

  • Make the currently valid TAI - UTC / GPS - UTC offset date-aware.

  • Add unit tests around known leap-second boundaries.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions