# astrokhattab/radio_pne_pipeline_lmc architecture

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

- Interactive diagram: https://gitdiagram.com/astrokhattab/radio_pne_pipeline_lmc
- Repository: https://github.com/astrokhattab/radio_pne_pipeline_lmc

## Overview

This repository is a reproducible astronomy analysis pipeline: it builds an LMC planetary-nebula sample, matches it to radio surveys, evaluates detections and candidate confidence, and fits radio luminosity functions. Users run individual numbered steps or dispatch them with run_all.py; the steps exchange derived columns through a shared FITS catalogue. The README documents all major stages and outputs. Some step implementations and config wiring were not sampled, so those documented capabilities are shown without asserting unsampled internal calls.

Main entry points: [`02_scripts/run_all.py`](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/run_all.py) (Step dispatcher), [`02_scripts/step1_crossmatch.py`](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step1_crossmatch.py) (Radio crossmatch), [`02_scripts/step0_data.py`](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step0_data.py) (Parent sample), [`02_scripts/step4_spectral_index.py`](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step4_spectral_index.py) (Spectral analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Pipeline entry"]
  node_runner["Step dispatcher<br/>[run_all.py]"]
end

subgraph group_sample_match["Sample and matching"]
  node_parent_sample["Parent sample<br/>[step0_data.py]"]
  node_crossmatch["Radio crossmatch"]
  node_manual_fluxes["Manual fluxes<br/>[manual_fluxes.csv]"]
end

subgraph group_candidate_analysis["Candidate analysis"]
  node_flux_gate["Flux gate<br/>[step3_flux_gate.py]"]
  node_spectral_index["Spectral analysis"]
  node_cohen_ratio["MIR radio ratio"]
  node_scoring["Candidate grading<br/>[step6_score.py]"]
end

subgraph group_luminosity_analysis["Luminosity function"]
  node_pnlf["Radio PNLF fitting<br/>[step7_pnlf.py]"]
end

subgraph group_shared_runtime["Shared runtime and outputs"]
  node_config["Pipeline config<br/>[config.yaml]"]
  node_helpers["Shared helpers<br/>[common.py]"]
  node_catalogue[("Derived catalogue<br/>[catalogue.fits]")]
  node_reports["Figures and tables"]
  node_notes["Reported numbers<br/>[numbers.txt]"]
end

node_user(("Researcher"))
node_survey_catalogues["Survey catalogues"]
node_survey_images["Survey images"]

node_user -->|"runs steps"| node_runner
node_runner -->|"dispatches"| node_parent_sample
node_runner -->|"dispatches"| node_crossmatch
node_runner -->|"dispatches"| node_flux_gate
node_runner -->|"dispatches"| node_spectral_index
node_runner -->|"dispatches"| node_cohen_ratio
node_runner -->|"dispatches"| node_scoring
node_runner -->|"dispatches"| node_pnlf
node_parent_sample -->|"reads inputs"| node_survey_catalogues
node_parent_sample -->|"uses helpers"| node_helpers
node_parent_sample -->|"creates sample"| node_catalogue
node_crossmatch -->|"matches sources"| node_survey_catalogues
node_crossmatch -->|"checks footprints"| node_survey_images
node_crossmatch -->|"adds measurements"| node_manual_fluxes
node_crossmatch -->|"adds matches"| node_catalogue
node_flux_gate -->|"reads and updates"| node_catalogue
node_spectral_index -->|"reads and updates"| node_catalogue
node_spectral_index -->|"compares field"| node_survey_catalogues
node_cohen_ratio -->|"reads and updates"| node_catalogue
node_scoring -->|"reads and updates"| node_catalogue
node_pnlf -->|"fits luminosities"| node_catalogue
node_parent_sample -->|"uses settings"| node_config
node_crossmatch -->|"uses settings"| node_config
node_flux_gate -->|"uses thresholds"| node_config
node_spectral_index -->|"uses thresholds"| node_config
node_cohen_ratio -->|"uses threshold"| node_config
node_scoring -->|"uses levels"| node_config
node_pnlf -->|"uses parameters"| node_config
node_parent_sample -->|"writes table"| node_reports
node_crossmatch -->|"writes outputs"| node_reports
node_flux_gate -->|"writes figure"| node_reports
node_spectral_index -->|"writes figure"| node_reports
node_cohen_ratio -->|"writes figure"| node_reports
node_scoring -->|"writes tables"| node_reports
node_pnlf -->|"writes fits"| node_reports
node_parent_sample -->|"records numbers"| node_notes
node_crossmatch -->|"records numbers"| node_notes
node_flux_gate -->|"records numbers"| node_notes
node_spectral_index -->|"records numbers"| node_notes
node_cohen_ratio -->|"records numbers"| node_notes
node_scoring -->|"records numbers"| node_notes
node_pnlf -->|"records numbers"| node_notes

click node_runner "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/run_all.py"
click node_config "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/config.yaml"
click node_parent_sample "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step0_data.py"
click node_crossmatch "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step1_crossmatch.py"
click node_manual_fluxes "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/01_data/manual_fluxes.csv"
click node_flux_gate "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step3_flux_gate.py"
click node_spectral_index "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step4_spectral_index.py"
click node_cohen_ratio "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step5_cohen_ratio.py"
click node_scoring "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step6_score.py"
click node_pnlf "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step7_pnlf.py"
click node_helpers "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/common.py"
click node_catalogue "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/04_catalogues/catalogue.fits"
click node_reports "https://github.com/astrokhattab/radio_pne_pipeline_lmc/tree/main/03_figures"
click node_notes "https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/07_notes/numbers.txt"

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 toneBlue
class node_parent_sample,node_crossmatch,node_manual_fluxes toneAmber
class node_flux_gate,node_spectral_index,node_cohen_ratio,node_scoring toneMint
class node_pnlf toneRose
class node_config,node_helpers,node_catalogue,node_reports,node_notes,node_user,node_survey_catalogues,node_survey_images toneIndigo
```

## Components

### Pipeline entry

- [Step dispatcher](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/run_all.py): `02_scripts/run_all.py`

### Sample and matching

- [Parent sample](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step0_data.py): `02_scripts/step0_data.py`
- [Radio crossmatch](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step1_crossmatch.py): `02_scripts/step1_crossmatch.py`
- [Manual fluxes](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/01_data/manual_fluxes.csv): `01_data/manual_fluxes.csv`

### Candidate analysis

- [Flux gate](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step3_flux_gate.py): `02_scripts/step3_flux_gate.py`
- [Spectral analysis](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step4_spectral_index.py): `02_scripts/step4_spectral_index.py`
- [MIR radio ratio](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step5_cohen_ratio.py): `02_scripts/step5_cohen_ratio.py`
- [Candidate grading](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step6_score.py): `02_scripts/step6_score.py`

### Luminosity function

- [Radio PNLF fitting](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/step7_pnlf.py): `02_scripts/step7_pnlf.py`

### Shared runtime and outputs

- [Pipeline config](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/config.yaml): `02_scripts/config.yaml`
- [Shared helpers](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/02_scripts/common.py): `02_scripts/common.py`
- [Derived catalogue](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/04_catalogues/catalogue.fits): `04_catalogues/catalogue.fits`
- [Figures and tables](https://github.com/astrokhattab/radio_pne_pipeline_lmc/tree/main/03_figures): `03_figures`
- [Reported numbers](https://github.com/astrokhattab/radio_pne_pipeline_lmc/blob/main/07_notes/numbers.txt): `07_notes/numbers.txt`

### Other components

- **Researcher**
- **Survey catalogues**
- **Survey images**

## Connections

- Researcher → Step dispatcher: runs steps (evidence: `README.md`)
- Step dispatcher → Parent sample: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → Radio crossmatch: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → Flux gate: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → Spectral analysis: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → MIR radio ratio: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → Candidate grading: dispatches (evidence: `02_scripts/run_all.py`)
- Step dispatcher → Radio PNLF fitting: dispatches (evidence: `02_scripts/run_all.py`)
- Parent sample → Survey catalogues: reads inputs (evidence: `README.md`)
- Parent sample → Shared helpers: uses helpers (evidence: `02_scripts/step0_data.py`)
- Parent sample → Derived catalogue: creates sample (evidence: `02_scripts/step0_data.py`)
- Radio crossmatch → Survey catalogues: matches sources (evidence: `README.md`)
- Radio crossmatch → Survey images: checks footprints (evidence: `02_scripts/step1_crossmatch.py`)
- Radio crossmatch → Manual fluxes: adds measurements (evidence: `02_scripts/step1_crossmatch.py`)
- Radio crossmatch → Derived catalogue: adds matches (evidence: `02_scripts/step1_crossmatch.py`)
- Flux gate → Derived catalogue: reads and updates (evidence: `02_scripts/step3_flux_gate.py`)
- Spectral analysis → Derived catalogue: reads and updates (evidence: `02_scripts/step4_spectral_index.py`)
- Spectral analysis → Survey catalogues: compares field (evidence: `02_scripts/step4_spectral_index.py`)
- MIR radio ratio → Derived catalogue: reads and updates (evidence: `02_scripts/step5_cohen_ratio.py`)
- Candidate grading → Derived catalogue: reads and updates (evidence: `02_scripts/step6_score.py`)
- Radio PNLF fitting → Derived catalogue: fits luminosities (evidence: `README.md`)
- Parent sample → Pipeline config: uses settings (evidence: `README.md`)
- Radio crossmatch → Pipeline config: uses settings (evidence: `README.md`)
- Flux gate → Pipeline config: uses thresholds (evidence: `README.md`)
- Spectral analysis → Pipeline config: uses thresholds (evidence: `README.md`)
- MIR radio ratio → Pipeline config: uses threshold (evidence: `README.md`)
- Candidate grading → Pipeline config: uses levels (evidence: `README.md`)
- Radio PNLF fitting → Pipeline config: uses parameters (evidence: `README.md`)
- Parent sample → Figures and tables: writes table (evidence: `02_scripts/step0_data.py`)
- Radio crossmatch → Figures and tables: writes outputs (evidence: `02_scripts/step1_crossmatch.py`)
- Flux gate → Figures and tables: writes figure (evidence: `02_scripts/step3_flux_gate.py`)
- Spectral analysis → Figures and tables: writes figure (evidence: `02_scripts/step4_spectral_index.py`)
- MIR radio ratio → Figures and tables: writes figure (evidence: `02_scripts/step5_cohen_ratio.py`)
- Candidate grading → Figures and tables: writes tables (evidence: `02_scripts/step6_score.py`)
- Radio PNLF fitting → Figures and tables: writes fits (evidence: `README.md`)
- Parent sample → Reported numbers: records numbers (evidence: `02_scripts/step0_data.py`)
- Radio crossmatch → Reported numbers: records numbers (evidence: `02_scripts/step1_crossmatch.py`)
- Flux gate → Reported numbers: records numbers (evidence: `02_scripts/step3_flux_gate.py`)
- Spectral analysis → Reported numbers: records numbers (evidence: `02_scripts/step4_spectral_index.py`)
- MIR radio ratio → Reported numbers: records numbers (evidence: `02_scripts/step5_cohen_ratio.py`)
- Candidate grading → Reported numbers: records numbers (evidence: `02_scripts/step6_score.py`)
- Radio PNLF fitting → Reported numbers: records numbers (evidence: `README.md`)
