JPL 惑星暦SPK/BSPのPure言語実装空白を埋める / Filling the Gap in Pure-Language Readers for JPL Planetary Ephemeris (SPK/BSP)
Abstract
要旨(Abstract) 日本語 本稿は、著者が開発・公開した JPL SPK/BSP Pure 言語実装群(Stella シリーズ / Hesperis Ephemeris)に対して行った改善を報告する続報である(v1: doi:10.5281/zenodo.20373856)。 v1 では JavaScript・Swift・Rust・Julia・Python(PyO3)の 5 言語において SPK Type2 セグメント(チェビシェフ位置多項式)の読み取りを実装した。本稿では、その後の外部からの指摘を踏まえて実施した 2 つの改善を報告する。 第一は、SPK Type 3 セグメント(チェビシェフ位置・速度多項式)への対応である。DE430 等の一部暦ファイルは Type 3 形式を使用しており、v1 実装では読み取れなかった。本改善により 5 言語すべてで Type 3 を正式サポートした。第二は、カバレッジ範囲外クエリに対する「サイレントクランプ(silent clamp)」の除去である。v1 実装では、暦のカバレッジ範囲外の日時を指定した場合に境界値で暗黙的にクランプして計算を続行していた。本改善により、全言語で明示的エラーを返す設計に統一した。 また、上記 2 つの改善に加えて、実装品質に関わる 2 点の追加修正を行った。第三は、大ファイル(de441.bsp 約 3 GB)への対応として、Rust・Python(PyO3)・Julia 版でファイル全体をメモリに読み込む方式から seek / mmap 方式へ切り替えた。第四は、JavaScript 版におけるセグメント時刻フィールドの変数名・単位ミスマッチを修正した。これはマルチセグメント BSP 使用時に誤ったセグメント選択を引き起こす潜在的な正確性の問題であった。なお、本稿のスコープは BSP リーダー層の改善のみであり、計算エンジン層(StellaCore等)の実装・精度は対象外とする。 English This paper is a follow-up to v1 (doi:10.5281/zenodo.20373856), reporting improvements made to the pure-language JPL SPK/BSP reader implementations (Stella series / Hesperis Ephemeris) across five programming languages: JavaScript,Swift, Rust, Julia, and Python (PyO3). Two improvements are reported. First, support for SPK Type 3 segments (Chebyshev position-and-velocity polynomials) has been added to all five implementations. Some ephemeris files such as DE430 use Type 3 format, which was not supported in v1. Second, the “silent clamp” behavior for out-of-coverage queries has been removed. In v1, queries outside the coverage range of an ephemeris segment were silently clamped to the boundary and computation continued. This has been corrected so that all implementations now raise an explicit error for out-of-range queries. In addition to these two main improvements, two supplementary fixes were made.Third, the Rust, Python (PyO3), and Julia implementations were updated to use seek-based or memory-mapped I/O instead of loading the entire file into memory, enablingpractical use with large ephemeris files such as DE441 (approximately 3 GB). Fourth, a variable naming and unit mismatch in the JavaScript implementation was corrected,where segment time fields were named startJd/endJd but actually stored secondspast J2000.0, causing potential incorrect segment selection with multi-segment BSPfiles. The scope of this paper is limited to BSP reader layer improvements. The computation engine layer (StellaCore, etc.) is out of scope.
Fields of Study & Subjects
Astro and Planetary Science
Stellar
planetary
and galactic studies
History and Developments in Astronomy
Publication details
- Journal / source
- Zenodo (CERN European Organization for Nuclear Research)
- Publication date
- 27 May 2026
- Language
- JA
- Document type
- Preprint