Time Until Totality

mapsastronomydata visualization

Time Until Totality

I vaguely remember my first solar eclipse. I was probably eight years old. We either looked at the sun through x-ray film or we stuck our heads inside cardboard boxes with a pinhold projecting the eclipse on the opposite side, I don't remember. What I do know is that I failed to appreciate just how rare it was.

This notebook was inspired by the post below. Points on earth see a total eclipse about once every 400 years. How long you have to wait is a different question.

Implementation

The map at the top of the page displays precomputed eclipse paths based on DE440 ephemeris for near-term eclipses and DE441 past the year 3,000. I largely farmed out the eclipse computation to Claude Code and cross-checked the accuracy, but although I believe it’s valid, I don’t make any academic claims here about correctness. You should look at this and think about mortality or something, but you should definitely not look this and then look for cheap airline tickets in the year 2143.

Displaying and querying the paths is a little tricky. The paths are displayed by way of pre-baked WebP raster image tiles, colored with Mapbox’s raster-color feature (which, for better or for worse, probably worse, I worked on when I worked there). Years are encoded logarithmically as RGB triples and decoded and colored at runtime.

When the map is clicked, a zoom level 6 vector map tile is fetched, decoded, and the ID of all intersecting eclipse paths computed. Then, a GeoJSON path is fetched and displayed for each matching eclipse path. It’s a bit convoluted, but even with decimationa and aggregation, it wasn’t otherwise straightforward to display all 1,116 vector outlines.

Comments

See also

Visualizing Sloan Digital Sky Survey Data

Visualizing 3.3 million galaxies and quasars from the Sloan Digital Sky Survey

Night and Day

Earth's solar terminator on a Mapbox map using NASA Black Marble imagery and WebGL shaders

Denali Terrain

Cobbling together a 3D WebGPU terrain viewer

All notebooks →