Repository Public
1#!/bin/sh2# =============================================================================3# SP BOUCHER | INFRASTRUCTURE & AUTOMATION4# ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5# =============================================================================6#7# Project : ORIX Cosmos8# File : DataPipeline/time/fetch_naif_lsk.sh9# Module : DataPipeline10# Repository : https://git.spboucher.ai/orix-cosmos11# Project Website : https://www.orixlab.dev12# Created : 2026-11-2413# Last Modified : 2026-11-2414#15# Author : Simon-Pierre Boucher16# Position : Professor of Finance17# Institution : Université du Québec en Outaouais (UQO)18# Organization : SP Boucher19# Website : https://spboucher.ai20# Git : https://git.spboucher.ai21#22# Preferred Contact: support@spboucher.ai23# Technical Contact: dev@spboucher.ai24# Security/Admin : admin@spboucher.ai25#26# Copyright (c) 202627# Simon-Pierre Boucher28# All rights reserved where applicable. This file is governed by the29# applicable project license, copyright notices and relevant law.30# Existing third-party rights and notices remain unaffected.31#32# License : None specified (no license file in this repository)33#34# Do not embed credentials, private keys, access tokens,35# certificates or confidential personal information.36#37# =============================================================================38# END OF SP BOUCHER SOURCE HEADER39# =============================================================================4041# ORIX Cosmos42# File: DataPipeline/time/fetch_naif_lsk.sh43# Description: Downloads the current NAIF generic leapseconds kernel into CosmosTime's bundled resources and prints its SHA-256.44#45# Author: Simon-Pierre Boucher46# Contact: contact@spboucher.ai47#48# Usage: DataPipeline/time/fetch_naif_lsk.sh [kernel-name] (default naif0012.tls; run from the repository root)49# After a new kernel is published: update the file name and SHA-256 in LeapSeconds.swift (bundled, bundledProvenance),50# Sources/Resources/README.txt, Documentation/modules/CosmosTime.md, and TimeSystem.bulletinC72ConfirmedThroughMJD.51set -eu52NAME="${1:-naif0012.tls}"53DEST="Packages/CosmosTime/Sources/Resources/$NAME"54URL="https://naif.jpl.nasa.gov/pub/naif/generic_kernels/lsk/$NAME"55TMP="$(mktemp)"56curl --fail --silent --show-error --location -o "$TMP" "$URL"57grep -q 'DELTET/DELTA_AT' "$TMP" || { echo "not a leapseconds kernel: $URL" >&2; rm -f "$TMP"; exit 1; }58mv "$TMP" "$DEST"59echo "source : $URL"60echo "date : $(date -u +%Y-%m-%d)"61echo "sha256 : $(shasum -a 256 "$DEST" | cut -d' ' -f1)"62