Closed ysiahpoosh closed 8 years ago
It looks like the official, international source of leap second data is indeed expired!
Well, drat. I had not anticipated the international data source going out of date.
Did something change? I didn't see any error when I ran a small script in an empty folder (see below). If I run it again, it seems to load leap second again, and add more old files. I've never seen that happen before, however.
I'm using v0.8 with IDLE.
Personally, the behavior I'd expect would be to raise some exception or warning about an expiration, but keep going. But I can't anticipate all the potential implications, especially for embedded scripts out in the field somewhere someday.
import numpy as np
import matplotlib.pyplot as plt
from skyfield.api import load
pi, halfpi = np.pi, 0.5*np.pi
data = load('de421.bsp')
earth = data['earth']
moon = data['moon']
sun = data['sun']
# Timescale
ts = load.timescale()
days = np.arange(366.)
t = ts.utc(2016, 1, days)
# Positions
ep = earth.at(t).ecliptic_position().km
mp = moon.at(t).ecliptic_position().km
sp = sun.at(t).ecliptic_position().km
plt.figure()
for io, ob in enumerate([ep, mp, sp]):
for i, q in enumerate(ob):
plt.subplot(3, 3, 3*io + i + 1)
plt.plot(q)
plt.show()
I will try to release soon — meanwhile, check the diff just above this comment for a workaround that's working for me!
I note that the leap second data file is now up to date again — and they have declared a new leap second!
https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat
# Value of TAI-UTC in second valid beetween the initial value until
# the epoch given on the next line. The last line reads that NO
# leap second was introduced since the corresponding date
# Updated through IERS Bulletin C52 issued in July 2016
#
#
# File expires on 28 June 2017
#
#
# MJD Date TAI-UTC (s)
# day month year
# --- -------------- ------
#
41317.0 1 1 1972 10
41499.0 1 7 1972 11
...
56109.0 1 7 2012 35
57204.0 1 7 2015 36
57754.0 1 1 2017 37
So it looks like a 30-day grace period is more than enough to cover a brief delay in the publication of a new file once the old one goes out of date, while hopefully not threatening seriously the accuracy of future predictions people are making with Skyfield — so I am inclined to leave the grace period at 30 days until we learn more. Feel free to comment here in future months or years if new problems with the file's expiration date crop up, and thanks for reporting the issue!
I've been using skyfield to work on a program to track satellites. However, now whenever I run my program it keeps loading a file called "Leap_Second.dat". This file has the leap seconds data for time calculations, but it says that it expires on June 30, 2016. Is there a way to fix this?