# amougino/amou_tipe architecture

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

- Interactive diagram: https://gitdiagram.com/amougino/amou_tipe
- Repository: https://github.com/amougino/amou_tipe

## Overview

THREad the Needle models satellite trajectories in a rotating two-body system, then analyzes transfer outcomes across varied settings. The principal workflow is to load settings, integrate a trajectory, calculate transfer metrics, and write results for collection and visualization. The repository also includes trajectory plotting, trajectory diagnostics, and a separate mapping/phase-line capability. Batch and plotting relationships are shown where excerpts support them; big_plot.py is listed as read but its implementation was not provided, so its connections are omitted.

Main entry points: [`thren/sim.py`](https://github.com/amougino/amou_tipe/blob/main/thren/sim.py) (ODE simulator), [`thren/on_the_fly.py`](https://github.com/amougino/amou_tipe/blob/main/thren/on_the_fly.py) (Sequential sweep), [`thren/parallel_otf.py`](https://github.com/amougino/amou_tipe/blob/main/thren/parallel_otf.py) (Parallel sweep), [`thren/analysis/transfer.py`](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/transfer.py) (Transfer metrics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_simulation["Trajectory simulation"]
  node_settings["Simulation settings"]
  node_simulator["ODE simulator<br/>[sim.py]"]
  node_formulae["Physics formulae<br/>[formulae.py]"]
  node_trajectory_plot["Trajectory plotting<br/>[sim.py]"]
end

subgraph group_analysis["Trajectory analysis"]
  node_distance["Distance metrics<br/>[distance.py]"]
  node_velocity["Velocity metrics<br/>[velocity.py]"]
  node_sat_energy["Satellite energy<br/>[sat_energy.py]"]
  node_transfer["Transfer metrics<br/>[transfer.py]"]
  node_jacobi["Jacobi diagnostic<br/>[jacobi.py]"]
  node_trajectory_analysis["Trajectory diagnostic<br/>[trajectory.py]"]
end

subgraph group_sweeps["Parameter sweeps"]
  node_multi_settings["Sweep settings"]
  node_single_sweep["Sequential sweep<br/>[on_the_fly.py]"]
  node_parallel_sweep["Parallel sweep<br/>[parallel_otf.py]"]
  node_folder_helper["Result folder helper<br/>[create_folder.py]"]
end

subgraph group_results["Results and visualization"]
  node_csv_results[("Sweep CSV results")]
  node_collector["Result collection<br/>[collect.py]"]
  node_mapper["Result mapping<br/>[mapping.py]"]
  node_big_plot["Result plotting<br/>[big_plot.py]"]
end

node_engineer(("User"))

node_engineer -.->|"runs simulation"| node_simulator
node_settings -->|"loads defaults"| node_simulator
node_simulator -->|"uses physics"| node_formulae
node_simulator -->|"plots solution"| node_trajectory_plot
node_jacobi -->|"uses dynamics"| node_simulator
node_trajectory_analysis -->|"uses dynamics"| node_simulator
node_distance -->|"uses dynamics"| node_simulator
node_velocity -->|"uses dynamics"| node_simulator
node_sat_energy -->|"uses dynamics"| node_simulator
node_transfer -->|"calls velocity"| node_velocity
node_transfer -->|"calls energy"| node_sat_energy
node_transfer -->|"calls distance"| node_distance
node_multi_settings -.->|"configures sweep"| node_single_sweep
node_multi_settings -.->|"configures sweep"| node_parallel_sweep
node_single_sweep -->|"runs cells"| node_simulator
node_single_sweep -->|"calculates metrics"| node_transfer
node_single_sweep -->|"calculates minima"| node_distance
node_single_sweep -->|"creates folder"| node_folder_helper
node_single_sweep -->|"writes results"| node_csv_results
node_parallel_sweep -->|"runs cells"| node_simulator
node_parallel_sweep -->|"calculates metrics"| node_transfer
node_parallel_sweep -->|"calculates minima"| node_distance
node_parallel_sweep -->|"creates folder"| node_folder_helper
node_parallel_sweep -->|"writes results"| node_csv_results
node_collector -->|"reads results"| node_csv_results
node_mapper -->|"collects data"| node_collector
node_mapper -->|"calculates phases"| node_formulae

click node_settings "https://github.com/amougino/amou_tipe/blob/main/thren/settings_single.json"
click node_multi_settings "https://github.com/amougino/amou_tipe/blob/main/thren/settings_multi.json"
click node_simulator "https://github.com/amougino/amou_tipe/blob/main/thren/sim.py"
click node_formulae "https://github.com/amougino/amou_tipe/blob/main/thren/formulae.py"
click node_trajectory_plot "https://github.com/amougino/amou_tipe/blob/main/thren/sim.py"
click node_distance "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/distance.py"
click node_velocity "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/velocity.py"
click node_sat_energy "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/sat_energy.py"
click node_transfer "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/transfer.py"
click node_jacobi "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/jacobi.py"
click node_trajectory_analysis "https://github.com/amougino/amou_tipe/blob/main/thren/analysis/trajectory.py"
click node_single_sweep "https://github.com/amougino/amou_tipe/blob/main/thren/on_the_fly.py"
click node_parallel_sweep "https://github.com/amougino/amou_tipe/blob/main/thren/parallel_otf.py"
click node_folder_helper "https://github.com/amougino/amou_tipe/blob/main/thren/create_folder.py"
click node_collector "https://github.com/amougino/amou_tipe/blob/main/thren/collect.py"
click node_mapper "https://github.com/amougino/amou_tipe/blob/main/thren/mapping.py"
click node_big_plot "https://github.com/amougino/amou_tipe/blob/main/thren/big_plot.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_settings,node_simulator,node_formulae,node_trajectory_plot,node_engineer toneBlue
class node_distance,node_velocity,node_sat_energy,node_transfer,node_jacobi,node_trajectory_analysis toneAmber
class node_multi_settings,node_single_sweep,node_parallel_sweep,node_folder_helper toneMint
class node_csv_results,node_collector,node_mapper,node_big_plot toneRose
```

## Components

### Trajectory simulation

- [Simulation settings](https://github.com/amougino/amou_tipe/blob/main/thren/settings_single.json): `thren/settings_single.json`
- [ODE simulator](https://github.com/amougino/amou_tipe/blob/main/thren/sim.py): `thren/sim.py`
- [Physics formulae](https://github.com/amougino/amou_tipe/blob/main/thren/formulae.py): `thren/formulae.py`
- [Trajectory plotting](https://github.com/amougino/amou_tipe/blob/main/thren/sim.py): `thren/sim.py`

### Trajectory analysis

- [Distance metrics](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/distance.py): `thren/analysis/distance.py`
- [Velocity metrics](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/velocity.py): `thren/analysis/velocity.py`
- [Satellite energy](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/sat_energy.py): `thren/analysis/sat_energy.py`
- [Transfer metrics](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/transfer.py): `thren/analysis/transfer.py`
- [Jacobi diagnostic](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/jacobi.py): `thren/analysis/jacobi.py`
- [Trajectory diagnostic](https://github.com/amougino/amou_tipe/blob/main/thren/analysis/trajectory.py): `thren/analysis/trajectory.py`

### Parameter sweeps

- [Sweep settings](https://github.com/amougino/amou_tipe/blob/main/thren/settings_multi.json): `thren/settings_multi.json`
- [Sequential sweep](https://github.com/amougino/amou_tipe/blob/main/thren/on_the_fly.py): `thren/on_the_fly.py`
- [Parallel sweep](https://github.com/amougino/amou_tipe/blob/main/thren/parallel_otf.py): `thren/parallel_otf.py`
- [Result folder helper](https://github.com/amougino/amou_tipe/blob/main/thren/create_folder.py): `thren/create_folder.py`

### Results and visualization

- **Sweep CSV results**
- [Result collection](https://github.com/amougino/amou_tipe/blob/main/thren/collect.py): `thren/collect.py`
- [Result mapping](https://github.com/amougino/amou_tipe/blob/main/thren/mapping.py): `thren/mapping.py`
- [Result plotting](https://github.com/amougino/amou_tipe/blob/main/thren/big_plot.py): `thren/big_plot.py`

### Other components

- **User**

## Connections

- User → ODE simulator: runs simulation
- Simulation settings → ODE simulator: loads defaults (evidence: `thren/sim.py`)
- ODE simulator → Physics formulae: uses physics (evidence: `thren/sim.py`)
- ODE simulator → Trajectory plotting: plots solution (evidence: `thren/sim.py`)
- Jacobi diagnostic → ODE simulator: uses dynamics (evidence: `thren/analysis/jacobi.py`)
- Trajectory diagnostic → ODE simulator: uses dynamics (evidence: `thren/analysis/trajectory.py`)
- Distance metrics → ODE simulator: uses dynamics (evidence: `thren/analysis/distance.py`)
- Velocity metrics → ODE simulator: uses dynamics (evidence: `thren/analysis/velocity.py`)
- Satellite energy → ODE simulator: uses dynamics (evidence: `thren/analysis/sat_energy.py`)
- Transfer metrics → Velocity metrics: calls velocity (evidence: `thren/analysis/transfer.py`)
- Transfer metrics → Satellite energy: calls energy (evidence: `thren/analysis/transfer.py`)
- Transfer metrics → Distance metrics: calls distance (evidence: `thren/analysis/transfer.py`)
- Sweep settings → Sequential sweep: configures sweep
- Sweep settings → Parallel sweep: configures sweep
- Sequential sweep → ODE simulator: runs cells (evidence: `thren/on_the_fly.py`)
- Sequential sweep → Transfer metrics: calculates metrics (evidence: `thren/on_the_fly.py`)
- Sequential sweep → Distance metrics: calculates minima (evidence: `thren/on_the_fly.py`)
- Sequential sweep → Result folder helper: creates folder (evidence: `thren/on_the_fly.py`)
- Sequential sweep → Sweep CSV results: writes results (evidence: `thren/on_the_fly.py`)
- Parallel sweep → ODE simulator: runs cells (evidence: `thren/parallel_otf.py`)
- Parallel sweep → Transfer metrics: calculates metrics (evidence: `thren/parallel_otf.py`)
- Parallel sweep → Distance metrics: calculates minima (evidence: `thren/parallel_otf.py`)
- Parallel sweep → Result folder helper: creates folder (evidence: `thren/parallel_otf.py`)
- Parallel sweep → Sweep CSV results: writes results (evidence: `thren/parallel_otf.py`)
- Result collection → Sweep CSV results: reads results (evidence: `thren/collect.py`)
- Result mapping → Result collection: collects data (evidence: `thren/mapping.py`)
- Result mapping → Physics formulae: calculates phases (evidence: `thren/mapping.py`)
