# matyldarejus/octavius architecture

> Architecture diagram of the GitHub repository matyldarejus/octavius, 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/matyldarejus/octavius
- Repository: https://github.com/matyldarejus/octavius

## Overview

Octavius is a parallel hydrodynamical-simulation analysis toolkit that produces HDF5 catalogues of halo and galaxy properties. The main workflow reads configured snapshots, assigns halo membership, finds galaxies, computes properties and optional photometry, then writes a catalogue. Separate capabilities include external halo-catalogue readers, catalogue loading and on-the-fly analysis. The graph reflects the documented workflow and source-index references; several internal links are unverified because their implementation excerpts were not provided.

Main entry points: [`octavius/run_octavius.py`](https://github.com/matyldarejus/octavius/blob/main/octavius/run_octavius.py) (Analysis runner), [`octavius/photometry/properties_photometry.py`](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/properties_photometry.py) (Photometry properties), [`octavius/data_management/snapshot_readers.py`](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/snapshot_readers.py) (Snapshot readers), [`octavius/external_halo_sources/halo_data_structures.py`](https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/halo_data_structures.py) (Halo source selection)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_orchestration["Analysis orchestration"]
  node_runner["Analysis runner<br/>[run_octavius.py]"]
  node_pipeline["Stage management"]
  node_config["Config and conventions<br/>[conventions.py]"]
  node_logger["MPI-aware logging<br/>[log.py]"]
end

subgraph group_ingestion["Snapshot and halo inputs"]
  node_snapshot["Snapshot readers"]
  node_snapshot_base["Reader base"]
  node_parallel_read["Parallel reading"]
  node_physics["Physical conversions<br/>[physics.py]"]
  node_halo_sources["Halo source selection"]
  node_ahf["AHF reader<br/>[ahf.py]"]
  node_herons["HBT-HERONS reader<br/>[hbt_herons.py]"]
  node_subfind["SUBFIND reader<br/>[subfind.py]"]
end

subgraph group_analysis["Group analysis"]
  node_galaxy_finding["6D galaxy finding<br/>[galaxy_finding.py]"]
  node_fof["6D FoF algorithm<br/>[fof6d_algorithm.py]"]
  node_group_linking["Group linking<br/>[group_linking.py]"]
  node_core_properties["Core properties<br/>[properties_core.py]"]
  node_ptype_properties["Particle properties"]
  node_local_environment["Local environment"]
  node_computations["Property computations"]
  node_aggregate_helpers["Aggregate helpers"]
  node_photometry["Photometry properties"]
  node_photo_compute["Photometry computation"]
  node_photo_helpers["Photometry helpers"]
  node_dust["Dust attenuation curves<br/>[dust_curves.py]"]
  node_photo_tables["Photometry tables"]
end

subgraph group_catalogues["Catalogue data"]
  node_stores["Particle and group stores<br/>[data_structures.py]"]
  node_csr["Membership CSR<br/>[csr.py]"]
  node_pack["Catalogue packing"]
  node_parallel_write["Parallel catalogue writing"]
  node_catalogue_file[("HDF5 catalogue")]
end

subgraph group_user_tools["Catalogue tools"]
  node_loader["Catalogue API<br/>[loader.py]"]
  node_analyser["Dynamic analyser"]
  node_toolbox["Catalogue tools<br/>[toolbox.py]"]
end

node_user(("Analyst"))

node_user -->|"configures and runs"| node_runner
node_runner -->|"loads config"| node_config
node_runner -->|"builds reader"| node_snapshot
node_runner -->|"selects halo source"| node_halo_sources
node_runner -->|"resolves stages"| node_pipeline
node_runner -->|"finds galaxies"| node_galaxy_finding
node_runner -->|"dispatches stage"| node_core_properties
node_runner -->|"dispatches stage"| node_ptype_properties
node_runner -->|"dispatches stage"| node_local_environment
node_runner -->|"dispatches stage"| node_photometry
node_runner -->|"builds group stores"| node_stores
node_runner -.->|"writes catalogue"| node_parallel_write
node_snapshot -->|"uses reader base"| node_snapshot_base
node_snapshot -->|"uses parallel reading"| node_parallel_read
node_snapshot -->|"uses conversions"| node_physics
node_halo_sources -->|"selects AHF"| node_ahf
node_halo_sources -->|"selects HERONS"| node_herons
node_halo_sources -->|"selects SUBFIND"| node_subfind
node_galaxy_finding -->|"runs algorithm"| node_fof
node_core_properties -->|"uses computations"| node_computations
node_core_properties -->|"uses helpers"| node_aggregate_helpers
node_ptype_properties -->|"uses helpers"| node_aggregate_helpers
node_photometry -->|"computes photometry"| node_photo_compute
node_photometry -->|"uses helpers"| node_photo_helpers
node_photometry -->|"uses attenuation curves"| node_dust
node_photometry -->|"reads table data"| node_photo_tables
node_stores -->|"builds membership"| node_csr
node_parallel_write -->|"packs rank data"| node_pack
node_parallel_write -->|"writes HDF5"| node_catalogue_file
node_user -->|"loads catalogue"| node_loader
node_loader -->|"reads catalogue"| node_catalogue_file
node_user -->|"requests analysis"| node_analyser
node_analyser -->|"uses catalogue API"| node_loader
node_analyser -->|"runs stage"| node_photometry
node_user -.->|"uses catalogue tools"| node_toolbox

click node_runner "https://github.com/matyldarejus/octavius/blob/main/octavius/run_octavius.py"
click node_pipeline "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/pipeline_management.py"
click node_config "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/conventions.py"
click node_logger "https://github.com/matyldarejus/octavius/blob/main/octavius/log.py"
click node_snapshot "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/snapshot_readers.py"
click node_snapshot_base "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/snapshot_readers_base.py"
click node_parallel_read "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/parallel_reading.py"
click node_physics "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/physics.py"
click node_halo_sources "https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/halo_data_structures.py"
click node_ahf "https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/ahf.py"
click node_herons "https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/hbt_herons.py"
click node_subfind "https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/subfind.py"
click node_galaxy_finding "https://github.com/matyldarejus/octavius/blob/main/octavius/galaxy_finding/galaxy_finding.py"
click node_fof "https://github.com/matyldarejus/octavius/blob/main/octavius/galaxy_finding/fof6d_algorithm.py"
click node_group_linking "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/group_linking.py"
click node_core_properties "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_core.py"
click node_ptype_properties "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_ptype_specific.py"
click node_local_environment "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_local_environment.py"
click node_computations "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/aggregate_computations.py"
click node_aggregate_helpers "https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/aggregate_helpers.py"
click node_photometry "https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/properties_photometry.py"
click node_photo_compute "https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_computations.py"
click node_photo_helpers "https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_helpers.py"
click node_dust "https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/dust_curves.py"
click node_photo_tables "https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_tables.py"
click node_stores "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/data_structures.py"
click node_csr "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/csr.py"
click node_pack "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/pack_catalogue_data.py"
click node_parallel_write "https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/parallel_writing.py"
click node_loader "https://github.com/matyldarejus/octavius/blob/main/octavius/utils/loader.py"
click node_analyser "https://github.com/matyldarejus/octavius/blob/main/octavius/utils/dynamic_analyser.py"
click node_toolbox "https://github.com/matyldarejus/octavius/blob/main/octavius/utils/toolbox.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_pipeline,node_config,node_logger toneBlue
class node_snapshot,node_snapshot_base,node_parallel_read,node_physics,node_halo_sources,node_ahf,node_herons,node_subfind toneAmber
class node_galaxy_finding,node_fof,node_group_linking,node_core_properties,node_ptype_properties,node_local_environment,node_computations,node_aggregate_helpers,node_photometry,node_photo_compute,node_photo_helpers,node_dust,node_photo_tables toneMint
class node_stores,node_csr,node_pack,node_parallel_write,node_catalogue_file toneRose
class node_loader,node_analyser,node_toolbox,node_user toneIndigo
```

## Components

### Analysis orchestration

- [Analysis runner](https://github.com/matyldarejus/octavius/blob/main/octavius/run_octavius.py): `octavius/run_octavius.py`
- [Stage management](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/pipeline_management.py): `octavius/data_management/pipeline_management.py`
- [Config and conventions](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/conventions.py): `octavius/data_management/conventions.py`
- [MPI-aware logging](https://github.com/matyldarejus/octavius/blob/main/octavius/log.py): `octavius/log.py`

### Snapshot and halo inputs

- [Snapshot readers](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/snapshot_readers.py): `octavius/data_management/snapshot_readers.py`
- [Reader base](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/snapshot_readers_base.py): `octavius/data_management/snapshot_readers_base.py`
- [Parallel reading](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/parallel_reading.py): `octavius/data_management/parallel_reading.py`
- [Physical conversions](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/physics.py): `octavius/data_management/physics.py`
- [Halo source selection](https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/halo_data_structures.py): `octavius/external_halo_sources/halo_data_structures.py`
- [AHF reader](https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/ahf.py): `octavius/external_halo_sources/ahf.py`
- [HBT-HERONS reader](https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/hbt_herons.py): `octavius/external_halo_sources/hbt_herons.py`
- [SUBFIND reader](https://github.com/matyldarejus/octavius/blob/main/octavius/external_halo_sources/subfind.py): `octavius/external_halo_sources/subfind.py`

### Group analysis

- [6D galaxy finding](https://github.com/matyldarejus/octavius/blob/main/octavius/galaxy_finding/galaxy_finding.py): `octavius/galaxy_finding/galaxy_finding.py`
- [6D FoF algorithm](https://github.com/matyldarejus/octavius/blob/main/octavius/galaxy_finding/fof6d_algorithm.py): `octavius/galaxy_finding/fof6d_algorithm.py`
- [Group linking](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/group_linking.py): `octavius/aggregate_properties/group_linking.py`
- [Core properties](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_core.py): `octavius/aggregate_properties/properties_core.py`
- [Particle properties](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_ptype_specific.py): `octavius/aggregate_properties/properties_ptype_specific.py`
- [Local environment](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/properties_local_environment.py): `octavius/aggregate_properties/properties_local_environment.py`
- [Property computations](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/aggregate_computations.py): `octavius/aggregate_properties/aggregate_computations.py`
- [Aggregate helpers](https://github.com/matyldarejus/octavius/blob/main/octavius/aggregate_properties/aggregate_helpers.py): `octavius/aggregate_properties/aggregate_helpers.py`
- [Photometry properties](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/properties_photometry.py): `octavius/photometry/properties_photometry.py`
- [Photometry computation](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_computations.py): `octavius/photometry/photometry_computations.py`
- [Photometry helpers](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_helpers.py): `octavius/photometry/photometry_helpers.py`
- [Dust attenuation curves](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/dust_curves.py): `octavius/photometry/dust_curves.py`
- [Photometry tables](https://github.com/matyldarejus/octavius/blob/main/octavius/photometry/photometry_tables.py): `octavius/photometry/photometry_tables.py`

### Catalogue data

- [Particle and group stores](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/data_structures.py): `octavius/data_management/data_structures.py`
- [Membership CSR](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/csr.py): `octavius/data_management/csr.py`
- [Catalogue packing](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/pack_catalogue_data.py): `octavius/data_management/pack_catalogue_data.py`
- [Parallel catalogue writing](https://github.com/matyldarejus/octavius/blob/main/octavius/data_management/parallel_writing.py): `octavius/data_management/parallel_writing.py`
- **HDF5 catalogue**

### Catalogue tools

- [Catalogue API](https://github.com/matyldarejus/octavius/blob/main/octavius/utils/loader.py): `octavius/utils/loader.py`
- [Dynamic analyser](https://github.com/matyldarejus/octavius/blob/main/octavius/utils/dynamic_analyser.py): `octavius/utils/dynamic_analyser.py`
- [Catalogue tools](https://github.com/matyldarejus/octavius/blob/main/octavius/utils/toolbox.py): `octavius/utils/toolbox.py`

### Other components

- **Analyst**

## Connections

- Analyst → Analysis runner: configures and runs (evidence: `README.md`)
- Analysis runner → Config and conventions: loads config (evidence: `octavius/run_octavius.py`)
- Analysis runner → Snapshot readers: builds reader (evidence: `octavius/run_octavius.py`)
- Analysis runner → Halo source selection: selects halo source (evidence: `octavius/run_octavius.py`)
- Analysis runner → Stage management: resolves stages (evidence: `octavius/run_octavius.py`)
- Analysis runner → 6D galaxy finding: finds galaxies (evidence: `octavius/run_octavius.py`)
- Analysis runner → Core properties: dispatches stage (evidence: `octavius/run_octavius.py`)
- Analysis runner → Particle properties: dispatches stage (evidence: `octavius/run_octavius.py`)
- Analysis runner → Local environment: dispatches stage (evidence: `octavius/run_octavius.py`)
- Analysis runner → Photometry properties: dispatches stage (evidence: `octavius/run_octavius.py`)
- Analysis runner → Particle and group stores: builds group stores (evidence: `octavius/run_octavius.py`)
- Analysis runner → Parallel catalogue writing: writes catalogue
- Snapshot readers → Reader base: uses reader base (evidence: `octavius/data_management/snapshot_readers.py`)
- Snapshot readers → Parallel reading: uses parallel reading (evidence: `octavius/data_management/snapshot_readers.py`)
- Snapshot readers → Physical conversions: uses conversions (evidence: `octavius/data_management/snapshot_readers.py`)
- Halo source selection → AHF reader: selects AHF (evidence: `octavius/external_halo_sources/halo_data_structures.py`)
- Halo source selection → HBT-HERONS reader: selects HERONS (evidence: `octavius/external_halo_sources/halo_data_structures.py`)
- Halo source selection → SUBFIND reader: selects SUBFIND (evidence: `octavius/external_halo_sources/halo_data_structures.py`)
- 6D galaxy finding → 6D FoF algorithm: runs algorithm (evidence: `octavius/galaxy_finding/galaxy_finding.py`)
- Core properties → Property computations: uses computations (evidence: `octavius/aggregate_properties/properties_core.py`)
- Core properties → Aggregate helpers: uses helpers (evidence: `octavius/aggregate_properties/properties_core.py`)
- Particle properties → Aggregate helpers: uses helpers (evidence: `octavius/aggregate_properties/properties_ptype_specific.py`)
- Photometry properties → Photometry computation: computes photometry (evidence: `octavius/photometry/properties_photometry.py`)
- Photometry properties → Photometry helpers: uses helpers (evidence: `octavius/photometry/properties_photometry.py`)
- Photometry properties → Dust attenuation curves: uses attenuation curves (evidence: `octavius/photometry/properties_photometry.py`)
- Photometry properties → Photometry tables: reads table data (evidence: `octavius/photometry/properties_photometry.py`)
- Particle and group stores → Membership CSR: builds membership (evidence: `octavius/data_management/data_structures.py`)
- Parallel catalogue writing → Catalogue packing: packs rank data (evidence: `octavius/data_management/parallel_writing.py`)
- Parallel catalogue writing → HDF5 catalogue: writes HDF5 (evidence: `README.md`)
- Analyst → Catalogue API: loads catalogue (evidence: `README.md`)
- Catalogue API → HDF5 catalogue: reads catalogue (evidence: `README.md`)
- Analyst → Dynamic analyser: requests analysis (evidence: `README.md`)
- Dynamic analyser → Catalogue API: uses catalogue API (evidence: `octavius/utils/dynamic_analyser.py`)
- Dynamic analyser → Photometry properties: runs stage (evidence: `octavius/utils/dynamic_analyser.py`)
- Analyst → Catalogue tools: uses catalogue tools
