# raulsan7/underwateracoustics_offcoustics_fortran architecture

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

- Interactive diagram: https://gitdiagram.com/raulsan7/underwateracoustics_offcoustics_fortran
- Repository: https://github.com/raulsan7/underwateracoustics_offcoustics_fortran

## Overview

This is a Python plotting and post-processing package for acoustic-solver HDF5 outputs. The principal workflow is selecting files, decoding solver data into emitter-specific cases, then generating acoustic plots and saving figures. The graph preserves the documented turbine, farm, source, comparison, and plot-family capabilities. Many links rely on the SOURCE INDEX rather than full excerpts; uncertain relationships are omitted.

Main entry points: [`plotting/plots`](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/tree/main/plotting/plots) (Plot families), [`plotting/compare/plots.py`](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/compare/plots.py) (Case comparisons), [`plotting/readers/describe.py`](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/describe.py) (File description), [`plotting/wrappers/turbine.py`](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/turbine.py) (Turbine wrapper)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_input["Input and cases"]
  node_cli["File selection<br/>[cli.py]"]
  node_files["HDF5 discovery<br/>[files.py]"]
  node_turbine_entry["Turbine plotting<br/>[turbine.py]"]
  node_farm_entry["Farm plotting<br/>[farm.py]"]
  node_source_entry["Source plotting<br/>[source.py]"]
  node_turbine_case["Turbine wrapper<br/>[turbine.py]"]
  node_farm_case["Farm wrapper<br/>[farm.py]"]
  node_source_case["Source wrapper<br/>[source.py]"]
  node_case_contract["Case contract<br/>[case.py]"]
end

subgraph group_readers["Solver data readers"]
  node_hdf5["HDF5 decoding<br/>[hdf5_io.py]"]
  node_solver["Solver metadata<br/>[solver.py]"]
  node_turbine_reader["Turbine reader<br/>[turbine.py]"]
  node_farm_reader["Farm reader<br/>[farm.py]"]
  node_source_reader["Source reader<br/>[source.py]"]
  node_describe["File description<br/>[describe.py]"]
end

subgraph group_plots["Acoustic plotting"]
  node_generic_plots["Generic plots<br/>[common.py]"]
  node_compare["Case comparisons<br/>[plots.py]"]
  node_plot_families["Plot families"]
  node_special_plots["Specialized plots"]
end

subgraph group_shared["Plotting support"]
  node_acoustic_utils["Acoustic metrics<br/>[AcousticUtils.py]"]
  node_environment["Water environment"]
  node_conversions["Magnitude conversion<br/>[conversions.py]"]
  node_drawing["Plot drawing<br/>[drawing.py]"]
  node_colors["Colors and palettes<br/>[colors.py]"]
  node_style["Academic styling<br/>[style.py]"]
  node_saving["Figure saving<br/>[saving.py]"]
end

node_user(("Analyst"))

node_user -->|"selects files"| node_cli
node_cli -->|"resolves paths"| node_files
node_user -.->|"requests plots"| node_turbine_entry
node_user -.->|"requests plots"| node_farm_entry
node_user -.->|"requests plots"| node_source_entry
node_turbine_entry -->|"uses wrapper"| node_turbine_case
node_farm_entry -->|"uses wrapper"| node_farm_case
node_source_entry -->|"uses wrapper"| node_source_case
node_turbine_case -->|"reads data"| node_turbine_reader
node_farm_case -->|"reads data"| node_farm_reader
node_source_case -->|"reads data"| node_source_reader
node_turbine_case -->|"describes files"| node_describe
node_farm_case -->|"describes files"| node_describe
node_source_case -->|"describes files"| node_describe
node_turbine_case -.->|"validates case"| node_case_contract
node_farm_case -.->|"validates case"| node_case_contract
node_source_case -.->|"validates case"| node_case_contract
node_turbine_reader -->|"decodes datasets"| node_hdf5
node_farm_reader -->|"decodes datasets"| node_hdf5
node_source_reader -->|"decodes datasets"| node_hdf5
node_turbine_reader -->|"loads metadata"| node_solver
node_farm_reader -->|"loads metadata"| node_solver
node_source_reader -->|"loads metadata"| node_solver
node_describe -->|"detects format"| node_hdf5
node_describe -->|"reads metadata"| node_solver
node_describe -->|"describes emitter"| node_turbine_reader
node_turbine_entry -->|"plots comparisons"| node_compare
node_farm_entry -->|"plots comparisons"| node_compare
node_source_entry -->|"plots comparisons"| node_compare
node_compare -->|"uses case fields"| node_case_contract
node_compare -->|"draws panels"| node_generic_plots
node_compare -->|"draws structure"| node_special_plots
node_compare -->|"names figures"| node_saving
node_plot_families -.->|"consumes cases"| node_case_contract
node_plot_families -.->|"converts pressure"| node_conversions
node_plot_families -.->|"computes metrics"| node_acoustic_utils
node_plot_families -.->|"draws annotations"| node_drawing
node_plot_families -.->|"styles series"| node_colors
node_plot_families -.->|"names figures"| node_saving
node_conversions -->|"converts pressure"| node_acoustic_utils
node_colors -->|"uses palettes"| node_style
node_saving -->|"formats paths"| node_files
node_farm_case -->|"parses options"| node_cli
node_source_case -->|"parses options"| node_cli
node_turbine_case -->|"parses options"| node_cli
node_plot_families -.->|"uses water data"| node_environment

