# deaththekid1614/exoplanet-2.0 architecture

> Architecture diagram of the GitHub repository deaththekid1614/exoplanet-2.0, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/deaththekid1614/exoplanet-2.0
- Repository: https://github.com/deaththekid1614/exoplanet-2.0

## Overview

This repository is a CPU-based TESS transit-detection pipeline: users provide TIC IDs, and the pipeline searches light curves, evaluates candidate evidence, classifies signals, estimates parameters, and produces results. The graph follows the documented stage order and includes the patched scoring/classification behavior and optional visualization. Stage-level execution links are documented in the README; implementation excerpts are partial, so unsampled details and uncertain internal calls are omitted.

Main entry points: [`run_pipeline.py`](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/run_pipeline.py) (Pipeline runner), [`tess_pipeline/stage1_preprocess.py`](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage1_preprocess.py) (Light-curve prep), [`tess_pipeline/stage2_detect.py`](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage2_detect.py) (Transit search), [`tess_pipeline/stage7_ensemble.py`](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage7_ensemble.py) (Result ensemble)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Pipeline entry"]
  node_runner["Pipeline runner<br/>[run_pipeline.py]"]
  node_config["Configuration<br/>[config.py]"]
  node_demo["Demo data<br/>[demo_data.py]"]
end

subgraph group_observations["Light-curve analysis"]
  node_preprocess["Light-curve prep"]
  node_processed[("Processed curves")]
  node_search["Transit search<br/>[stage2_detect.py]"]
  node_harmonics["Harmonic checks"]
end

subgraph group_assessment["Candidate assessment"]
  node_stellar["Stellar lookup<br/>[stage3_gaia.py]"]
  node_physics["Physics checks<br/>[stage4_physics.py]"]
  node_classifier["ML classifier<br/>[stage5_classify.py]"]
  node_patched_rules["Patched scoring rules"]
  node_supervised["Supervised training"]
  node_parameters["Parameter fitting<br/>[stage6_params.py]"]
  node_ensemble["Result ensemble<br/>[stage7_ensemble.py]"]
end

subgraph group_outputs["Results and review"]
  node_results["CSV results<br/>[run_pipeline.py]"]
  node_visualization["Visual reports"]
  node_explainability["SHAP explanations<br/>[shap_explainer.py]"]
end

node_user(("TIC ID user"))
node_mast["MAST / TESS"]
node_gaia["Gaia / TIC data"]

node_user -->|"provides TIC IDs"| node_runner
node_runner -->|"loads settings"| node_config
node_runner -->|"generates demo data"| node_demo
node_runner -->|"runs stage 1"| node_preprocess
node_mast -->|"supplies light curves"| node_preprocess
node_preprocess -->|"saves curves"| node_processed
node_runner -->|"runs stage 2"| node_search
node_search -->|"loads processed curves"| node_preprocess
node_search -->|"checks aliases"| node_harmonics
node_runner -->|"runs stage 3"| node_stellar
node_gaia -->|"provides star data"| node_stellar
node_runner -->|"runs stage 4"| node_physics
node_physics -->|"loads curves"| node_preprocess
node_runner -->|"runs stage 5"| node_classifier
node_runner -->|"runs stage 6"| node_parameters
node_parameters -->|"loads curves"| node_preprocess
node_runner -->|"runs stage 7"| node_ensemble
node_patched_rules -->|"patches classification"| node_classifier
node_patched_rules -->|"combines physics and ML"| node_ensemble
node_supervised -->|"computes combined score"| node_ensemble
node_runner -->|"writes results"| node_results
node_runner -.->|"optionally runs stage 8"| node_visualization
node_visualization -->|"loads curves"| node_processed

