# dnarayanan/caesar architecture

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

- Interactive diagram: https://gitdiagram.com/dnarayanan/caesar
- Repository: https://github.com/dnarayanan/caesar

## Overview

CAESAR analyzes cosmological-simulation snapshots: users load data through yt, identify halos and galaxies (and clouds when applicable), compute object properties, and save a portable catalog. The main orchestration path is visible in `caesar/main.py`; it selects a group-finding route, then assigns and links group types. The README also documents loading, units, and broad simulation-format support. Photometry, visualization, progenitor analysis, and zoom-region utilities are distinct product capabilities; their exact runtime wiring is only partly evidenced in the supplied excerpts.

Main entry points: [`caesar/main.py`](https://github.com/dnarayanan/caesar/blob/master/caesar/main.py) (CAESAR orchestrator), [`caesar/fubar_halo.py`](https://github.com/dnarayanan/caesar/blob/master/caesar/fubar_halo.py) (Halo finding), [`caesar/__init__.py`](https://github.com/dnarayanan/caesar/blob/master/caesar/__init__.py) (Public API), [`caesar/fubar.py`](https://github.com/dnarayanan/caesar/blob/master/caesar/fubar.py) (Group finding)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Snapshot analysis"]
  node_engine["CAESAR orchestrator<br/>[main.py]"]
  node_dataset["Dataset properties"]
  node_simulation["Simulation metadata"]
  node_particles["Particle data<br/>[data_manager.py]"]
  node_halo_find["Halo finding<br/>[fubar_halo.py]"]
  node_group_find["Group finding<br/>[fubar.py]"]
  node_fof["6D FOF<br/>[fof6d.py]"]
end

subgraph group_catalog["Catalog and groups"]
  node_assignment["Group assignment<br/>[assignment.py]"]
  node_linking["Group linking<br/>[linking.py]"]
  node_objects["Halo galaxy cloud objects<br/>[group.py]"]
  node_properties["Object properties<br/>[group.py]"]
  node_save["Catalog writer<br/>[saver.py]"]
  node_load["Lazy catalog reader<br/>[loader.py]"]
  node_old_load["Legacy catalog reader<br/>[old_loader.py]"]
end

subgraph group_science["Analysis extensions"]
  node_progen["Progenitor analysis<br/>[progen.py]"]
  node_photometry["Synthetic photometry<br/>[pyloser.py]"]
  node_attenuation["Dust attenuation laws<br/>[atten_laws.py]"]
  node_visualization["VTK visualization<br/>[vtk_vis.py]"]
  node_vtk_tools["VTK data functions<br/>[vtk_funcs.py]"]
  node_zoom["Zoom-region tools<br/>[zoom_funcs.py]"]
end

subgraph group_interfaces["User interfaces"]
  node_api["Public API<br/>[__init__.py]"]
  node_cli["Command line<br/>[command_line.py]"]
  node_driver["Analysis driver<br/>[driver.py]"]
end

node_scientist(("Analyst"))
node_yt["yt dataset"]

node_scientist -->|"uses"| node_api
node_api -->|"exports"| node_engine
node_api -->|"exports"| node_driver
node_scientist -.->|"invokes"| node_cli
node_cli -->|"dispatches"| node_engine
node_driver -.->|"runs"| node_engine
node_scientist -->|"provides snapshot"| node_yt
node_engine -->|"accepts dataset"| node_yt
node_engine -->|"uses"| node_dataset
node_engine -->|"creates attributes"| node_simulation
node_engine -.->|"loads particles"| node_particles
node_particles -->|"reads fields"| node_dataset
node_engine -->|"runs"| node_halo_find
node_engine -->|"runs"| node_group_find
node_halo_find -->|"runs"| node_fof
node_group_find -->|"runs"| node_fof
node_halo_find -->|"gets separation"| node_group_find
node_halo_find -->|"computes"| node_properties
node_engine -->|"assigns groups"| node_assignment
node_engine -->|"links groups"| node_linking
node_engine -.->|"creates groups"| node_objects
node_scientist -.->|"saves catalog"| node_save
node_scientist -.->|"loads catalog"| node_load
node_scientist -.->|"loads legacy catalog"| node_old_load
node_scientist -.->|"analyzes histories"| node_progen
node_scientist -.->|"computes photometry"| node_photometry
node_photometry -->|"uses laws"| node_attenuation
node_scientist -.->|"explores groups"| node_visualization
node_scientist -.->|"uses visualization tools"| node_vtk_tools
node_scientist -.->|"selects zoom regions"| node_zoom

click node_api "https://github.com/dnarayanan/caesar/blob/master/caesar/__init__.py"
click node_cli "https://github.com/dnarayanan/caesar/blob/master/caesar/command_line.py"
click node_driver "https://github.com/dnarayanan/caesar/blob/master/caesar/driver.py"
click node_engine "https://github.com/dnarayanan/caesar/blob/master/caesar/main.py"
click node_dataset "https://github.com/dnarayanan/caesar/blob/master/caesar/property_manager.py"
click node_simulation "https://github.com/dnarayanan/caesar/blob/master/caesar/simulation_attributes.py"
click node_particles "https://github.com/dnarayanan/caesar/blob/master/caesar/data_manager.py"
click node_halo_find "https://github.com/dnarayanan/caesar/blob/master/caesar/fubar_halo.py"
click node_group_find "https://github.com/dnarayanan/caesar/blob/master/caesar/fubar.py"
click node_fof "https://github.com/dnarayanan/caesar/blob/master/caesar/fof6d.py"
click node_assignment "https://github.com/dnarayanan/caesar/blob/master/caesar/assignment.py"
click node_linking "https://github.com/dnarayanan/caesar/blob/master/caesar/linking.py"
click node_objects "https://github.com/dnarayanan/caesar/blob/master/caesar/group.py"
click node_properties "https://github.com/dnarayanan/caesar/blob/master/caesar/group.py"
click node_save "https://github.com/dnarayanan/caesar/blob/master/caesar/saver.py"
click node_load "https://github.com/dnarayanan/caesar/blob/master/caesar/loader.py"
click node_old_load "https://github.com/dnarayanan/caesar/blob/master/caesar/old_loader.py"
click node_progen "https://github.com/dnarayanan/caesar/blob/master/caesar/progen.py"
click node_photometry "https://github.com/dnarayanan/caesar/blob/master/caesar/pyloser/pyloser.py"
click node_attenuation "https://github.com/dnarayanan/caesar/blob/master/caesar/pyloser/atten_laws.py"
click node_visualization "https://github.com/dnarayanan/caesar/blob/master/caesar/vtk_vis.py"
click node_vtk_tools "https://github.com/dnarayanan/caesar/blob/master/caesar/vtk_funcs.py"
click node_zoom "https://github.com/dnarayanan/caesar/blob/master/caesar/zoom_funcs.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_engine,node_dataset,node_simulation,node_particles,node_halo_find,node_group_find,node_fof toneBlue
class node_assignment,node_linking,node_objects,node_properties,node_save,node_load,node_old_load toneAmber
class node_progen,node_photometry,node_attenuation,node_visualization,node_vtk_tools,node_zoom toneMint
class node_api,node_cli,node_driver toneRose
class node_scientist,node_yt toneIndigo
```

## Components

### Snapshot analysis

- [CAESAR orchestrator](https://github.com/dnarayanan/caesar/blob/master/caesar/main.py): `caesar/main.py`
- [Dataset properties](https://github.com/dnarayanan/caesar/blob/master/caesar/property_manager.py): `caesar/property_manager.py`
- [Simulation metadata](https://github.com/dnarayanan/caesar/blob/master/caesar/simulation_attributes.py): `caesar/simulation_attributes.py`
- [Particle data](https://github.com/dnarayanan/caesar/blob/master/caesar/data_manager.py): `caesar/data_manager.py`
- [Halo finding](https://github.com/dnarayanan/caesar/blob/master/caesar/fubar_halo.py): `caesar/fubar_halo.py`
- [Group finding](https://github.com/dnarayanan/caesar/blob/master/caesar/fubar.py): `caesar/fubar.py`
- [6D FOF](https://github.com/dnarayanan/caesar/blob/master/caesar/fof6d.py): `caesar/fof6d.py`

### Catalog and groups

- [Group assignment](https://github.com/dnarayanan/caesar/blob/master/caesar/assignment.py): `caesar/assignment.py`
- [Group linking](https://github.com/dnarayanan/caesar/blob/master/caesar/linking.py): `caesar/linking.py`
- [Halo galaxy cloud objects](https://github.com/dnarayanan/caesar/blob/master/caesar/group.py): `caesar/group.py`
- [Object properties](https://github.com/dnarayanan/caesar/blob/master/caesar/group.py): `caesar/group.py`
- [Catalog writer](https://github.com/dnarayanan/caesar/blob/master/caesar/saver.py): `caesar/saver.py`
- [Lazy catalog reader](https://github.com/dnarayanan/caesar/blob/master/caesar/loader.py): `caesar/loader.py`
- [Legacy catalog reader](https://github.com/dnarayanan/caesar/blob/master/caesar/old_loader.py): `caesar/old_loader.py`

### Analysis extensions

- [Progenitor analysis](https://github.com/dnarayanan/caesar/blob/master/caesar/progen.py): `caesar/progen.py`
- [Synthetic photometry](https://github.com/dnarayanan/caesar/blob/master/caesar/pyloser/pyloser.py): `caesar/pyloser/pyloser.py`
- [Dust attenuation laws](https://github.com/dnarayanan/caesar/blob/master/caesar/pyloser/atten_laws.py): `caesar/pyloser/atten_laws.py`
- [VTK visualization](https://github.com/dnarayanan/caesar/blob/master/caesar/vtk_vis.py): `caesar/vtk_vis.py`
- [VTK data functions](https://github.com/dnarayanan/caesar/blob/master/caesar/vtk_funcs.py): `caesar/vtk_funcs.py`
- [Zoom-region tools](https://github.com/dnarayanan/caesar/blob/master/caesar/zoom_funcs.py): `caesar/zoom_funcs.py`

### User interfaces

- [Public API](https://github.com/dnarayanan/caesar/blob/master/caesar/__init__.py): `caesar/__init__.py`
- [Command line](https://github.com/dnarayanan/caesar/blob/master/caesar/command_line.py): `caesar/command_line.py`
- [Analysis driver](https://github.com/dnarayanan/caesar/blob/master/caesar/driver.py): `caesar/driver.py`

### Other components

- **Analyst**
- **yt dataset**

## Connections

- Analyst → Public API: uses (evidence: `README.rst`)
- Public API → CAESAR orchestrator: exports (evidence: `caesar/__init__.py`)
- Public API → Analysis driver: exports (evidence: `caesar/__init__.py`)
- Analyst → Command line: invokes
- Command line → CAESAR orchestrator: dispatches (evidence: `caesar/command_line.py`)
- Analysis driver → CAESAR orchestrator: runs
- Analyst → yt dataset: provides snapshot (evidence: `README.rst`)
- CAESAR orchestrator → yt dataset: accepts dataset (evidence: `caesar/main.py`)
- CAESAR orchestrator → Dataset properties: uses (evidence: `caesar/main.py`)
- CAESAR orchestrator → Simulation metadata: creates attributes (evidence: `caesar/main.py`)
- CAESAR orchestrator → Particle data: loads particles (evidence: `caesar/main.py`)
- Particle data → Dataset properties: reads fields (evidence: `caesar/data_manager.py`)
- CAESAR orchestrator → Halo finding: runs (evidence: `caesar/main.py`)
- CAESAR orchestrator → Group finding: runs (evidence: `caesar/main.py`)
- Halo finding → 6D FOF: runs (evidence: `caesar/fubar_halo.py`)
- Group finding → 6D FOF: runs (evidence: `caesar/fubar.py`)
- Halo finding → Group finding: gets separation (evidence: `caesar/fubar_halo.py`)
- Halo finding → Object properties: computes (evidence: `caesar/fubar_halo.py`)
- CAESAR orchestrator → Group assignment: assigns groups (evidence: `caesar/main.py`)
- CAESAR orchestrator → Group linking: links groups (evidence: `caesar/main.py`)
- CAESAR orchestrator → Halo galaxy cloud objects: creates groups (evidence: `caesar/main.py`)
- Analyst → Catalog writer: saves catalog
- Analyst → Lazy catalog reader: loads catalog
- Analyst → Legacy catalog reader: loads legacy catalog
- Analyst → Progenitor analysis: analyzes histories
- Analyst → Synthetic photometry: computes photometry
- Synthetic photometry → Dust attenuation laws: uses laws (evidence: `caesar/pyloser/pyloser.py`)
- Analyst → VTK visualization: explores groups
- Analyst → VTK data functions: uses visualization tools
- Analyst → Zoom-region tools: selects zoom regions
