All Things Spatial
ATS Labs · ATS Brand · React · experimental

Nightfall

Earth at night, live — city lights under the real-time day/night terminator.

What it is

Nightfall renders the night side of the planet in real time. NASA's VIIRS Black Marble city-lights composite sits beneath a live day/night terminator, all three twilight bands (civil, nautical, astronomical), the subsolar and sublunar points, the current moon phase and illumination, a ±24-hour time scrubber, and a time-lapse mode that sweeps the terminator around the globe. There is no Esri basemap in the app at all — the imagery is NASA GIBS WMTS.

The distinctive engineering is the terminator math. Rather than searching latitude-by-longitude for where the sun sets, Nightfall treats each twilight boundary as exactly what it geometrically is: the sun's altitude at any point equals 90° minus the great-circle distance to the subsolar point, so the region where altitude falls below a threshold h is a perfect geodesic circle — a spherical cap of radius (90° + h) centered on the antisolar point. That yields exact boundaries with no iteration, roughly a hundred times cheaper, and — critically — it stays correct near the equinoxes, where the per-meridian search method breaks because the night cap touches neither pole.

It is a portfolio piece and a conversation starter as much as a tool: an elegant, correct, visibly branded demonstration of ATS's cartographic and mathematical craft, suited to science communicators, educators, planetarium and museum contexts, and anyone who wants to see the shape of night on Earth.

The experience

The app opens on the live view: the night hemisphere sits opposite a glowing gold sun disc, city lights blazing across the dark side.

The data — where it comes from

Nightfall uses one imagery service and computes all geometry client-side; there is no basemap or credentialed service.

SourceWhat it providesRefreshCostAttribution
NASA GIBS — VIIRS Black MarbleCity-lights night imagery (2016 composite), WMTS tiles to level 8Static composite (anonymous WMTS)Free / publicNASA GIBS / ESDIS
suncalc (client library)Solar & lunar position, moon phase & illuminationRecomputed per minute (or per tick)Free / open sourceV. Agafonkin (suncalc)
Terminator & twilight geometryGeodesic twilight caps computed in-browserPer refresh / per scrub tickIn-app (no service)ATS (src/lib/terminator.ts)

How it was assembled

Nightfall is an ATS-branded React 19 + Tailwind 4 application on the ArcGIS Maps SDK for JavaScript. It carries no Esri UI widgets.

Engineering decisions worth calling out