Skip to content

Leap second handling in Time (future-proofing) #350

Closed

Description

@taldcroft

Time currently uses a SOFA routine that only knows about leap seconds through July 2012. This may need to be updated in a few years.

Activity

  1. taldcroft commented on Aug 18, 2012

    @taldcroft
    MemberAuthor

    @astrofrog wrote on astropy-dev:

    I wonder if there is a way to use NTP servers to generate tables of
    leap seconds? I know it's possible to find out if there is a leap
    second announcement via NTP, but I wonder if we can use NTP to
    essentially re-generate the leap second table - which would
    effectively allow us to abstract away this issue, provided we specify
    a number of NTP servers for redundancy.

  2. astrofrog commented on Aug 18, 2012

    @astrofrog
    Member

    Another possibility - allow the user to specify their own list of leap seconds as a last resort? Then we are guaranteed to be able to make old astropy versions work one way or another if a user doesn't have the option to update.

  3. perrygreenfield commented on Aug 19, 2012

    @perrygreenfield
    Member

    I think a nice way to handle this is to have the library keep a local
    table, and that if it it out of date, it checks a server (one we
    maintain) for an update. These are only done twice a year usually
    (even so, even checking once a month is hardly a burden), so
    infrequent checks are necessary. If necessary, we maintain that table
    if there is no automatic way of doing it, but one would think there is
    an automatic means...

    On Aug 18, 2012, at 1:35 PM, Thomas Robitaille wrote:

    Another possibility - allow the user to specify their own list of
    leap seconds as a last resort? Then we are guaranteed to be able to
    make old astropy versions work one way or another if a user doesn't
    have the option to update.

    —
    Reply to this email directly or view it on GitHub.

  4. taldcroft commented on Aug 19, 2012

    @taldcroft
    MemberAuthor

    @perrygreenfield - sounds good. A related but slightly harder problem is keeping a table of UT1 - UTC offset (or other time scale offsets) up to date. These get updated at least weekly because they depend on the most recent Earth rotation data. It may well make sense to have some sort of internal cron job that fetches new data from available resources and processes into a standard file / URL that astropy.time can expect to be stable. The internal processing layer won't be part of the released astropy and could be updated rapidly in response to external interface changes.

    If this seems like the right solution we might want to make some tools so multiple institutions could provide this astropy time service for redundancy. I did see one VO paper about a proposed VO time service, perhaps along similar lines, but I couldn't find anything now that's live (didn't look too hard though).

  5. eteq commented on Aug 20, 2012

    @eteq
    Member

    I mentioned this on astropy-dev, but for the local version it makes sense to use the astropy.config.get_data_* functions, if possible. These currently don't have a way to invalidate the cache after a certain amount of time, but that would be easy to implement if it was needed for this.

    Also, if we go with @taldcroft's idea of standardizing a format for this info, that's a perfect test case for the data.astropy.org service and associated astropy code (which we have not implemented due to lack of anyone wanting this until now).

  6. embray commented on Aug 20, 2012

    @embray
    Member

    @perrygreenfield Which, incidentally, is exactly the project I have Pritha working on. Not sure when it'll be finished though. I need to spend a little more time guiding her.

    To clarify, the way I have her doing it is that if the current date is beyond the next leap second opportunity after the last leap second in the local table, it will attempt to check online for updates. If the the online check fails or is disabled it will issue warnings about possible out of date leap seconds--likewise for dates in the future where the number of leap seconds is unknown (though maybe there's a way to approximate it?)

  7. astrofrog commented on Oct 9, 2012

    @astrofrog
    Member

    Since this is about future-proofing, I'm tagging this as 0.2.0 since it'd be nice to have that code be future-proof.

  8. eteq commented on Oct 11, 2012

    @eteq
    Member

    @iguananaut - you mentioned you have someone else working on this - does that mean it can be ready for 0.2 by that person, or does someone else need to do this to get 0.2 ?

    Also, as I said above, this would require adding the timed invalidation feature to the cache, which I'm happy to do if it will actually be used here. @demitri also mentioned he may want it for the query-related work

  9. embray commented on Oct 12, 2012

    @embray
    Member

    Hmm we'll see. It's tough because I'm trying to guide the intern through the process, but they haven't been able to come in much lately due to school. This is really two related issues, and I don't know whether there are separate issues for both of them.

    For UTC leapseconds we need to get updates from http://maia.usno.navy.mil/ser7/tai-utc.dat; the idea is that if working with a date beyond the last known leapsecond (by at least 6 months), based on user-configured options either:

    • Display a warning
    • Display a warning and attempt to check for recent updates
    • Check for recent updates silently
    • Do nothing silently
    • (other options)?

    There's also the question of where to cache these files. Perhaps in ~/.astropy?

    Then for UT1-UTC we need to do something similar with IERS bulletin A: http://maia.usno.navy.mil/ser7/ser7.dat using a roughly similar approach.

  10. astrofrog commented on Oct 13, 2012

    @astrofrog
    Member

    @iguananaut - regarding the cache, maybe this should use the astropy.config.data utilities? (https://github.com/astropy/astropy/blob/master/astropy/config/data.py)

  11. eteq commented on Oct 16, 2012

    @eteq
    Member

    +1 to @astrofrog suggestion

  12. modified the milestones: v1.0.0, v0.4.0 on May 3, 2014
  13. removed this from the v1.0.0 milestone on Jan 13, 2015
  14. mhvk commented on Jan 13, 2015

    @mhvk
    Contributor

    I cleared the milestone. This could be resolved with the same mechanism, whatever it will be, that we will come up with for automating the IERS A table downloads (#3275).

  15. taldcroft commented on Mar 2, 2015

    @taldcroft
    MemberAuthor
    INTERNATIONAL EARTH ROTATION AND REFERENCE SYSTEMS SERVICE (IERS) 
    
    SERVICE INTERNATIONAL DE LA ROTATION TERRESTRE ET DES SYSTEMES DE REFERENCE
    
    SERVICE DE LA ROTATION TERRESTRE DE L'IERS
    OBSERVATOIRE DE PARIS                                   
    61, Av. de l'Observatoire 75014 PARIS (France)
    Tel.      : 33 (0) 1 40 51 22 26
    FAX       : 33 (0) 1 40 51 22 91
    e-mail    : [email protected]
    http://hpiers.obspm.fr/eop-pc
    
                                                  Paris, 5 January 2015
    
                                                  Bulletin C 49
    
     To authorities responsible for the measurement and distribution of time                                         
    
    
                                       UTC TIME STEP
                                on the 1st of July 2015
    
    
     A positive leap second will be introduced at the end of June 2015.
     The sequence of dates of the UTC second markers will be:       
    
                              2015 June 30,     23h 59m 59s
                              2015 June 30,     23h 59m 60s
                              2015 July  1,      0h  0m  0s
    
     The difference between UTC and the International Atomic Time TAI is:
    
      from 2012 July 1,    0h UTC, to 2015 July 1  0h UTC  : UTC-TAI = - 35s
      from 2015 July 1,    0h UTC, until further notice    : UTC-TAI = - 36s 
    
    
    
     Leap seconds can be introduced in UTC at the end of the months of December 
     or June, depending on the evolution of UT1-TAI. Bulletin C is mailed every 
     six months, either to announce a time step in UTC or to confirm that there 
     will be no time step at the next possible date.
    
    
                                                  Daniel Gambis
                                                  Head
                                                  Earth Orientation Center of IERS
                                                  Observatoire de Paris, France
    
  16. added a commit that references this issue on Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions