Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #502 - Fix broken leapsecond file generation #503

Merged
merged 2 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions ait/core/dmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def _update_leap_second_data(self):
"""Updates the systems leap second information

Pulls the latest leap second information from
https://www.ietf.org/timezones/data/leap-seconds.list
https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list
and updates the leapsecond config file.

Raises:
Expand All @@ -361,7 +361,7 @@ def _update_leap_second_data(self):
os.path.join(ait.config._directory, _DEFAULT_FILE_NAME),
)

url = "https://www.ietf.org/timezones/data/leap-seconds.list"
url = "https://hpiers.obspm.fr/iers/bul/bulc/ntp/leap-seconds.list"
r = requests.get(url)

if r.status_code != 200:
Expand All @@ -374,13 +374,13 @@ def _update_leap_second_data(self):

data = {"valid": None, "leapseconds": []}
data["valid"] = datetime.datetime(1900, 1, 1) + datetime.timedelta(
seconds=int(lines[0].split("\t")[1])
seconds=int(lines[0].split()[1])
)

leap = 1
for line in lines[1:-1]:
t = datetime.datetime(1900, 1, 1) + datetime.timedelta(
seconds=int(line.split("\t")[0])
seconds=int(line.split()[0])
)
if t < GPS_Epoch:
continue
Expand Down
Binary file modified config/leapseconds.dat
Binary file not shown.
Loading