From Lunar Tables to SPICE

This page explains the technical background of the SPICE-based lunar calculator. The calculator displays lunar, solar, and orientation quantities derived from NASA NAIF SPICE kernels through a backend API. It also displays selected reference quantities from the classical analytical tradition so that the numerical SPICE result can be understood in its historical and mathematical context.

Current implementation: The active calculator uses a live backend API. The browser sends a Julian Date in Terrestrial Time, the backend evaluates SPICE through Python and spiceypy, and the browser displays the returned JSON values. An earlier set of 15-minute-cadence Hermite interpolation work is described here as a development and possible static-hosting fallback method, and no longer represents the active computation path of the calculator.

Note on authorship: Throughout this document, the term “Chapront” is used as a shorthand reference to the collaborative analytical work of Michelle Chapront-Touzé and Jean Chapront at the Bureau des Longitudes in Paris. No distinction is intended between their respective contributions.

1. Historical Context: From Tables to Analytical Theory

For centuries, predicting the Moon’s position required extensive numerical labor. Astronomers relied on lunar tables derived from the theories of Hansen, Hill and E. W. Brown. These tables served as much more than simple lookup charts, encoding many corrections and periodic terms refined across generations of observation.

Every eclipse prediction, occultation timing, and nautical longitude solution depended on evaluating, interpolating, and combining those tabular quantities with great care. The tables represented a serious mathematical achievement, but they were also products of their medium. The theory had to be expressed as printed numerical procedures, and any change in constants, observations, or adopted theory might require substantial recomputation and republication.

The digital era made it possible to replace printed interpolation with direct analytical evaluation. Chapront-Touzé and Chapront transformed lunar theory into compact trigonometric series expressed through lunar and solar arguments. In simplified form, they represented lunar quantities as a sum of periodic terms:

$$ Q(t) = \sum_j A_j \sin\!\left( \alpha_j D + \beta_j M + \gamma_j M' + \delta_j F + \varepsilon_j \Omega \right) $$

Here \(D, M, M', F,\) and \(\Omega\) are classical lunar arguments, and each term has a fitted amplitude and phase combination. This turned the Moon’s motion from a printed table into continuous functions of time that could be evaluated, differentiated, and embedded in software.

2. Chapront / ELP and Why It Still Matters

The ELP family of lunar theories remains important because it gives the Moon’s motion in a transparent analytical language. Longitude, latitude, distance, and libration-related quantities can be traced back to explicit argument combinations and periodic terms. That makes the model valuable for education, historical comparison, and symbolic understanding.

For the calculator, however, these analytical quantities are no longer the source of the calculator’s primary lunar orientation values. They remain useful as reference quantities: Delaunay arguments, nutation-related angles, obliquity, and fundamental elements help show how traditional lunar theory organizes the same physical system that SPICE now represents numerically.

3. SPICE and the Numerical Era

NASA’s SPICE system, developed and maintained by the Navigation and Ancillary Information Facility (NAIF) at the Jet Propulsion Laboratory, provides a standard framework for using spacecraft, planetary, and satellite geometry. SPICE uses kernels to store ephemerides, reference-frame definitions, orientation data, constants, and time information.

Rather than expressing the Moon’s motion as a fixed trigonometric expansion, modern JPL ephemerides represent positions, velocities and orientations through numerical solutions and polynomial representations stored in binary kernels. SPICE then selects the appropriate segment and evaluates the quantity in the requested frame.

For a polynomial representation using Chebyshev polynomials, the general form is:

$$ F(t) = \sum_{m=0}^{M} c_m T_m(\tau), \qquad \tau = \frac{2(t-t_{\mathrm{mid}})} {t_{\mathrm{end}}-t_{\mathrm{start}}}, \qquad -1 \leq \tau \leq 1 $$

The important practical point is not that the user must evaluate these polynomials computationally. Rather, SPICE provides the machinery to obtain state vectors, rotations, and frame transformations from its coherent kernel set. This calculator uses that machinery directly via a backend API.

4. Current Calculator Architecture

The current calculator uses a live SPICE/API architecture. The browser uses the following process flow:

$$ \text{HTML page} \rightarrow \text{API request} \rightarrow \text{Python / spiceypy} \rightarrow \text{NAIF SPICE kernels} \rightarrow \text{JSON result} \rightarrow \text{display} $$

The backend loads the required kernels, converts the requested Julian Date into SPICE ephemeris time, evaluates the Moon and Sun geometry, transforms the relevant vectors into the required frames, and returns the displayed values to the page.

The current kernel set used by the backend (from NAIF Generic Kernels Repository) is:

The left side of the calculator display contains SPICE-derived values. The right side contains reference and educational quantities such as sidereal time, nutation, obliquity, Delaunay arguments, and derived fundamental elements.

5. State Vectors and Reference Frames

The calculator uses SPICE state vectors as its geometric foundation. For the Moon’s displayed state vector, the backend requests the Moon relative to the Earth in the J2000 ecliptic frame:

$$ \mathbf{r}_{\oplus\rightarrow M} = (x_M,\; y_M,\; z_M) $$

This vector points from the center of the Earth to the center of the Moon. Its corresponding velocity components are:

$$ \dot{\mathbf{r}}_{\oplus\rightarrow M} = \left( \frac{dx_M}{dt},\; \frac{dy_M}{dt},\; \frac{dz_M}{dt} \right) $$

The J2000 ecliptic frame is fixed to the orientation of Earth’s orbital plane at the standard J2000 epoch. Its \(+x\) axis points toward the J2000 zero-longitude / vernal-equinox direction, its \(+y\) axis points 90 degrees around the ecliptic in the direction of increasing ecliptic longitude, and its \(+z\) axis points north of the J2000 ecliptic plane.

The Earth–Moon distance is the length of this vector:

$$ \Delta_{\oplus M} = \sqrt{ x_M^2 + y_M^2 + z_M^2 } $$

6. SPICE-Based Lunar Orientation: ℓ, b, and c

The calculator’s geocentric libration values are derived from SPICE state vectors together with the Moon-fixed reference frame. SPICE returns the Moon’s position as an Earth-to-Moon vector. For libration, however, the geometric question is reversed: from the Moon, where is Earth? Therefore the Earth-to-Moon vector becomes:

$$ \mathbf{r}_{M\rightarrow\oplus} = -\mathbf{r}_{\oplus\rightarrow M} $$

That Moon-to-Earth vector is transformed from the inertial J2000 frame into the Moon-fixed IAU_MOON frame:

$$ \mathbf{r}_{\mathrm{fixed}} = R_{\mathrm{J2000}\rightarrow\mathrm{IAU\_MOON}} \, \mathbf{r}_{M\rightarrow\oplus} $$

If \(\mathbf{r}_{\mathrm{fixed}}=(x_f,y_f,z_f)\), then the sub-Earth selenographic longitude and latitude are:

$$ \ell = \operatorname{atan2}(y_f,x_f), \qquad b = \arcsin\!\left( \frac{z_f}{\sqrt{x_f^2+y_f^2+z_f^2}} \right) $$

The position angle \(c\) is computed from the SPICE lunar north-pole direction projected into the observer’s sky plane. The sign convention used by the calculator is part of the calculator’s position-angle convention.

7. What the Calculator Displays

Group Purpose
Lunar orientation Geocentric \(\ell\), \(b\), and \(c\) derived from SPICE vectors and lunar body orientation.
Earth–Moon geometry Distance, right ascension, declination, ecliptic longitude, and ecliptic latitude of the Moon.
Moon state vector Earth-center to Moon-center position and velocity in the J2000 ecliptic reference frame.
Lunar body orientation Right ascension and declination of the lunar north pole and prime meridian.
Sun as seen from the Moon Moon–Sun distance and the Sun’s direction from the Moon.
Sun as seen from Earth Earth–Sun distance and the Sun’s geocentric direction, derived from the displayed vector geometry.
Other Values Educational and reference quantities: \(\Delta T\)-related UT, GMST, nutation, obliquity, Delaunay arguments and fundamental elements.

Note on ΔT: The calculator automatically fills the \(\Delta T\) field using a NASA polynomial approximation intended for broad historical coverage. This is useful as a starting value, but it is not the best source for the current epoch. For modern dates, users should verify \(\Delta T\) against current published values (i.e., IERS) before relying on UT or sidereal-time quantities for precision work. The primary SPICE geometry is evaluated for the entered TT epoch.

8. Earlier Hermite Transport Architecture

Before the live API approach was adopted, an alternate deployment method was explored: sampling SPICE-derived values at a uniform cadence over the entire time frame, and reconstructing intermediate values in the browser via cubic Hermite interpolation.

That method was designed for ordinary static hosting, where the server cannot run Python, load SPICE kernels, or execute SPICE calls. The idea was:

$$ \text{SPICE offline} \rightarrow \text{sampled values and derivatives} \rightarrow \text{cubic Hermite interpolation} \rightarrow \text{browser evaluation}. $$

For values \(f_0\), \(f_1\) and derivatives \(\dot f_0\), \(\dot f_1\) at endpoints \(t_0\) and \(t_1\), the cubic Hermite interpolant is:

$$ \begin{aligned} f(t) &= h_{00}(\tau) f_0 + h_{10}(\tau) (t_1-t_0)\dot f_0 + h_{01}(\tau) f_1 + h_{11}(\tau) (t_1-t_0)\dot f_1,\\[4pt] \tau &= \frac{t-t_0}{t_1-t_0} \\[4pt] h_{00} &= 2\tau^3 - 3\tau^2 + 1 \qquad h_{10} = \tau^3 - 2\tau^2 + \tau \\[4pt] h_{01} &= -2\tau^3 + 3\tau^2 \qquad h_{11} = \tau^3 - \tau^2 \end{aligned} $$

That work remains useful as a possible static fallback and as validation history. It is not the active method used by the current calculator.

9. Kernel Revisions and Reproducibility

SPICE is not a frozen model. New kernels may incorporate improved constants, refined fits, updated dynamical parameters, and additional observations. For reproducibility, a calculator release must state exactly which kernels were used.

This project therefore defines a calculation by the complete combination of:

Future releases may use newer kernels, but each release should remain reproducible by retaining its kernel manifest, checksums, code, and validation outputs.

All SPICE kernels used in this analysis were obtained directly from the NAIF repository and verified using SHA-256 checksums. The complete verification package — including all kernel files, manifest, hash list, and verification instructions — is provided as SPICE_verification_package.zip.

To verify integrity for future releases, compute SHA-256 hashes for your local copies, and confirm they match the values listed in kernels_hashes.sha256. The hash algorithm follows NIST FIPS 180-4 (SHA-256) using Python’s hashlib implementation.

10. Relationship to the Larger Eclipse-Geometry Framework

The present calculator is the first public module of a larger SPICE-based lunar and eclipse-geometry framework. The current module establishes the state-vector, frame, and lunar-orientation foundation.

Future modules can build from the same geometry to compute topocentric, heliocentric and planocentric quantities. In that broader framework, coordinate frames are chosen because they simplify a particular geometric operation. The long-term direction is:

$$ \text{SPICE geometry} \rightarrow \text{lunar orientation} \rightarrow \text{observer and source geometry} \rightarrow \text{fundamental-plane coordinates} \rightarrow \text{Besselian / eclipse quantities} \rightarrow \text{3-D limb and umbra modeling}. $$

The fundamental plane is not treated as something that exists only during an eclipse. The plane is defined by the instantaneous Sun–Moon geometry; an eclipse is the special case in which the resulting shadow geometry intersects Earth in an observationally significant way.

11. Historical Perspective and Legacy

The development of lunar ephemerides represents a progression of representations of the same physical reality. Printed lunar tables, analytical trigonometric series and numerical SPICE kernels become different mathematical languages for describing the Moon’s motion.

Chapront’s analytical work remains valuable because it exposes structure such as arguments, periodic terms, amplitudes, and long-period behavior. SPICE provides the operational geometric standard needed for high-precision modern work. This project connects those traditions by using SPICE for numerical truth while preserving selected analytical quantities for context and education.

12. Credits & Intent

This project was created to provide a single, practical source for modern lunar orientation and libration calculations while also serving as an educational and verification tool. It is intended for readers, students, eclipse observers, and researchers who want access to high-quality lunar geometry together with the mathematical and historical context behind it — without unnecessary complexity or an overwhelming number of options.

The author gratefully acknowledges Ernie Wright of NASA for recommendations, advice, and inspiration regarding the use of SPICE in lunar and eclipse geometry work.

13. Authorship, Attribution, and Citation

The numerical ephemerides, lunar orientation data, SPICE system, and NAIF documentation are NASA/JPL/NAIF resources, and remain the work of their respective institutions and authors.

The calculator architecture, backend implementation, SPICE-based vector workflow for deriving \(\ell\), \(b\), and \(c\), explanatory documentation, validation structure, and public presentation were developed in 2026 by Dan McGlaun / SolarEclipses.com / 5th Contact, LLC.

Suggested citation:

Dan McGlaun. SPICE-Based Lunar and Solar Geometry Calculator. Version 0.1.0. Dan McGlaun, 2026. ORCID: 0009-0003-6871-0260. DOI: 10.5281/zenodo.20149119.


References

SPICE acknowledgment: This work makes use of the NASA Navigation and Ancillary Information Facility (NAIF) SPICE system, developed and maintained by the Jet Propulsion Laboratory, California Institute of Technology, under contract with NASA.