click node_cli "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/cli.py"
click node_files "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/files.py"
click node_turbine_entry "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/turbine.py"
click node_farm_entry "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/farm.py"
click node_source_entry "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/source.py"
click node_turbine_case "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/turbine.py"
click node_farm_case "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/farm.py"
click node_source_case "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/source.py"
click node_case_contract "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/case.py"
click node_hdf5 "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/hdf5_io.py"
click node_solver "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/solver.py"
click node_turbine_reader "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/turbine.py"
click node_farm_reader "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/farm.py"
click node_source_reader "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/source.py"
click node_describe "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/describe.py"
click node_generic_plots "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plots/common.py"
click node_compare "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/compare/plots.py"
click node_plot_families "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/tree/main/plotting/plots"
click node_special_plots "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/tree/main/plotting/plots/specific"
click node_acoustic_utils "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/utils/AcousticUtils.py"
click node_environment "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/utils/EnvironmentalData.py"
click node_conversions "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/conversions.py"
click node_drawing "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/drawing.py"
click node_colors "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/colors.py"
click node_style "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/style.py"
click node_saving "https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/saving.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_files,node_turbine_entry,node_farm_entry,node_source_entry,node_turbine_case,node_farm_case,node_source_case,node_case_contract toneBlue
class node_hdf5,node_solver,node_turbine_reader,node_farm_reader,node_source_reader,node_describe toneAmber
class node_generic_plots,node_compare,node_plot_families,node_special_plots toneMint
class node_acoustic_utils,node_environment,node_conversions,node_drawing,node_colors,node_style,node_saving toneRose
class node_user toneIndigo
```

## Components

### Input and cases

- [File selection](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/cli.py): `plotting/plot_utils/cli.py`
- [HDF5 discovery](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/files.py): `plotting/plot_utils/files.py`
- [Turbine plotting](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/turbine.py): `plotting/turbine.py`
- [Farm plotting](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/farm.py): `plotting/farm.py`
- [Source plotting](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/source.py): `plotting/source.py`
- [Turbine wrapper](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/turbine.py): `plotting/wrappers/turbine.py`
- [Farm wrapper](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/farm.py): `plotting/wrappers/farm.py`
- [Source wrapper](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/source.py): `plotting/wrappers/source.py`
- [Case contract](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/wrappers/case.py): `plotting/wrappers/case.py`

### Solver data readers

- [HDF5 decoding](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/hdf5_io.py): `plotting/readers/hdf5_io.py`
- [Solver metadata](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/solver.py): `plotting/readers/solver.py`
- [Turbine reader](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/turbine.py): `plotting/readers/turbine.py`
- [Farm reader](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/farm.py): `plotting/readers/farm.py`
- [Source reader](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/source.py): `plotting/readers/source.py`
- [File description](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/readers/describe.py): `plotting/readers/describe.py`

### Acoustic plotting

- [Generic plots](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plots/common.py): `plotting/plots/common.py`
- [Case comparisons](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/compare/plots.py): `plotting/compare/plots.py`
- [Plot families](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/tree/main/plotting/plots): `plotting/plots`
- [Specialized plots](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/tree/main/plotting/plots/specific): `plotting/plots/specific`

### Plotting support

- [Acoustic metrics](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/utils/AcousticUtils.py): `plotting/utils/AcousticUtils.py`
- [Water environment](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/utils/EnvironmentalData.py): `plotting/utils/EnvironmentalData.py`
- [Magnitude conversion](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/conversions.py): `plotting/plot_utils/conversions.py`
- [Plot drawing](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/drawing.py): `plotting/plot_utils/drawing.py`
- [Colors and palettes](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/colors.py): `plotting/plot_utils/colors.py`
- [Academic styling](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/style.py): `plotting/plot_utils/style.py`
- [Figure saving](https://github.com/raulsan7/underwateracoustics_offcoustics_fortran/blob/main/plotting/plot_utils/saving.py): `plotting/plot_utils/saving.py`

### Other components

- **Analyst**

## Connections

- Analyst → File selection: selects files (evidence: `plotting/plot_utils/cli.py`)
- File selection → HDF5 discovery: resolves paths (evidence: `plotting/plot_utils/cli.py`)
- Analyst → Turbine plotting: requests plots
- Analyst → Farm plotting: requests plots
- Analyst → Source plotting: requests plots
- Turbine plotting → Turbine wrapper: uses wrapper (evidence: `plotting/turbine.py`)
- Farm plotting → Farm wrapper: uses wrapper (evidence: `plotting/farm.py`)
- Source plotting → Source wrapper: uses wrapper (evidence: `plotting/source.py`)
- Turbine wrapper → Turbine reader: reads data (evidence: `plotting/wrappers/turbine.py`)
- Farm wrapper → Farm reader: reads data (evidence: `plotting/wrappers/farm.py`)
- Source wrapper → Source reader: reads data (evidence: `plotting/wrappers/source.py`)
- Turbine wrapper → File description: describes files (evidence: `plotting/wrappers/turbine.py`)
- Farm wrapper → File description: describes files (evidence: `plotting/wrappers/farm.py`)
- Source wrapper → File description: describes files (evidence: `plotting/wrappers/source.py`)
- Turbine wrapper → Case contract: validates case (evidence: `plotting/wrappers/turbine.py`)
- Farm wrapper → Case contract: validates case (evidence: `plotting/wrappers/farm.py`)
- Source wrapper → Case contract: validates case (evidence: `plotting/wrappers/source.py`)
- Turbine reader → HDF5 decoding: decodes datasets (evidence: `plotting/readers/turbine.py`)
- Farm reader → HDF5 decoding: decodes datasets (evidence: `plotting/readers/farm.py`)
- Source reader → HDF5 decoding: decodes datasets (evidence: `plotting/readers/source.py`)
- Turbine reader → Solver metadata: loads metadata (evidence: `plotting/readers/turbine.py`)
- Farm reader → Solver metadata: loads metadata (evidence: `plotting/readers/farm.py`)
- Source reader → Solver metadata: loads metadata (evidence: `plotting/readers/source.py`)
- File description → HDF5 decoding: detects format (evidence: `plotting/readers/describe.py`)
- File description → Solver metadata: reads metadata (evidence: `plotting/readers/describe.py`)
- File description → Turbine reader: describes emitter (evidence: `plotting/readers/describe.py`)
- Turbine plotting → Case comparisons: plots comparisons (evidence: `plotting/turbine.py`)
- Farm plotting → Case comparisons: plots comparisons (evidence: `plotting/farm.py`)
- Source plotting → Case comparisons: plots comparisons (evidence: `plotting/source.py`)
- Case comparisons → Case contract: uses case fields (evidence: `plotting/compare/plots.py`)
- Case comparisons → Generic plots: draws panels (evidence: `plotting/compare/plots.py`)
- Case comparisons → Specialized plots: draws structure (evidence: `plotting/compare/plots.py`)
- Case comparisons → Figure saving: names figures (evidence: `plotting/compare/plots.py`)
- Plot families → Case contract: consumes cases (evidence: `plotting/plots/metrics.py`)
- Plot families → Magnitude conversion: converts pressure (evidence: `plotting/plots/metrics.py`)
- Plot families → Acoustic metrics: computes metrics (evidence: `plotting/plots/metrics.py`)
- Plot families → Plot drawing: draws annotations (evidence: `plotting/plots/specific/structure.py`)
- Plot families → Colors and palettes: styles series (evidence: `plotting/plots/metrics.py`)
- Plot families → Figure saving: names figures (evidence: `plotting/plots/metrics.py`)
- Magnitude conversion → Acoustic metrics: converts pressure (evidence: `plotting/plot_utils/conversions.py`)
- Colors and palettes → Academic styling: uses palettes (evidence: `plotting/plot_utils/colors.py`)
- Figure saving → HDF5 discovery: formats paths (evidence: `plotting/plot_utils/saving.py`)
- Farm wrapper → File selection: parses options (evidence: `plotting/wrappers/farm.py`)
- Source wrapper → File selection: parses options (evidence: `plotting/wrappers/source.py`)
- Turbine wrapper → File selection: parses options (evidence: `plotting/wrappers/turbine.py`)
- Plot families → Water environment: uses water data (evidence: `plotting/plots/spectrum.py`)
