# qihahfirhat/water-level-prediction architecture

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

- Interactive diagram: https://gitdiagram.com/qihahfirhat/water-level-prediction
- Repository: https://github.com/qihahfirhat/water-level-prediction

## Overview

This repository provides two water-level workflows: it plots cleaned readings from the historical workbook, and reconstructs 10-minute readings from paired historical and newer workbooks. Reconstruction cleans worksheet data, derives time windows, interpolates values, and exports CSV and charted Excel results. The scripts are excerpted; the README contains no substantive capability description, so the graph reflects only behavior visible in those scripts.

Main entry points: [`reconstruct_water_level.py`](https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py) (Reconstruction Runner), [`analyze_water_level.py`](https://github.com/qihahfirhat/water-level-prediction/blob/main/analyze_water_level.py) (Plotting Runner), [`water_level.xlsx`](https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level.xlsx) (Historical Workbook), [`water_level_Sept.xlsx`](https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level_Sept.xlsx) (New Workbook)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Workbook Inputs"]
  node_historical["Historical Workbook<br/>[water_level.xlsx]"]
  node_newer["New Workbook"]
end

subgraph group_reconstruct["Reconstruction"]
  node_reconstructor["Reconstruction Runner"]
  node_sheet_cleaning["Sheet Cleaning"]
  node_time_windows["Time Windowing"]
  node_interpolation["PCHIP Estimates"]
  node_csv_output["CSV Worksheets"]
  node_excel_output["Charted Workbook"]
end

subgraph group_analysis["Plotting"]
  node_plot_runner["Plotting Runner"]
  node_plots["Per-Sheet Graphs"]
end

node_user(("User"))

node_user -.->|"runs"| node_reconstructor
node_historical -->|"read by"| node_reconstructor
node_newer -->|"read by"| node_reconstructor
node_reconstructor -->|"cleans sheets"| node_sheet_cleaning
node_reconstructor -->|"sets ranges"| node_time_windows
node_reconstructor -->|"computes estimates"| node_interpolation
node_reconstructor -->|"writes CSV"| node_csv_output
node_reconstructor -->|"writes charts"| node_excel_output
node_user -.->|"runs"| node_plot_runner
node_historical -->|"read by"| node_plot_runner
node_plot_runner -->|"saves graphs"| node_plots

click node_historical "https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level.xlsx"
click node_newer "https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level_Sept.xlsx"
click node_reconstructor "https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py"
click node_sheet_cleaning "https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py"
click node_time_windows "https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py"
click node_interpolation "https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py"
click node_csv_output "https://github.com/qihahfirhat/water-level-prediction/tree/main/water_level_output3/csv"
click node_excel_output "https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level_output3/reconstructed_water_levels.xlsx"
click node_plot_runner "https://github.com/qihahfirhat/water-level-prediction/blob/main/analyze_water_level.py"
click node_plots "https://github.com/qihahfirhat/water-level-prediction/tree/main/graphs"

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_historical,node_newer,node_user toneBlue
class node_reconstructor,node_sheet_cleaning,node_time_windows,node_interpolation,node_csv_output,node_excel_output toneAmber
class node_plot_runner,node_plots toneMint
```

## Components

### Workbook Inputs

- [Historical Workbook](https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level.xlsx): `water_level.xlsx`
- [New Workbook](https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level_Sept.xlsx): `water_level_Sept.xlsx`

### Reconstruction

- [Reconstruction Runner](https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py): `reconstruct_water_level.py`
- [Sheet Cleaning](https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py): `reconstruct_water_level.py`
- [Time Windowing](https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py): `reconstruct_water_level.py`
- [PCHIP Estimates](https://github.com/qihahfirhat/water-level-prediction/blob/main/reconstruct_water_level.py): `reconstruct_water_level.py`
- [CSV Worksheets](https://github.com/qihahfirhat/water-level-prediction/tree/main/water_level_output3/csv): `water_level_output3/csv`
- [Charted Workbook](https://github.com/qihahfirhat/water-level-prediction/blob/main/water_level_output3/reconstructed_water_levels.xlsx): `water_level_output3/reconstructed_water_levels.xlsx`

### Plotting

- [Plotting Runner](https://github.com/qihahfirhat/water-level-prediction/blob/main/analyze_water_level.py): `analyze_water_level.py`
- [Per-Sheet Graphs](https://github.com/qihahfirhat/water-level-prediction/tree/main/graphs): `graphs`

### Other components

- **User**

## Connections

- User → Reconstruction Runner: runs
- Historical Workbook → Reconstruction Runner: read by (evidence: `reconstruct_water_level.py`)
- New Workbook → Reconstruction Runner: read by (evidence: `reconstruct_water_level.py`)
- Reconstruction Runner → Sheet Cleaning: cleans sheets (evidence: `reconstruct_water_level.py`)
- Reconstruction Runner → Time Windowing: sets ranges (evidence: `reconstruct_water_level.py`)
- Reconstruction Runner → PCHIP Estimates: computes estimates (evidence: `reconstruct_water_level.py`)
- Reconstruction Runner → CSV Worksheets: writes CSV (evidence: `reconstruct_water_level.py`)
- Reconstruction Runner → Charted Workbook: writes charts (evidence: `reconstruct_water_level.py`)
- User → Plotting Runner: runs
- Historical Workbook → Plotting Runner: read by (evidence: `analyze_water_level.py`)
- Plotting Runner → Per-Sheet Graphs: saves graphs (evidence: `analyze_water_level.py`)
