# arielmission-space/exosim2-public architecture

> Architecture diagram of the GitHub repository arielmission-space/exosim2-public, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/arielmission-space/exosim2-public
- Repository: https://github.com/arielmission-space/exosim2-public

## Overview

ExoSim 2 simulates spectro-photometric observations of transiting exoplanets. Users invoke CLI commands to run recipes; the radiometric recipe prepares sources and channel focal planes, computes signal/noise tables, and stores results for plotting. Separate recipes produce focal planes, sub-exposures, and NDRs. The graph includes shared signal/task infrastructure and HDF5 output. Some recipe stages are represented from the repository tree and README rather than sampled implementations; their links are dashed where control flow is unverified.

Main entry points: [`src/exosim/recipes/radiometric_model.py`](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/radiometric_model.py) (Radiometric model), [`src/exosim/exosim.py`](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/exosim.py) (CLI), [`src/exosim/tasks/radiometric`](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/radiometric) (Radiometric tasks), [`src/exosim/models/signal.py`](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/models/signal.py) (Signal model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Entry and orchestration"]
  node_cli["CLI<br/>[exosim.py]"]
  node_radiometric["Radiometric model"]
  node_focalrecipe["Focal-plane recipe"]
  node_subrecipe["Sub-exposure recipe"]
  node_ndrrecipe["NDR recipe<br/>[create_ndrs.py]"]
  node_observation["Observation recipe"]
end

subgraph group_science["Observation science"]
  node_sources["Source and SED tasks"]
  node_astro["Astronomical signals"]
  node_foreground["Foreground estimation"]
  node_instrument["Instrument propagation"]
  node_radiotasks["Radiometric tasks"]
end

subgraph group_detector["Detector products"]
  node_subtasks["Readout preparation"]
  node_detectortasks["Detector effects"]
end

subgraph group_storage["Data and visualization"]
  node_output["Output interface<br/>[output.py]"]
  node_hdf5[("HDF5 output<br/>[hdf5.py]")]
  node_plotter["Radiometric plots"]
  node_plots["Other plotters"]
end

subgraph group_core["Shared runtime"]
  node_channel["Channel model<br/>[channel.py]"]
  node_signal["Signal model<br/>[signal.py]"]
  node_task["Task framework<br/>[task.py]"]
  node_config["Run configuration<br/>[run_config.py]"]
  node_logger["Structured logging"]
  node_checks["Unit checks<br/>[checks.py]"]
  node_binning["Spectral binning<br/>[binning.py]"]
  node_factory["Task selection<br/>[klass_factory.py]"]
end

node_user(("User"))

node_user -->|"invokes"| node_cli
node_cli -->|"runs"| node_radiometric
node_cli -->|"runs"| node_focalrecipe
node_cli -->|"runs"| node_subrecipe
node_cli -->|"runs"| node_ndrrecipe
node_cli -->|"plots results"| node_plotter
node_cli -->|"plots products"| node_plots
node_radiometric -->|"loads sources"| node_sources
node_radiometric -->|"uses focal-plane recipe"| node_focalrecipe
node_radiometric -->|"uses channels"| node_channel
node_radiometric -->|"computes signals"| node_radiotasks
node_radiometric -->|"writes tables"| node_output
node_radiometric -->|"uses configuration"| node_config
node_focalrecipe -.->|"propagates optics"| node_instrument
node_instrument -.->|"adds foregrounds"| node_foreground
node_astro -.->|"supplies signals"| node_instrument
node_subrecipe -.->|"prepares readouts"| node_subtasks
node_subtasks -.->|"applies detector effects"| node_detectortasks
node_ndrrecipe -.->|"produces NDRs"| node_detectortasks
node_observation -.->|"simulates observation"| node_radiometric
node_task -.->|"inherits timing and logging"| node_logger
node_radiotasks -->|"uses task framework"| node_task
node_radiotasks -->|"processes signals"| node_signal
node_signal -->|"caches data"| node_output
node_output -->|"implemented by"| node_hdf5
node_plotter -->|"reads stored tables"| node_hdf5
node_radiotasks -->|"selects custom tasks"| node_factory
node_astro -->|"bins spectra"| node_binning
node_signal -->|"uses binning"| node_binning
node_signal -->|"checks units"| node_checks

click node_cli "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/exosim.py"
click node_radiometric "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/radiometric_model.py"
click node_focalrecipe "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_focal_plane.py"
click node_subrecipe "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_sub_exposures.py"
click node_ndrrecipe "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_ndrs.py"
click node_observation "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/simulate_observation.py"
click node_sources "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/sed"
click node_astro "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/astrosignal"
click node_foreground "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/foregrounds"
click node_instrument "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/instrument"
click node_radiotasks "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/radiometric"
click node_subtasks "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/subexposures"
click node_detectortasks "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/detector"
click node_channel "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/models/channel.py"
click node_signal "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/models/signal.py"
click node_task "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/tasks/task.py"
click node_config "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/run_config.py"
click node_output "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/output/output.py"
click node_hdf5 "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/output/hdf5/hdf5.py"
click node_plotter "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/plots/radiometric_plotter.py"
click node_plots "https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/plots"
click node_logger "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/log/structlog_config.py"
click node_checks "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/checks.py"
click node_binning "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/binning.py"
click node_factory "https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/klass_factory.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_cli,node_radiometric,node_focalrecipe,node_subrecipe,node_ndrrecipe,node_observation,node_user toneBlue
class node_sources,node_astro,node_foreground,node_instrument,node_radiotasks toneAmber
class node_subtasks,node_detectortasks toneMint
class node_output,node_hdf5,node_plotter,node_plots toneRose
class node_channel,node_signal,node_task,node_config,node_logger,node_checks,node_binning,node_factory toneIndigo
```

## Components

### Entry and orchestration

- [CLI](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/exosim.py): `src/exosim/exosim.py`
- [Radiometric model](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/radiometric_model.py): `src/exosim/recipes/radiometric_model.py`
- [Focal-plane recipe](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_focal_plane.py): `src/exosim/recipes/create_focal_plane.py`
- [Sub-exposure recipe](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_sub_exposures.py): `src/exosim/recipes/create_sub_exposures.py`
- [NDR recipe](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/create_ndrs.py): `src/exosim/recipes/create_ndrs.py`
- [Observation recipe](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/recipes/simulate_observation.py): `src/exosim/recipes/simulate_observation.py`

### Observation science

- [Source and SED tasks](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/sed): `src/exosim/tasks/sed`
- [Astronomical signals](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/astrosignal): `src/exosim/tasks/astrosignal`
- [Foreground estimation](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/foregrounds): `src/exosim/tasks/foregrounds`
- [Instrument propagation](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/instrument): `src/exosim/tasks/instrument`
- [Radiometric tasks](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/radiometric): `src/exosim/tasks/radiometric`

### Detector products

- [Readout preparation](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/subexposures): `src/exosim/tasks/subexposures`
- [Detector effects](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/tasks/detector): `src/exosim/tasks/detector`

### Data and visualization

- [Output interface](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/output/output.py): `src/exosim/output/output.py`
- [HDF5 output](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/output/hdf5/hdf5.py): `src/exosim/output/hdf5/hdf5.py`
- [Radiometric plots](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/plots/radiometric_plotter.py): `src/exosim/plots/radiometric_plotter.py`
- [Other plotters](https://github.com/arielmission-space/exosim2-public/tree/main/src/exosim/plots): `src/exosim/plots`

### Shared runtime

- [Channel model](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/models/channel.py): `src/exosim/models/channel.py`
- [Signal model](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/models/signal.py): `src/exosim/models/signal.py`
- [Task framework](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/tasks/task.py): `src/exosim/tasks/task.py`
- [Run configuration](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/run_config.py): `src/exosim/utils/run_config.py`
- [Structured logging](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/log/structlog_config.py): `src/exosim/log/structlog_config.py`
- [Unit checks](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/checks.py): `src/exosim/utils/checks.py`
- [Spectral binning](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/binning.py): `src/exosim/utils/binning.py`
- [Task selection](https://github.com/arielmission-space/exosim2-public/blob/main/src/exosim/utils/klass_factory.py): `src/exosim/utils/klass_factory.py`

### Other components

- **User**

## Connections

- User → CLI: invokes (evidence: `src/exosim/exosim.py`)
- CLI → Radiometric model: runs (evidence: `src/exosim/exosim.py`)
- CLI → Focal-plane recipe: runs (evidence: `src/exosim/exosim.py`)
- CLI → Sub-exposure recipe: runs (evidence: `src/exosim/exosim.py`)
- CLI → NDR recipe: runs (evidence: `src/exosim/exosim.py`)
- CLI → Radiometric plots: plots results (evidence: `src/exosim/exosim.py`)
- CLI → Other plotters: plots products (evidence: `src/exosim/exosim.py`)
- Radiometric model → Source and SED tasks: loads sources (evidence: `src/exosim/recipes/radiometric_model.py`)
- Radiometric model → Focal-plane recipe: uses focal-plane recipe (evidence: `src/exosim/recipes/radiometric_model.py`)
- Radiometric model → Channel model: uses channels (evidence: `src/exosim/recipes/radiometric_model.py`)
- Radiometric model → Radiometric tasks: computes signals (evidence: `src/exosim/recipes/radiometric_model.py`)
- Radiometric model → Output interface: writes tables (evidence: `src/exosim/recipes/radiometric_model.py`)
- Radiometric model → Run configuration: uses configuration (evidence: `src/exosim/recipes/radiometric_model.py`)
- Focal-plane recipe → Instrument propagation: propagates optics
- Instrument propagation → Foreground estimation: adds foregrounds
- Astronomical signals → Instrument propagation: supplies signals
- Sub-exposure recipe → Readout preparation: prepares readouts
- Readout preparation → Detector effects: applies detector effects
- NDR recipe → Detector effects: produces NDRs
- Observation recipe → Radiometric model: simulates observation
- Task framework → Structured logging: inherits timing and logging
- Radiometric tasks → Task framework: uses task framework (evidence: `src/exosim/tasks/radiometric/compute_custom_noise.py`)
- Radiometric tasks → Signal model: processes signals (evidence: `src/exosim/tasks/radiometric/compute_custom_noise.py`)
- Signal model → Output interface: caches data (evidence: `src/exosim/models/signal.py`)
- Output interface → HDF5 output: implemented by (evidence: `src/exosim/output/hdf5/hdf5.py`)
- Radiometric plots → HDF5 output: reads stored tables (evidence: `src/exosim/plots/radiometric_plotter.py`)
- Radiometric tasks → Task selection: selects custom tasks (evidence: `src/exosim/tasks/radiometric/compute_custom_noise.py`)
- Astronomical signals → Spectral binning: bins spectra (evidence: `src/exosim/tasks/astrosignal/estimate_planetary_signal.py`)
- Signal model → Spectral binning: uses binning (evidence: `src/exosim/models/signal.py`)
- Signal model → Unit checks: checks units (evidence: `src/exosim/models/signal.py`)
