# ahmed-f-alrefaie/taurex3_public architecture

> Architecture diagram of the GitHub repository ahmed-f-alrefaie/taurex3_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/ahmed-f-alrefaie/taurex3_public
- Repository: https://github.com/ahmed-f-alrefaie/taurex3_public

## Overview

TauREx 3 is an exoplanet atmospheric retrieval code. Its main workflow reads a configuration, constructs atmospheric and observation objects, computes a forward spectrum, optionally fits model parameters to observations, and writes results. The map includes documented-through-source subsystems for opacity, light-curve modeling, binning, and output. Some links reflect explicit imports or calls in the excerpts and SOURCE INDEX; unsampled implementation details and dynamic wiring are not inferred.

Main entry points: [`taurex/model/simplemodel.py`](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/simplemodel.py) (Forward model), [`taurex/taurex.py`](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/taurex.py) (TauREx CLI), [`taurex/parameter/parameterparser.py`](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/parameter/parameterparser.py) (Config parser), [`taurex/model/lightcurve/lightcurve.py`](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/lightcurve/lightcurve.py) (Light-curve model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_setup["Configuration and execution"]
  node_cli["TauREx CLI<br/>[taurex.py]"]
  node_parser["Config parser<br/>[parameterparser.py]"]
  node_factory["Object factory<br/>[factory.py]"]
end

subgraph group_physics["Atmosphere and spectra"]
  node_forward["Forward model<br/>[simplemodel.py]"]
  node_profiles["Atmosphere profiles"]
  node_planet["Planet properties<br/>[planet.py]"]
  node_star["Stellar spectrum<br/>[star.py]"]
  node_opacity[("Opacity data<br/>[opacitycache.py]")]
  node_cia[("CIA data")]
  node_contributions["Radiative contributions"]
  node_lightcurve["Light-curve model<br/>[lightcurve.py]"]
end

subgraph group_retrieval["Fitting and analysis"]
  node_optimizer["Retrieval optimizer<br/>[optimizer.py]"]
  node_samplers["Sampling backends"]
  node_plotting["Plots and diagnostics<br/>[plotter.py]"]
  node_mpi["MPI support<br/>[mpi.py]"]
end

subgraph group_io["Data and output"]
  node_observation["Observed spectra"]
  node_binning["Spectral binning<br/>[binner.py]"]
  node_instrument["Instrument models"]
  node_hdf5["HDF5 output<br/>[hdf5.py]"]
  node_outpututil["Profile output<br/>[output.py]"]
end

node_user(("Researcher"))

node_user -->|"runs"| node_cli
node_cli -->|"reads config"| node_parser
node_parser -->|"constructs objects"| node_factory
node_factory -->|"creates models"| node_forward
node_factory -->|"creates samplers"| node_samplers
node_parser -->|"loads observations"| node_observation
node_parser -->|"creates binners"| node_binning
node_parser -->|"creates instruments"| node_instrument
node_parser -->|"loads model"| node_lightcurve
node_forward -->|"uses profiles"| node_profiles
node_forward -->|"uses properties"| node_planet
node_forward -->|"initializes star"| node_star
node_forward -->|"loads opacity"| node_opacity
node_forward -.->|"prepares contributions"| node_contributions
node_forward -.->|"uses CIA data"| node_cia
node_lightcurve -->|"wraps model"| node_forward
node_lightcurve -->|"uses spectrum types"| node_observation
node_lightcurve -->|"uses binner"| node_binning
node_cli -->|"fits parameters"| node_optimizer
node_optimizer -->|"parallelizes sampling"| node_mpi
node_optimizer -.->|"uses backend"| node_samplers
node_cli -->|"writes results"| node_hdf5
node_cli -->|"generates profiles"| node_outpututil
node_cli -.->|"plots results"| node_plotting
node_optimizer -.->|"compares data"| node_observation

click node_cli "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/taurex.py"
click node_parser "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/parameter/parameterparser.py"
click node_factory "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/parameter/factory.py"
click node_forward "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/simplemodel.py"
click node_profiles "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/data/profiles"
click node_planet "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/data/planet.py"
click node_star "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/data/stellar/star.py"
click node_opacity "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/cache/opacitycache.py"
click node_cia "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/cia"
click node_contributions "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/contributions"
click node_lightcurve "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/lightcurve/lightcurve.py"
click node_observation "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/data/spectrum"
click node_binning "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/binning/binner.py"
click node_instrument "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/instruments"
click node_optimizer "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/optimizer/optimizer.py"
click node_samplers "https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/optimizer"
click node_plotting "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/plot/plotter.py"
click node_hdf5 "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/output/hdf5.py"
click node_outpututil "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/util/output.py"
click node_mpi "https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/mpi.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_parser,node_factory toneBlue
class node_forward,node_profiles,node_planet,node_star,node_opacity,node_cia,node_contributions,node_lightcurve toneAmber
class node_optimizer,node_samplers,node_plotting,node_mpi toneMint
class node_observation,node_binning,node_instrument,node_hdf5,node_outpututil toneRose
class node_user toneIndigo
```

## Components

### Configuration and execution

- [TauREx CLI](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/taurex.py): `taurex/taurex.py`
- [Config parser](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/parameter/parameterparser.py): `taurex/parameter/parameterparser.py`
- [Object factory](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/parameter/factory.py): `taurex/parameter/factory.py`

### Atmosphere and spectra

- [Forward model](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/simplemodel.py): `taurex/model/simplemodel.py`
- [Atmosphere profiles](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/data/profiles): `taurex/data/profiles`
- [Planet properties](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/data/planet.py): `taurex/data/planet.py`
- [Stellar spectrum](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/data/stellar/star.py): `taurex/data/stellar/star.py`
- [Opacity data](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/cache/opacitycache.py): `taurex/cache/opacitycache.py`
- [CIA data](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/cia): `taurex/cia`
- [Radiative contributions](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/contributions): `taurex/contributions`
- [Light-curve model](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/model/lightcurve/lightcurve.py): `taurex/model/lightcurve/lightcurve.py`

### Fitting and analysis

- [Retrieval optimizer](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/optimizer/optimizer.py): `taurex/optimizer/optimizer.py`
- [Sampling backends](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/optimizer): `taurex/optimizer`
- [Plots and diagnostics](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/plot/plotter.py): `taurex/plot/plotter.py`
- [MPI support](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/mpi.py): `taurex/mpi.py`

### Data and output

- [Observed spectra](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/data/spectrum): `taurex/data/spectrum`
- [Spectral binning](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/binning/binner.py): `taurex/binning/binner.py`
- [Instrument models](https://github.com/ahmed-f-alrefaie/taurex3_public/tree/develop/taurex/instruments): `taurex/instruments`
- [HDF5 output](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/output/hdf5.py): `taurex/output/hdf5.py`
- [Profile output](https://github.com/ahmed-f-alrefaie/taurex3_public/blob/develop/taurex/util/output.py): `taurex/util/output.py`

### Other components

- **Researcher**

## Connections

- Researcher → TauREx CLI: runs
- TauREx CLI → Config parser: reads config (evidence: `taurex/taurex.py`)
- Config parser → Object factory: constructs objects (evidence: `taurex/parameter/parameterparser.py`)
- Object factory → Forward model: creates models (evidence: `taurex/parameter/factory.py`)
- Object factory → Sampling backends: creates samplers (evidence: `taurex/parameter/factory.py`)
- Config parser → Observed spectra: loads observations (evidence: `taurex/parameter/parameterparser.py`)
- Config parser → Spectral binning: creates binners (evidence: `taurex/parameter/parameterparser.py`)
- Config parser → Instrument models: creates instruments (evidence: `taurex/parameter/parameterparser.py`)
- Config parser → Light-curve model: loads model (evidence: `taurex/parameter/parameterparser.py`)
- Forward model → Atmosphere profiles: uses profiles (evidence: `taurex/model/simplemodel.py`)
- Forward model → Planet properties: uses properties (evidence: `taurex/model/simplemodel.py`)
- Forward model → Stellar spectrum: initializes star (evidence: `taurex/model/simplemodel.py`)
- Forward model → Opacity data: loads opacity (evidence: `taurex/model/simplemodel.py`)
- Forward model → Radiative contributions: prepares contributions
- Forward model → CIA data: uses CIA data
- Light-curve model → Forward model: wraps model (evidence: `taurex/model/lightcurve/lightcurve.py`)
- Light-curve model → Observed spectra: uses spectrum types (evidence: `taurex/model/lightcurve/lightcurve.py`)
- Light-curve model → Spectral binning: uses binner (evidence: `taurex/model/lightcurve/lightcurve.py`)
- TauREx CLI → Retrieval optimizer: fits parameters (evidence: `taurex/taurex.py`)
- Retrieval optimizer → MPI support: parallelizes sampling (evidence: `taurex/optimizer/optimizer.py`)
- Retrieval optimizer → Sampling backends: uses backend (evidence: `taurex/optimizer/multinest.py`)
- TauREx CLI → HDF5 output: writes results (evidence: `taurex/taurex.py`)
- TauREx CLI → Profile output: generates profiles (evidence: `taurex/taurex.py`)
- TauREx CLI → Plots and diagnostics: plots results
- Retrieval optimizer → Observed spectra: compares data
