Skip to content

ktaletsk/artemis-ii-eclipse

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Artemis II Eclipse — live astropy in your browser

A small marimo notebook that reconstructs the Artemis II solar eclipse of 2026-04-07 as an interactive widget — with astropy.coordinates.SkyCoord running live in the browser via Pyodide.

Open in molab

What is this?

On April 7, 2026, NASA's Artemis II Orion capsule "Integrity" passed through the Moon's shadow about 10 000 km from the lunar surface. The crew saw the Sun fully occluded for roughly 54 minutes — far longer than any total eclipse visible from Earth, because at that distance the Moon's angular disk is roughly 25–35× larger than the Sun's.

This notebook reproduces the geometry of the event. The slider scrubs through a 2-hour window around the eclipse; on every tick, the widget recomputes the Sun–Moon geometry from Artemis II's viewpoint using astropy running in your browser tab. No kernel round-trip, no JavaScript.

I built and demoed it live on the Numerically Speaking podcast, 2026-05-01. This repo is the reference implementation.

Run it

The notebook ships with PEP 723 inline dependencies, so uv handles everything:

# Open in marimo (edit mode, all widgets interactive)
uvx marimo edit eclipse_widget_mo.py --sandbox

# Read-only / app view
uvx marimo run eclipse_widget_mo.py --sandbox

It also runs unmodified in molab — click the badge above. Pyodide handles all numerics in-browser, no server needed.

To refresh the ephemeris JSON from JPL Horizons (optional — the file is committed):

uv run prepare_data.py

Architecture

Two stages, by necessity: sunpy is not packaged for Pyodide, and Horizons cannot be reached from the browser sandbox.

prepare_data.py  →  artemis_data.json  →  eclipse_widget_mo.py
(sunpy + astropy,      (~50 KB, committed)     (pywidget + astropy
 runs once on a Mac,                            runs in Pyodide)
 queries JPL Horizons)
  • prepare_data.py queries JPL Horizons via sunpy for Artemis II (NAIF -1024), the Sun, the Moon, and Earth across the eclipse window at 30-second resolution, then writes Earth-relative ICRS vectors plus a precomputed 2D trajectory to artemis_data.json.
  • eclipse_widget_mo.py is the marimo notebook. The EclipseWidget class subclasses pywidget.PyWidget; its render and update methods are Python, but they never execute in the kernel. pywidget ships their source to the browser tab, where Pyodide runs them — including the astropy.SkyCoord.separation call that drives the right panel.

Built with

pywidget pywidget — pure-Python interactive widgets running in Pyodide/WASM. No JavaScript, no _esm blocks, no kernel round-trips.

Credits

Author

Konstantin Taletskiy — May 2026.

About

Artemis II eclipse geometry — a notebook with live astropy pywidget

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages