# connor-a-casey/fso-simulation architecture

> Architecture diagram of the GitHub repository connor-a-casey/fso-simulation, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-27). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/connor-a-casey/fso-simulation
- Repository: https://github.com/connor-a-casey/fso-simulation

## Overview

##### Main Components
- • Satellite Passes Module: Handles satellite orbit simulation using TLE data (src/satellite_passes). It reads the TLE file (e.g., terra.tle) together with key parameters from the data/input folder.
- • Turbulence Module: Analyzes turbulence effects using FITS files (src/turbulence). Contains unique scripts to calculate turbulence strength.
- • Cloud Cover Module: Computes cloud cover, interacting with the EUMETSAT API to get cloud data (src/cloud_cover).
- • Data Integrator: Merges outputs from the preceding modules, linking simulation results (src/data_integrator).
- • Dynamic Analysis Module: Performs further calculations using the integrated data and original satellite parameters (src/dynamic_analysis).

##### Data Sources and Supporting Items
- "data" folder containing both input parameters and output directories.
- Configuration files, such as the satelliteParameters.txt (data/input) and the TLE file in the satellite_passes folder.
- That there is a Dockerfile along with a run_simulation.zsh script (under scripts) to enable both container-based and traditional setups.

1. Data flows from "satelliteParameters.txt" and TLE into the Satellite Passes Module.
2. Output then flows into the Turbulence and Cloud Cover Modules.
3. Their respective outputs then converge in the Data Integrator.
4. Finally, the integrated data (along with the original parameters) feeds into the Dynamic Analysis module.
- Optionally, include an external interaction block showing the API call to the EUMETSAT gateway from the Cloud Cover module.

##### Architectural Patterns and Design Principles
- This design follows a modular pipeline approach where each step’s output becomes the next step’s input.
- Sequential model execution order, which helps in clearly separating simulation components.
- That this is a specialized simulation system rather than a general full-stack application. It leverages focused submodules that are interconnected through well-defined data dependencies.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Input Layer
    subgraph "Input Layer"
        InputData["satelliteParameters.txt"]:::data
        TLEFile["TLE File (terra.tle)"]:::data
    end

    %% Simulation Pipeline
    InputData -->|"feeds"| SatPass["Satellite Passes Module\n(TLE processing)"]:::module
    TLEFile -->|"feeds"| SatPass

    SatPass -->|"outputs"| Turbulence["Turbulence Module"]:::module
    SatPass -->|"outputs"| CloudCover["Cloud Cover Module\n(EUMETSAT integration)"]:::module

    CloudCover -->|"calls"| EUMETSAT["EUMETSAT API"]:::external

    Turbulence -->|"merges into"| DataIntegrator["Data Integrator"]:::module
    CloudCover -->|"merges into"| DataIntegrator

    DataIntegrator -->|"integrates to"| DynamicAnalysis["Dynamic Analysis Module"]:::module
    DynamicAnalysis -->|"produces"| FinalResults["Final Results\n(data/output)"]:::data

    %% Execution Environment / Container Setup
    subgraph "Execution Environment"
        Dockerfile["Dockerfile"]:::setup
        RunSimScript["run_simulation.zsh"]:::setup
    end

    Dockerfile -.->|"containerizes"| SatPass
    RunSimScript -.->|"triggers"| SatPass

    %% Click Events
    click InputData "https://github.com/connor-a-casey/fso-simulation/tree/main/data/input"
    click TLEFile "https://github.com/connor-a-casey/fso-simulation/tree/main/src/satellite_passes"
    click SatPass "https://github.com/connor-a-casey/fso-simulation/tree/main/src/satellite_passes"
    click Turbulence "https://github.com/connor-a-casey/fso-simulation/tree/main/src/turbulence"
    click CloudCover "https://github.com/connor-a-casey/fso-simulation/tree/main/src/cloud_cover"
    click DataIntegrator "https://github.com/connor-a-casey/fso-simulation/blob/main/src/data_integrator/data_integrator.py"
    click DynamicAnalysis "https://github.com/connor-a-casey/fso-simulation/tree/main/src/dynamic_analysis"
    click Dockerfile "https://github.com/connor-a-casey/fso-simulation/tree/main/Dockerfile"
    click RunSimScript "https://github.com/connor-a-casey/fso-simulation/blob/main/scripts/run_simulation.zsh"

    %% Styles
    classDef module fill:#FFD700,stroke:#B8860B,stroke-width:2px;
    classDef data fill:#ADD8E6,stroke:#0000FF,stroke-width:2px;
    classDef external fill:#FFB6C1,stroke:#FF69B4,stroke-width:2px;
    classDef setup fill:#90EE90,stroke:#008000,stroke-width:2px;
```