click node_runner "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/run_pipeline.py"
click node_config "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/config.py"
click node_demo "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/demo_data.py"
click node_preprocess "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage1_preprocess.py"
click node_processed "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage1_preprocess.py"
click node_search "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage2_detect.py"
click node_harmonics "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/harmonic/harmonic_analysis.py"
click node_stellar "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage3_gaia.py"
click node_physics "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage4_physics.py"
click node_classifier "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage5_classify.py"
click node_patched_rules "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/patches/patch_scientific_validity.py"
click node_supervised "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/patches/patch_supervised_classifier.py"
click node_parameters "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage6_params.py"
click node_ensemble "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage7_ensemble.py"
click node_results "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/run_pipeline.py"
click node_visualization "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage8_visualize.py"
click node_explainability "https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/explainability/shap_explainer.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_runner,node_config,node_demo,node_user toneBlue
class node_preprocess,node_processed,node_search,node_harmonics toneAmber
class node_stellar,node_physics,node_classifier,node_patched_rules,node_supervised,node_parameters,node_ensemble toneMint
class node_results,node_visualization,node_explainability toneRose
class node_mast,node_gaia toneIndigo
```

## Components

### Pipeline entry

- [Pipeline runner](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/run_pipeline.py): `run_pipeline.py`
- [Configuration](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/config.py): `tess_pipeline/config.py`
- [Demo data](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/demo_data.py): `tess_pipeline/demo_data.py`

### Light-curve analysis

- [Light-curve prep](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage1_preprocess.py): `tess_pipeline/stage1_preprocess.py`
- [Processed curves](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage1_preprocess.py): `tess_pipeline/stage1_preprocess.py`
- [Transit search](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage2_detect.py): `tess_pipeline/stage2_detect.py`
- [Harmonic checks](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/harmonic/harmonic_analysis.py): `tess_pipeline/harmonic/harmonic_analysis.py`

### Candidate assessment

- [Stellar lookup](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage3_gaia.py): `tess_pipeline/stage3_gaia.py`
- [Physics checks](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage4_physics.py): `tess_pipeline/stage4_physics.py`
- [ML classifier](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage5_classify.py): `tess_pipeline/stage5_classify.py`
- [Patched scoring rules](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/patches/patch_scientific_validity.py): `patches/patch_scientific_validity.py`
- [Supervised training](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/patches/patch_supervised_classifier.py): `patches/patch_supervised_classifier.py`
- [Parameter fitting](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage6_params.py): `tess_pipeline/stage6_params.py`
- [Result ensemble](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage7_ensemble.py): `tess_pipeline/stage7_ensemble.py`

### Results and review

- [CSV results](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/run_pipeline.py): `run_pipeline.py`
- [Visual reports](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/stage8_visualize.py): `tess_pipeline/stage8_visualize.py`
- [SHAP explanations](https://github.com/deaththekid1614/exoplanet-2.0/blob/main/tess_pipeline/explainability/shap_explainer.py): `tess_pipeline/explainability/shap_explainer.py`

### Other components

- **TIC ID user**
- **MAST / TESS**
- **Gaia / TIC data**

## Connections

- TIC ID user → Pipeline runner: provides TIC IDs (evidence: `README.md`)
- Pipeline runner → Configuration: loads settings (evidence: `run_pipeline.py`)
- Pipeline runner → Demo data: generates demo data (evidence: `run_pipeline.py`)
- Pipeline runner → Light-curve prep: runs stage 1 (evidence: `README.md`)
- MAST / TESS → Light-curve prep: supplies light curves (evidence: `README.md`)
- Light-curve prep → Processed curves: saves curves (evidence: `tess_pipeline/stage1_preprocess.py`)
- Pipeline runner → Transit search: runs stage 2 (evidence: `README.md`)
- Transit search → Light-curve prep: loads processed curves (evidence: `tess_pipeline/stage2_detect.py`)
- Transit search → Harmonic checks: checks aliases (evidence: `tess_pipeline/stage2_detect.py`)
- Pipeline runner → Stellar lookup: runs stage 3 (evidence: `README.md`)
- Gaia / TIC data → Stellar lookup: provides star data (evidence: `README.md`)
- Pipeline runner → Physics checks: runs stage 4 (evidence: `README.md`)
- Physics checks → Light-curve prep: loads curves (evidence: `tess_pipeline/stage4_physics.py`)
- Pipeline runner → ML classifier: runs stage 5 (evidence: `README.md`)
- Pipeline runner → Parameter fitting: runs stage 6 (evidence: `README.md`)
- Parameter fitting → Light-curve prep: loads curves (evidence: `tess_pipeline/stage6_params.py`)
- Pipeline runner → Result ensemble: runs stage 7 (evidence: `README.md`)
- Patched scoring rules → ML classifier: patches classification (evidence: `patches/patch_scientific_validity.py`)
- Patched scoring rules → Result ensemble: combines physics and ML (evidence: `patches/patch_scientific_validity.py`)
- Supervised training → Result ensemble: computes combined score (evidence: `patches/patch_supervised_classifier.py`)
- Pipeline runner → CSV results: writes results (evidence: `README.md`)
- Pipeline runner → Visual reports: optionally runs stage 8 (evidence: `run_pipeline.py`)
- Visual reports → Processed curves: loads curves (evidence: `tess_pipeline/stage8_visualize.py`)
