# billynunn/glacshad architecture

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

- Interactive diagram: https://gitdiagram.com/billynunn/glacshad
- Repository: https://github.com/billynunn/glacshad

## Overview

GlacShad is a Python model for estimating how terrain shading affects glacier surface mass balance. The documented workflow starts with a user calling `model.run` for a glacier and date range; the model loads and crops elevation data, computes solar position and terrain shading, and derives four comparison products. The excerpts show the main orchestration and data-preparation calls, but do not show the final raster-writing step, so the result node reflects README documentation rather than a verified implementation detail.

Main entry points: [`core/model.py`](https://github.com/billynunn/glacshad/blob/main/core/model.py) (Run model), [`core/dem.py`](https://github.com/billynunn/glacshad/blob/main/core/dem.py) (DEM load and crop), [`core/solar.py`](https://github.com/billynunn/glacshad/blob/main/core/solar.py) (Solar and terrain calculations), [`core/rgi.py`](https://github.com/billynunn/glacshad/blob/main/core/rgi.py) (Glacier RGI data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Model workflow"]
  node_runner["Run model<br/>[model.py]"]
  node_products["Four raster products<br/>[model.py]"]
end

subgraph group_inputs["Glacier inputs"]
  node_dem["DEM load and crop<br/>[dem.py]"]
  node_rgi["Glacier RGI data<br/>[rgi.py]"]
end

subgraph group_physics["Terrain and solar"]
  node_solar["Solar and terrain calculations<br/>[solar.py]"]
end

node_user(("Python user"))

node_user -->|"calls"| node_runner
node_runner -->|"loads and crops"| node_dem
node_dem -->|"loads glacier shape"| node_rgi
node_runner -->|"computes shading"| node_solar
node_solar -->|"gets glacier coordinates"| node_rgi
node_runner -->|"produces"| node_products

click node_runner "https://github.com/billynunn/glacshad/blob/main/core/model.py"
click node_products "https://github.com/billynunn/glacshad/blob/main/core/model.py"
click node_dem "https://github.com/billynunn/glacshad/blob/main/core/dem.py"
click node_rgi "https://github.com/billynunn/glacshad/blob/main/core/rgi.py"
click node_solar "https://github.com/billynunn/glacshad/blob/main/core/solar.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_runner,node_products,node_user toneBlue
class node_dem,node_rgi toneAmber
class node_solar toneMint
```

## Components

### Model workflow

- [Run model](https://github.com/billynunn/glacshad/blob/main/core/model.py): `core/model.py`
- [Four raster products](https://github.com/billynunn/glacshad/blob/main/core/model.py): `core/model.py`

### Glacier inputs

- [DEM load and crop](https://github.com/billynunn/glacshad/blob/main/core/dem.py): `core/dem.py`
- [Glacier RGI data](https://github.com/billynunn/glacshad/blob/main/core/rgi.py): `core/rgi.py`

### Terrain and solar

- [Solar and terrain calculations](https://github.com/billynunn/glacshad/blob/main/core/solar.py): `core/solar.py`

### Other components

- **Python user**

## Connections

- Python user → Run model: calls (evidence: `README.md`)
- Run model → DEM load and crop: loads and crops (evidence: `core/model.py`)
- DEM load and crop → Glacier RGI data: loads glacier shape (evidence: `core/dem.py`)
- Run model → Solar and terrain calculations: computes shading (evidence: `core/model.py`)
- Solar and terrain calculations → Glacier RGI data: gets glacier coordinates (evidence: `core/solar.py`)
- Run model → Four raster products: produces (evidence: `README.md`)
