# trottadom/serpyshock architecture

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

- Interactive diagram: https://gitdiagram.com/trottadom/serpyshock
- Repository: https://github.com/trottadom/serpyshock

## Overview

SerPyShock is a Python toolkit for analysing in-situ shock properties. Its visible analysis routines estimate shock normals, evaluate shock-speed and density-compression statistics across changing measurement windows, and compute Rankine–Hugoniot-compliant signals. The repository also includes a Solar Orbiter/SWA ground-moments loader that searches and fetches archive data and returns a dataframe. The excerpts show some helper calls and loader data flow, but not a top-level analysis orchestrator or how the loader feeds the analysis routines.

Main entry points: [`solo_swa_loader/__init__.py`](https://github.com/trottadom/serpyshock/blob/main/solo_swa_loader/__init__.py) (SWA moments loader), [`SerPyShock/SerPyShock.py`](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py) (Window statistics)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Shock analysis"]
  node_shock_methods["Shock methods<br/>[SerPyShock.py]"]
  node_normal_estimation["Normal estimation<br/>[SerPyShock.py]"]
  node_window_statistics["Window statistics<br/>[SerPyShock.py]"]
  node_rh_signals["RH signal synthesis<br/>[SerPyShock.py]"]
end

subgraph group_loader["SWA data loading"]
  node_swa_loader["SWA moments loader<br/>[__init__.py]"]
  node_timeseries["TimeSeries conversion<br/>[__init__.py]"]
end

subgraph group_helpers["Analysis internals"]
  node_window_helpers["Window selection<br/>[SerPyShock.py]"]
end

node_user(("Python user"))
node_soar_archive[("SOAR archive")]
node_dataframe["Moments dataframe"]

node_window_statistics -->|"selects windows"| node_window_helpers
node_swa_loader -->|"searches and fetches"| node_soar_archive
node_swa_loader -->|"loads files"| node_timeseries
node_timeseries -->|"converts to"| node_dataframe

click node_shock_methods "https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py"
click node_normal_estimation "https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py"
click node_window_statistics "https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py"
click node_rh_signals "https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py"
click node_window_helpers "https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py"
click node_swa_loader "https://github.com/trottadom/serpyshock/blob/main/solo_swa_loader/__init__.py"
click node_timeseries "https://github.com/trottadom/serpyshock/blob/main/solo_swa_loader/__init__.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_shock_methods,node_normal_estimation,node_window_statistics,node_rh_signals,node_user toneBlue
class node_swa_loader,node_timeseries,node_soar_archive toneAmber
class node_window_helpers toneMint
class node_dataframe toneIndigo
```

## Components

### Shock analysis

- [Shock methods](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py): `SerPyShock/SerPyShock.py`
- [Normal estimation](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py): `SerPyShock/SerPyShock.py`
- [Window statistics](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py): `SerPyShock/SerPyShock.py`
- [RH signal synthesis](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py): `SerPyShock/SerPyShock.py`

### SWA data loading

- [SWA moments loader](https://github.com/trottadom/serpyshock/blob/main/solo_swa_loader/__init__.py): `solo_swa_loader/__init__.py`
- [TimeSeries conversion](https://github.com/trottadom/serpyshock/blob/main/solo_swa_loader/__init__.py): `solo_swa_loader/__init__.py`

### Analysis internals

- [Window selection](https://github.com/trottadom/serpyshock/blob/main/SerPyShock/SerPyShock.py): `SerPyShock/SerPyShock.py`

### Other components

- **Python user**
- **SOAR archive**
- **Moments dataframe**

## Connections

- Window statistics → Window selection: selects windows (evidence: `SerPyShock/SerPyShock.py`)
- SWA moments loader → SOAR archive: searches and fetches (evidence: `solo_swa_loader/__init__.py`)
- SWA moments loader → TimeSeries conversion: loads files (evidence: `solo_swa_loader/__init__.py`)
- TimeSeries conversion → Moments dataframe: converts to (evidence: `solo_swa_loader/__init__.py`)
