Skip to content

stonyDeveloper/artemis2-analytics

Repository files navigation

Cislunar Mission Analytics

An end-to-end Python data platform analysing all crewed cislunar missions from Apollo 8 (1968) through Artemis II (2026).

Built to be open, iterable, and publication-ready.


What it does

  • Reconstructs and visualises trajectories for all 11 crewed cislunar missions
  • Compares Apollo and Artemis missions on distance, speed, duration, and mission type
  • Tracks space weather (solar flares, CMEs, Kp index) during the Artemis II window
  • Renders a fully interactive 3D cislunar map with Earth, Moon, Van Allen belts, and event markers
  • Pulls real data from JPL Horizons, NASA DONKI, NASA Images, and NOAA SWPC

Quick start

# 1. Install dependencies
pip install -r requirements.txt

# 2. Set your NASA API key (free at api.nasa.gov)
cp .env.example .env
# edit .env and add your key

# 3. Generate trajectory data
python generate_trajectories.py

# 4. Fetch live data from NASA APIs
python scripts/fetch_all.py

# 5. Launch the dashboard
python -m streamlit run dashboard/app.py

Missions covered

Mission Year Type Max distance
Apollo 8 1968 Lunar orbit 376,745 km
Apollo 10 1969 Lunar orbit 397,500 km
Apollo 11 1969 Lunar landing 385,000 km
Apollo 12 1969 Lunar landing 385,500 km
Apollo 13 1970 Free return (abort) 401,056 km
Apollo 14 1971 Lunar landing 389,000 km
Apollo 15 1971 Lunar landing 392,000 km
Apollo 16 1972 Lunar landing 399,000 km
Apollo 17 1972 Lunar landing 400,187 km
Artemis I 2022 Lunar flyby (uncrewed) 430,000 km
Artemis II 2026 Lunar flyby 406,771 km

Project structure

artemis2-analytics/
|-- dashboard/
|   |-- app.py                       # 7-page Streamlit dashboard
|
|-- src/
|   |-- data/
|   |   |-- missions.py              # single source of truth for all 11 missions
|   |   |-- fetchers/
|   |       |-- horizons.py          # JPL Horizons trajectory fetcher
|   |       |-- donki.py             # NASA DONKI space weather fetcher
|   |       |-- images.py            # NASA Image Library fetcher
|   |       |-- noaa.py              # NOAA SWPC Kp + solar cycle fetcher
|   |-- viz/
|       |-- charts.py                # reusable Plotly chart builders
|       |-- cislunar_3d.py           # 3D cislunar space visualisation
|
|-- scripts/
|   |-- fetch_all.py                 # orchestration pipeline
|
|-- notebooks/
|   |-- 01_trajectories.ipynb        # trajectory analysis
|   |-- 02_mission_comparison.ipynb  # cross-mission comparison
|   |-- 03_space_weather.ipynb       # space weather during Artemis II
|
|-- data/
|   |-- raw/                         # CSV/JSON files (gitignored)
|
|-- utils/
|   |-- helpers.py                   # unit conversion utilities
|
|-- generate_trajectories.py         # physics-based trajectory generator
|-- phase1_setup.py                  # environment verification
|-- phase2_collect.py                # legacy entry point (delegates to scripts/fetch_all.py)

Architecture

MISSIONS registry  (src/data/missions.py)
    Single source of truth for metadata, colors, events, crew, experiments.

Fetchers  (src/data/fetchers/)
    Modular, independently testable. Each wraps one external API.
    horizons.py -> JPL Horizons (with reconstructed fallback)
    donki.py    -> NASA DONKI space weather
    images.py   -> NASA Image Library
    noaa.py     -> NOAA SWPC Kp + solar cycle

Charts  (src/viz/)
    Return go.Figure objects with no Streamlit dependencies.
    Importable from notebooks or any other context.

Dashboard  (dashboard/app.py)
    Imports from all src modules. Handles layout and user interaction only.

Adding a new mission: edit MISSIONS in src/data/missions.py. Everything else picks it up automatically.


Data sources

Source What it provides Key required
JPL Horizons Spacecraft state vectors No (via astroquery)
NASA DONKI Solar flares, CMEs, SEPs Yes (free at api.nasa.gov)
NASA Image Library Mission photo metadata No
NOAA SWPC Kp index, solar cycle No

Trajectory files include a data_source column:

  • jpl_horizons -- real spacecraft ephemeris from JPL
  • reconstructed -- physics model from confirmed NASA mission parameters

Extending the project

  • New mission: add an entry to MISSIONS in src/data/missions.py
  • New chart: add a function to src/viz/charts.py
  • New data source: add a module to src/data/fetchers/, export from __init__.py
  • New dashboard page: add an elif page == "..." block in dashboard/app.py

Requirements

  • Python 3.10+
  • NASA API key (free): https://api.nasa.gov
  • See requirements.txt for full dependency list