Skip to content

feat(site): sun, planets, eclipses and star labels in the real sky - #2

Merged
craig-o-curtis merged 6 commits into
mainfrom
feat/sky-sun-planets-eclipses-labels
Oct 22, 2026
Merged

craig-o-curtis merged 6 commits into
mainfrom
feat/sky-sun-planets-eclipses-labels

Conversation

@craig-o-curtis

Copy link
Copy Markdown
Contributor

The landing-page sky now shows everything in its real place, not just the stars and moon, and names what you point at.

Changes

  • Helsinki aurora: the curtains are farther north (750/1000 km), so the aurora sits low over the skyline. Its lower edge is about 4° up and the tallest rays reach about 17°, a third of Ísafjörður's height.
  • Planets: Mercury to Saturn are placed from JPL's Keplerian elements, with real brightness, and barely twinkle.
  • Sun: drawn only when it is really up and in frame. That's summer evenings at Helsinki and summer nights at Ísafjörður, often behind the mountains there. It's an ice-blue disc at true size with a soft glow, a faint, patchy 22° halo and a pillar when low. The sky stays dark.
  • Moon: it gets the same soft glow as the sun, scaled by phase. It's drawn at half brightness while the sun is up.
  • Solar eclipses: the moon covers the sun, showing a crescent, then the diamond ring, then an ice-blue corona at totality.
  • Lunar eclipses: a soft penumbra, then a dim umbra in the theme's purple (copper in real life) with a turquoise fringe at its edge.
  • Accuracy: eclipses need much tighter positions, so the orbits now run on terrestrial time (ΔT), the moon uses the full Meeus tables, and the sun gets aberration plus fitted perturbation terms.
  • Tooltips: hover or tap near the sun, moon, a planet or one of 324 IAU-named stars to see its name, e.g. "Capella · Auriga". The worker does the lookup; the main thread only places the label.
  • Popover: it now says it is always night here, but the stars, planets, moon and sun are where they really are. There are new credits for the planets and star names.

Verification

  • Checks: pnpm lint, pnpm check and pnpm build pass on every commit.
  • Against astronomy-engine:
    • Moon within 2–7″.
    • Sun–moon separation within 17″ over 40 years.
    • Planets within 5′, magnitudes within 0.2.
  • Solar eclipse, 2026-08-12: total at Ísafjörður, as it was. Helsinki comes out 79.1% covered, against the reference's 79.6%.
  • Lunar eclipses: 2025-09-07, 2026-03-03 and 2026-08-28 match the published umbral magnitudes (1.362, 1.151, 0.930).
  • Visual checks: checked in headless Chromium (Metal) by shifting the worker clock to summer sun times and to both eclipses. The preview code is not in these commits.
  • Tooltips: a pointer sweep finds 28 named stars over Ísafjörður and 4 over Helsinki right now. Helsinki has fewer because city light limits it to magnitude 4.2 and the cards cover part of the sky.

Helsinki sits about 6° of latitude south of Ísafjörður, so the same oval is
much farther away and lower. The curtains move from 550/900 km to
750/1000 km north: the lower border now sits about 4° above the skyline and
the tallest rays reach about 17°, a third of Ísafjörður's height.
The popover now says it is always night here, but the stars, planets, moon
and sun are where they really are right now.

- Planets: Mercury to Saturn from JPL's Keplerian elements (Standish), with
  Meeus ch. 41 magnitudes and Saturn's ring tilt. Drawn with the star
  program, barely twinkling. Within 5′ of astronomy-engine.
- Sun: only while it is really up and in frame (summer evenings at
  Helsinki, summer nights at Ísafjörður, often behind the mountains). An
  ice-blue disc at true size with a soft glow, a faint, patchy 22° halo and
  a pillar when low. The sky stays dark.
- Moon: the same soft glow as the sun, scaled by phase, and half as bright
  while the sun is up so the sun always outshines it.
- Eclipses: the moon covers the sun (crescent, diamond ring, ice-blue
  corona at totality), and Earth's shadow crosses the moon (soft penumbra,
  a dim umbra in the theme's purple where life has copper, a turquoise
  fringe at its edge). The moon lights the sky less while eclipsed.
- Accuracy for eclipses: terrestrial time (ΔT = 69.184 s) for the orbits,
  the full Meeus lunar tables, and solar aberration plus fitted
  perturbation terms. Moon within 2–7″ and the sun–moon separation within
  17″ of astronomy-engine; the 2026-08-12 eclipse is total at Ísafjörður
  and 79% at Helsinki, and the 2025-09-07, 2026-03-03 and 2026-08-28 lunar
  eclipses match the published umbral magnitudes (Danjon's rule).
scripts/build-stars.mjs also writes apps/site/public/star-names.json: the
IAU Catalog of Star Names (WGSN) matched to the Bright Star Catalogue by HR
number, as [record index, name, constellation]. 324 named stars, 3 KB
gzipped. stars.bin is unchanged byte for byte.
Hover (or tap) near the sun, the moon, a planet or one of the 324 IAU-named
stars over bare sky and a small label names it, with the constellation for
stars: "Capella · Auriga".

The page sends the pointer position to the worker at most once a frame and
the worker answers with the nearest object that is actually drawn: up,
clear of the skyline, bright enough for the site and the moonlight, and in
frame. The main thread only places the label. Star names load after the
stars, and the popover credits the IAU Working Group on Star Names.
oxfmt --check failed CI on apps/site/public/star-names.json. It is build
output served to browsers, kept compact on purpose, so the formatter
ignores it like dist.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is careful work. I checked the parts most likely to go wrong, and they hold up:

  • the full Meeus 47.A and 47.B tables (60 rows each, with E ** |M| applied to the new M = ±2 rows)
  • the umbra and penumbra radii
  • uncovered()
  • the tooltip's projection and magnitude cut, which match project() and STAR_VS

I've left two inline comments. The first one matters: a tap never shows a tooltip on a touch screen. The second is cosmetic.

Comment thread apps/site/src/components/Aurora.astro Outdated
Comment thread apps/site/src/components/Aurora.astro
- A tap never showed a label: a touch pointer fires pointerleave on <html>
  as the finger lifts, which cleared the label before the pick went out.
  Leaving now only clears for pointers that hover; a touch label stays
  until the next tap, which replaces or clears it.
- A label for something near the left or right edge ran off the screen.
  Its centre is now clamped to half its width (plus 4 px) from each side,
  as the below class already handles the top.

Found in review by @baldurpan.
@craig-o-curtis

Copy link
Copy Markdown
Contributor Author

Thanks for the careful review, @baldurpan. Both inline points are fixed in 4513c0c and pushed: touch taps now show labels, and labels stay inside the window at the sides. Replies are on each thread. Lint, format, type check and build pass locally; CI is running.

@baldurpan baldurpan left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 4513c0c. Both comments are fixed: a tap now names what is under it on touch screens, and labels stay inside the window at the sides. CI is green.

@craig-o-curtis
craig-o-curtis merged commit 8365ee1 into main Oct 22, 2026
1 check passed
@craig-o-curtis
craig-o-curtis deleted the feat/sky-sun-planets-eclipses-labels branch October 23, 2026 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants