# dhusyanth14/forest-fire-uav architecture

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

- Interactive diagram: https://gitdiagram.com/dhusyanth14/forest-fire-uav
- Repository: https://github.com/dhusyanth14/forest-fire-uav

## Overview

Forest fire identification, detection, prediction, and quenching simulation. The principal workflow builds terrain and changing weather/fuel conditions, produces IoT risk maps and UAV patrols, simulates a hidden fire during camera passes, detects and stitches thermal observations, predicts spread from detected cells, then plans and evaluates a retardant wall. The pipeline is the orchestration layer. Relationships are grounded in the README workflow and the pipeline/source-index references; sampled excerpts are partial, so unsampled internal calls are not inferred beyond those sources.

Main entry points: [`forestfire/pipeline.py`](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/pipeline.py) (Run Orchestrator), [`forestfire/plot_style.py`](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/plot_style.py) (Shared Plot Styling), [`forestfire/collect.py`](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/collect.py) (Camera Pass Collection), [`forestfire/fire_model.py`](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/fire_model.py) (Fire Spread Model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_environment["Environment"]
  node_terrain["Terrain and Fuel<br/>[forest_env.py]"]
  node_weather["Weather and Dryness<br/>[env_dynamics.py]"]
end

subgraph group_surveillance["Sensing and Patrol"]
  node_risk["IoT Risk Mapping<br/>[stage1_iot.py]"]
  node_patrol["UAV Patrol Planner<br/>[uav_planner.py]"]
  node_griddata["Grid Imagery and Temperatures<br/>[grid_data.py]"]
  node_collection["Camera Pass Collection<br/>[collect.py]"]
  node_detection["Thermal Fire Detection<br/>[detect.py]"]
end

subgraph group_response["Fire Response"]
  node_spread["Fire Spread Model<br/>[fire_model.py]"]
  node_quenching["Wall and Fleet Planning<br/>[quench.py]"]
end

subgraph group_runtime["Pipeline and Support"]
  node_pipeline["Run Orchestrator<br/>[pipeline.py]"]
  node_plotting["Shared Plot Styling<br/>[plot_style.py]"]
end

node_operator(("CLI Operator"))

node_operator -->|"starts run"| node_pipeline
node_pipeline -->|"uses terrain"| node_terrain
node_pipeline -->|"uses conditions"| node_weather
node_pipeline -->|"runs sensing"| node_risk
node_pipeline -->|"plans patrol"| node_patrol
node_pipeline -->|"prepares grids"| node_griddata
node_pipeline -->|"collects passes"| node_collection
node_pipeline -->|"runs detection"| node_detection
node_pipeline -->|"runs simulation"| node_spread
node_pipeline -->|"plans response"| node_quenching
node_risk -->|"uses conditions"| node_weather
node_weather -->|"uses fuel map"| node_terrain
node_patrol -->|"uses terrain"| node_terrain
node_collection -->|"reads flight trace"| node_patrol
node_collection -->|"uses grid data"| node_griddata
node_collection -->|"overlays true fire"| node_spread
node_detection -->|"scans pass workbooks"| node_collection
node_spread -->|"uses fuel and elevation"| node_terrain
node_quenching -->|"evaluates barriers"| node_spread
node_pipeline -->|"uses plotting helpers"| node_plotting
node_terrain -->|"uses plot style"| node_plotting
node_weather -->|"uses plot style"| node_plotting
node_risk -->|"uses plot style"| node_plotting
node_patrol -->|"uses plot style"| node_plotting
node_spread -->|"uses plot style"| node_plotting
node_quenching -->|"uses plot style"| node_plotting

click node_pipeline "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/pipeline.py"
click node_terrain "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/forest_env.py"
click node_weather "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/env_dynamics.py"
click node_risk "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/stage1_iot.py"
click node_patrol "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/uav_planner.py"
click node_griddata "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/grid_data.py"
click node_collection "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/collect.py"
click node_detection "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/detect.py"
click node_spread "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/fire_model.py"
click node_quenching "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/quench.py"
click node_plotting "https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/plot_style.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_terrain,node_weather toneBlue
class node_risk,node_patrol,node_griddata,node_collection,node_detection toneAmber
class node_spread,node_quenching toneMint
class node_pipeline,node_plotting toneRose
class node_operator toneIndigo
```

## Components

### Environment

- [Terrain and Fuel](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/forest_env.py): `forestfire/forest_env.py`
- [Weather and Dryness](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/env_dynamics.py): `forestfire/env_dynamics.py`

### Sensing and Patrol

- [IoT Risk Mapping](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/stage1_iot.py): `forestfire/stage1_iot.py`
- [UAV Patrol Planner](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/uav_planner.py): `forestfire/uav_planner.py`
- [Grid Imagery and Temperatures](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/grid_data.py): `forestfire/grid_data.py`
- [Camera Pass Collection](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/collect.py): `forestfire/collect.py`
- [Thermal Fire Detection](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/detect.py): `forestfire/detect.py`

### Fire Response

- [Fire Spread Model](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/fire_model.py): `forestfire/fire_model.py`
- [Wall and Fleet Planning](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/quench.py): `forestfire/quench.py`

### Pipeline and Support

- [Run Orchestrator](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/pipeline.py): `forestfire/pipeline.py`
- [Shared Plot Styling](https://github.com/dhusyanth14/forest-fire-uav/blob/main/forestfire/plot_style.py): `forestfire/plot_style.py`

### Other components

- **CLI Operator**

## Connections

- CLI Operator → Run Orchestrator: starts run
- Run Orchestrator → Terrain and Fuel: uses terrain (evidence: `forestfire/pipeline.py`)
- Run Orchestrator → Weather and Dryness: uses conditions (evidence: `forestfire/pipeline.py`)
- Run Orchestrator → IoT Risk Mapping: runs sensing (evidence: `README.md`)
- Run Orchestrator → UAV Patrol Planner: plans patrol (evidence: `forestfire/pipeline.py`)
- Run Orchestrator → Grid Imagery and Temperatures: prepares grids (evidence: `README.md`)
- Run Orchestrator → Camera Pass Collection: collects passes (evidence: `README.md`)
- Run Orchestrator → Thermal Fire Detection: runs detection (evidence: `README.md`)
- Run Orchestrator → Fire Spread Model: runs simulation (evidence: `forestfire/pipeline.py`)
- Run Orchestrator → Wall and Fleet Planning: plans response (evidence: `README.md`)
- IoT Risk Mapping → Weather and Dryness: uses conditions (evidence: `forestfire/stage1_iot.py`)
- Weather and Dryness → Terrain and Fuel: uses fuel map (evidence: `forestfire/env_dynamics.py`)
- UAV Patrol Planner → Terrain and Fuel: uses terrain (evidence: `forestfire/uav_planner.py`)
- Camera Pass Collection → UAV Patrol Planner: reads flight trace (evidence: `forestfire/collect.py`)
- Camera Pass Collection → Grid Imagery and Temperatures: uses grid data (evidence: `forestfire/collect.py`)
- Camera Pass Collection → Fire Spread Model: overlays true fire (evidence: `README.md`)
- Thermal Fire Detection → Camera Pass Collection: scans pass workbooks (evidence: `README.md`)
- Fire Spread Model → Terrain and Fuel: uses fuel and elevation (evidence: `forestfire/fire_model.py`)
- Wall and Fleet Planning → Fire Spread Model: evaluates barriers (evidence: `README.md`)
- Run Orchestrator → Shared Plot Styling: uses plotting helpers (evidence: `forestfire/pipeline.py`)
- Terrain and Fuel → Shared Plot Styling: uses plot style (evidence: `forestfire/forest_env.py`)
- Weather and Dryness → Shared Plot Styling: uses plot style (evidence: `forestfire/env_dynamics.py`)
- IoT Risk Mapping → Shared Plot Styling: uses plot style (evidence: `forestfire/stage1_iot.py`)
- UAV Patrol Planner → Shared Plot Styling: uses plot style (evidence: `forestfire/uav_planner.py`)
- Fire Spread Model → Shared Plot Styling: uses plot style (evidence: `forestfire/fire_model.py`)
- Wall and Fleet Planning → Shared Plot Styling: uses plot style (evidence: `forestfire/quench.py`)
