How akbar3776/phantom-worlds-prototype works
Phantom Worlds is an astronomy research application combining SPHEREx/Gaia data preparation, spectral ML, time-series source analysis, artifact screening, proof reporting, and a web/API interface. The documented primary path runs from archive data and preprocessing through analysis to UI/API results; training and proof generation are additional product workflows. Edges are limited to relationships shown in the README or sampled source references; several internal API routes and unsampled modules are only described at subsystem level.
Main entry points: api.py FastAPI service · contracts.py Hour-0 contracts · tier_b_detectors.py Tier B detectors · fits_cutout.py FITS cutouts
Components 19
Data preparation
- Archive acquisition
phantom_worlds_dataset_kit/scripts/download_real_spherex_gaia.py - FITS cutouts
phantom_worlds/fits_cutout.py - Hour-0 contracts
phantom_worlds/contracts.py - Spectral dataset
phantom_worlds/real_ml_data.py - ML catalog
phantom_worlds_dataset_kit/scripts/build_ml_catalog.py
Science analysis
- Tier A metrics
phantom_worlds/tier_a_metrics.py - PSF deblending
phantom_worlds/tier_b_engine.py - Tier B detectors
phantom_worlds/tier_b_detectors.py - Solar system ephemeris
phantom_worlds/sso.py - Proof evaluation
phantom_worlds/tier_b_proof.py
Spectral ML
- Model training
ml/train.py - Spectral inference
phantom_worlds/ml_pipeline.py - Trained checkpoint
ml/spectral_discovery_pipeline.pkl.gz
Product delivery
- FastAPI service
phantom_worlds/api.py - Time-series viewer
phantom_worlds/static/viewer.js - Offline fallback
phantom_worlds/static/fallback_data.js
Other components
- Astronomer
- Astronomy archives
- Web/API user
Connections 26
- Astronomy archives → Archive acquisition: provides data
README.md - Archive acquisition → FITS cutouts: finds frames
README.md - FITS cutouts → Hour-0 contracts: builds cutouts
README.md - FITS cutouts → Spectral dataset: extracts cubes
README.md - Spectral dataset → Model training: supplies spectra
README.md - Model training → Spectral inference: trains model
ml/train.py - Model training → Trained checkpoint: exports checkpoint
README.md - Trained checkpoint → FastAPI service: loads at startup
README.md - Hour-0 contracts → Tier A metrics: provides contracts
phantom_worlds/tier_a_metrics.py - Hour-0 contracts → PSF deblending: provides contracts
phantom_worlds/tier_b_engine.py - FITS cutouts → PSF deblending: reads cutouts
phantom_worlds/tier_b_engine.py - PSF deblending → Tier B detectors: prepares scenes
phantom_worlds/tier_b_detectors.py - Hour-0 contracts → Tier B detectors: loads contracts
phantom_worlds/tier_b_detectors.py - Spectral inference → Tier B detectors: classifies candidates
phantom_worlds/tier_b_detectors.py - Solar system ephemeris → FastAPI service: serves ephemeris
phantom_worlds/api.py - Tier A metrics → FastAPI service: serves metrics
phantom_worlds/api.py - Tier B detectors → FastAPI service: serves searches
phantom_worlds/api.py - Proof evaluation → FastAPI service: serves proof
phantom_worlds/api.py - FastAPI service → Tier A metrics: computes metrics
phantom_worlds/api.py - FastAPI service → Time-series viewer: serves interface
README.md - FastAPI service → Offline fallback: serves fallback
README.md - Web/API user → FastAPI service: requests analysis
README.md - Web/API user → Time-series viewer: uses viewer
README.md - ML catalog → Spectral dataset: builds catalog
phantom_worlds_dataset_kit/scripts/build_ml_catalog.py - Proof evaluation → Hour-0 contracts: reads contracts
phantom_worlds/tier_b_proof.py - Proof evaluation → Tier B detectors: evaluates detections
phantom_worlds/tier_b_proof.py