Skip to content

PetalNet/spectral

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spectral

A planetarium for the stellar classification sequence. Pick a spectral class, subclass, and luminosity class, and the page shows the star's true (CIE 1931) blackbody color, its temperature, representative mass / radius / luminosity, and a real catalogued star that matches — with a photograph where one honestly exists.

Live: https://spectral.petalcat.dev

The sequence

The classic Harvard sequence runs hot to cool as O B A F G K M. Spectral extends it at both ends and along the parallel branches that the main sequence leaves out:

  • W — Wolf-Rayet stars: evolved, massive stars hotter than O, shedding their outer layers.
  • O B A F G K M — the main sequence, blue-white through orange-red.
  • L T Y — the brown dwarfs: substellar objects that never sustained hydrogen fusion, fading from deep red into the infrared.
  • S and C — the cool giant branches (zirconium-oxide S stars and carbon stars) that run parallel to K/M on the asymptotic giant branch.
  • D — white dwarfs: Earth-sized stellar remnants, off the main temperature sequence.

Each class carries a subclass (0 hottest → 9 coolest). The MK luminosity classes (Ia bright supergiant → V main sequence) apply to the main sequence; the parallel and remnant classes (W, S, C, D) use their own published spectral types instead.

Features

  • True color — the star's color is computed from Planck's law integrated against the CIE 1931 color-matching functions, not an eyeballed palette. Real star colors are subtle and pale by design.
  • Catalogue search — search the top bar by star name (Sirius, Betelgeuse, WR 102, …) to jump straight to a star's class and subtype.
  • Featured stars — every selection surfaces the nearest real catalogued star, with a licensed photograph when one is available and an honest "no image" note when it isn't.
  • Shareable URLs — the current selection lives in the query string, with working Back/Forward.
  • Keyboard-friendly and accessible; respects prefers-reduced-motion.

Structure

File What it is
index.html The entire app — hand-authored HTML, CSS, and vanilla JS. No build step, no dependencies.
data.json The star catalogue (stars) and base64-embedded photographs (images).
img/ Source photographs, referenced by the catalogue.

Run it locally

It's a static site — serve the directory with anything:

python3 -m http.server 8000
# or
npx serve .

Then open http://localhost:8000.

A generic container is included:

docker build -t spectral .
docker run --rm -p 8000:80 spectral

About

A planetarium for the stellar classification sequence — W/OBAFGKM/LTY/S/C/D, with true blackbody colors and real catalogued stars.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages