Skip to content

Make a way to use local device's leap second information #61

Description

@eteq

This is the last step discussed in #49 (comment) . To summarize, now that #58 has provide a possible leap second interface (although emphasis on "possible" because of #61), we should figure out a way to implement @olebole's idea in #49 (comment), which is also connected with @nikkelj and @rmathar's ideas in #43.

Perhaps @rmathar's code in #43 (comment) can be recycled here?

Activity

  1. rmathar commented on Jun 17, 2026

    @rmathar

    There are two scenarios:
    (i) the computer is NOT maintained (because the standard observers fear that
    something might be broken if they upgrade). Typical example are CAHA
    instrument computers that are never updated once the instrument has
    passed the commissioning stage (and where people, even seasoned
    astronomers, are unaware of leap-seconds). In that case it would be vain
    to expect anyone to update anything within the erfa domain.
    (ii) the computer is maintained. In that case further leap seconds trigger
    an update of the date.c source code in the SOFA release, which sooner
    or later triggers a new erfa release with the additional leap seconds,
    and the computer's administrator upgrades to the new erfa. In that case
    my code in #43 would have the
    minimal advantage of perhaps becoming aware of leap seconds in the operating
    system slightly (few months) earlier, but one would need to find a place
    within the erfa code where the function eraDatTZ of #43
    is actually called so the functions benefit from the (potentially early) update of
    the leap-seconds.txt file of the operating system.

    I doubt we could convince the IAU people to implement the
    lookup of the leap seconds in the operating system in their code. They are aware
    that new SOFA releases will occasionally be compiled on very old
    operating systems with nasty side effects to their reputation
    if it turns out that the SOFA software emits wrong results based
    on obsolete leap seconds tables. It is also obvious that my function
    eraDatTZ is based on standards that may not be valid on Windows or MAC's, so if the
    function does not find a leap-seconds.txt, one would still need to have the frozen
    data base of leap seconds in the source code as a backup.

    Useful information is in https://unix.stackexchange.com/questions/806437/

  2. mhvk commented on Aug 23, 2026

    @mhvk
    Contributor

    Coming back to this after a long time, I now think that a library reaching into a computer's files is not quite right; liberfa should not do any IO, but just provides an interface to update the leap-second tables that one or more layers up can decide to use. I think that means astropy or perhaps a python helper in pyerfa, i.e., a place where fallbacks and warnings are much easier to organize.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions