Skip to content

Codeptor/astrolabe

Repository files navigation

Astrolabe

Interactive Pioneer-plaque-style pulsar map generator.

Astrolabe lets you pick an observer anywhere in the galaxy, select a pulsar set optimized for triangulation, and render the result as a clean SVG map in the visual language of the 1972 Pioneer plaque.

Demo

Features

  • Select any observer from a curated local star catalogue.
  • Resolve additional stars through CDS Sesame / SIMBAD fallback.
  • Enter custom galactic or equatorial coordinates.
  • Toggle between the computed map and the hand-matched 1972 plaque mode.
  • Choose pulsars with GDOP, fastest, closest, longest, stable, or random selection strategies.
  • Shift the epoch with a time slider to apply synthetic proper motion and pulsar spin-down.
  • Export the current map as SVG, PNG, or print SVG with legend block.
  • Share the exact current view through URL state or iframe embed code.

Quick Start

pnpm install
pnpm dev

Open http://localhost:4321.

Scripts

pnpm dev               # start Astro dev server (Vite)
pnpm build             # production build (static + serverless functions)
pnpm preview           # serve the production build locally
pnpm test              # run vitest
pnpm test:watch        # watch mode
pnpm update-catalogue  # download and reprocess the ATNF pulsar catalogue

How To Use

  1. Search for a star in the header, or open coords and enter a custom observer position.
  2. Adjust the pulsar count and selection algorithm.
  3. Use the epoch slider to move backward or forward in time.
  4. Hover a pulsar line to inspect it, click to lock it, click the footer tooltip to copy its data.
  5. Export or share the current view.

Keyboard Shortcuts

  • / focus star search
  • R random curated star
  • Shift+R random galactic point
  • K custom coordinates
  • M toggle 1972 mode
  • A cycle algorithm
  • T cycle theme
  • S toggle audio
  • G toggle rings
  • L toggle pulsar list
  • [ / ] decrease or increase pulsar count
  • , / . move epoch by 10 kyr
  • < / > move epoch by 1 Myr
  • 0 reset epoch
  • Tab / Shift+Tab cycle locked pulsars
  • ? open help
  • Esc close panels or reset

Stack

  • Astro v6 (static output + Vercel adapter)
  • React 19 as a client:load island via @astrojs/react
  • Tailwind CSS v4 via @tailwindcss/vite
  • @vercel/og for OG image rendering
  • Vitest
  • pnpm

All plaque computation happens client-side. The only server paths are /api/star-resolve (SIMBAD-backed lookup) and /og.png (runtime OG image), both deployed as Vercel serverless functions.

Architecture

Main Files

  • src/pages/index.astro: static shell mounting <App client:load>
  • src/layouts/RootLayout.astro: <head> metadata, fonts, inline theme script
  • src/components/App.tsx: application root — URL state, controls, data loading
  • src/components/plaque.tsx: SVG plaque renderer
  • src/components/ThemeScript.astro: no-flash theme loader
  • src/lib/coordinates.ts: galactic and Cartesian coordinate transforms
  • src/lib/pulsar-selection.ts: pulsar selection strategies, including GDOP
  • src/lib/binary-encoding.ts: pulsar period to binary tick encoding
  • src/lib/proper-motion.ts: synthetic time-machine drift and spin evolution
  • src/lib/pioneer-original.ts: fixed 1972 plaque reconstruction
  • src/lib/theme.ts: vanilla theme hook
  • src/pages/api/star-resolve.ts: SIMBAD-backed star lookup (serverless)
  • src/pages/og.png.ts: runtime OG image via @vercel/og
  • scripts/process-catalogue.ts: ATNF tarball to public/data/pulsars.json

Data

  • public/data/pulsars.json: 3,924 processed pulsars from ATNF v2.7.0
  • public/data/stars.json: 97 curated stars for the picker

Source catalogue: https://www.atnf.csiro.au/research/pulsar/psrcat/

Data Pipeline

pnpm update-catalogue downloads the ATNF tarball, extracts psrcat.db, parses pulsar periods and distance estimates, converts RA/Dec to galactic coordinates, and writes the processed JSON used by the app.

Distance preference in the processor:

  1. DIST1
  2. DIST_DM
  3. PX converted to kpc

URL State

The app serializes shareable state into query params:

  • mode: 1972 or computed mode
  • from: observer (star or coord:l=...,b=...,d=...)
  • p: locked pulsar
  • n: pulsar count
  • rings: rings toggle
  • theme: active theme
  • algo: selection algorithm
  • e: epoch offset in years

Verification

Current repo verification surface:

pnpm test
pnpm build

At the time of writing, both pass.

Caveats

  • SIMBAD fallback only returns stars with a usable parallax-derived distance.
  • The time-machine motion is synthetic and deterministic, not measured proper motion from ATNF.
  • The 1972 mode prioritizes visual fidelity to the original plaque over strict modern astrophysical accuracy.

License

MIT

About

Interactive Pioneer-plaque-style pulsar map generator.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors