# jandrewjohnson/seals architecture

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

- Interactive diagram: https://gitdiagram.com/jandrewjohnson/seals
- Repository: https://github.com/jandrewjohnson/seals

## Overview

SEALS turns coarse or regional land-use projections into fine-resolution land-cover maps for a project area. The principal workflow is to start a reference run, initialize project inputs and a task tree, prepare baseline data and coarse changes, calibrate and allocate change at fine resolution, then generate visualizations. The graph also retains the documented API-parsing capability and indexed legacy modules. Relationships are limited to README statements and shown references or task registrations; unsampled implementation details are not inferred.

Main entry points: [`seals/seals_initialize_project.py`](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_initialize_project.py) (Project initializer), [`seals/seals_utils.py`](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_utils.py) (Spatial utilities), [`seals/seals_process_coarse_timeseries.py`](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_process_coarse_timeseries.py) (Coarse change), [`seals/seals_main.py`](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_main.py) (Allocation model)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_entry["Run setup"]
  node_runner["Reference run<br/>[run_seals.py]"]
  node_initializer["Project initializer"]
  node_config["Model configuration<br/>[config.py]"]
  node_api["API parsing"]
  node_project["Project task tree"]
end

subgraph group_inputs["Spatial inputs"]
  node_aoi["AOI preparation<br/>[seals_tasks.py]"]
  node_base["Base data"]
  node_preprocess["Fine data prep"]
  node_coarse["Coarse change"]
end

subgraph group_model["Downscaling"]
  node_downscale["Allocation model<br/>[seals_main.py]"]
  node_utilities["Spatial utilities<br/>[seals_utils.py]"]
  node_cython["Compiled functions"]
end

subgraph group_outputs["Results and legacy"]
  node_viztasks["Visualization tasks"]
  node_vizfunc["Plot functions"]
  node_ecosystem["Ecosystem services"]
  node_bonn["Bonn coupling run<br/>[run_seals_bonn.py]"]
  node_cgebox["CGEBox coupling run"]
end

node_user(("Model user"))

node_user -->|"starts"| node_runner
node_runner -->|"runs project"| node_initializer
node_initializer -->|"builds tasks"| node_project
node_initializer -->|"uses settings"| node_config
node_initializer -->|"registers"| node_aoi
node_initializer -->|"registers"| node_base
node_initializer -->|"registers"| node_preprocess
node_initializer -->|"registers"| node_coarse
node_initializer -->|"registers"| node_downscale
node_initializer -->|"registers"| node_viztasks
node_aoi -->|"uses helpers"| node_utilities
node_preprocess -->|"uses helpers"| node_utilities
node_coarse -->|"uses helpers"| node_utilities
node_coarse -->|"uses settings"| node_config
node_downscale -->|"uses helpers"| node_utilities
node_downscale -->|"uses plots"| node_vizfunc
node_utilities -->|"calls compiled code"| node_cython
node_viztasks -->|"uses plots"| node_vizfunc
node_ecosystem -->|"imports helpers"| node_utilities
node_bonn -->|"builds task tree"| node_project
node_bonn -->|"registers tasks"| node_preprocess
node_bonn -->|"registers tasks"| node_coarse
node_bonn -->|"registers tasks"| node_downscale
node_cgebox -->|"builds task tree"| node_project
node_cgebox -->|"registers tasks"| node_preprocess
node_cgebox -->|"registers tasks"| node_coarse
node_cgebox -->|"registers tasks"| node_downscale

click node_runner "https://github.com/jandrewjohnson/seals/blob/main/seals/run_seals.py"
click node_initializer "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_initialize_project.py"
click node_config "https://github.com/jandrewjohnson/seals/blob/main/seals/config.py"
click node_api "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_api_parsing.py"
click node_project "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_initialize_project.py"
click node_aoi "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_tasks.py"
click node_base "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_process_coarse_timeseries.py"
click node_preprocess "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_generate_base_data.py"
click node_coarse "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_process_coarse_timeseries.py"
click node_downscale "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_main.py"
click node_utilities "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_utils.py"
click node_cython "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_cython_functions.pyx"
click node_viztasks "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_visualization_tasks.py"
click node_vizfunc "https://github.com/jandrewjohnson/seals/blob/main/seals/seals_visualization_functions.py"
click node_ecosystem "https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/ecosystem_services.py"
click node_bonn "https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/run_seals_bonn.py"
click node_cgebox "https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/run_seals_cgebox.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_initializer,node_config,node_api,node_project,node_user toneBlue
class node_aoi,node_base,node_preprocess,node_coarse toneAmber
class node_downscale,node_utilities,node_cython toneMint
class node_viztasks,node_vizfunc,node_ecosystem,node_bonn,node_cgebox toneRose
```

## Components

### Run setup

- [Reference run](https://github.com/jandrewjohnson/seals/blob/main/seals/run_seals.py): `seals/run_seals.py`
- [Project initializer](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_initialize_project.py): `seals/seals_initialize_project.py`
- [Model configuration](https://github.com/jandrewjohnson/seals/blob/main/seals/config.py): `seals/config.py`
- [API parsing](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_api_parsing.py): `seals/seals_api_parsing.py`
- [Project task tree](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_initialize_project.py): `seals/seals_initialize_project.py`

### Spatial inputs

- [AOI preparation](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_tasks.py): `seals/seals_tasks.py`
- [Base data](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_process_coarse_timeseries.py): `seals/seals_process_coarse_timeseries.py`
- [Fine data prep](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_generate_base_data.py): `seals/seals_generate_base_data.py`
- [Coarse change](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_process_coarse_timeseries.py): `seals/seals_process_coarse_timeseries.py`

### Downscaling

- [Allocation model](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_main.py): `seals/seals_main.py`
- [Spatial utilities](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_utils.py): `seals/seals_utils.py`
- [Compiled functions](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_cython_functions.pyx): `seals/seals_cython_functions.pyx`

### Results and legacy

- [Visualization tasks](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_visualization_tasks.py): `seals/seals_visualization_tasks.py`
- [Plot functions](https://github.com/jandrewjohnson/seals/blob/main/seals/seals_visualization_functions.py): `seals/seals_visualization_functions.py`
- [Ecosystem services](https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/ecosystem_services.py): `seals/old_run_files/ecosystem_services.py`
- [Bonn coupling run](https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/run_seals_bonn.py): `seals/old_run_files/run_seals_bonn.py`
- [CGEBox coupling run](https://github.com/jandrewjohnson/seals/blob/main/seals/old_run_files/run_seals_cgebox.py): `seals/old_run_files/run_seals_cgebox.py`

### Other components

- **Model user**

## Connections

- Model user → Reference run: starts (evidence: `README.md`)
- Reference run → Project initializer: runs project (evidence: `seals/run_seals.py`)
- Project initializer → Project task tree: builds tasks (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Model configuration: uses settings (evidence: `seals/seals_initialize_project.py`)
- Project initializer → AOI preparation: registers (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Base data: registers (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Fine data prep: registers (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Coarse change: registers (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Allocation model: registers (evidence: `seals/seals_initialize_project.py`)
- Project initializer → Visualization tasks: registers (evidence: `seals/seals_initialize_project.py`)
- AOI preparation → Spatial utilities: uses helpers (evidence: `seals/seals_tasks.py`)
- Fine data prep → Spatial utilities: uses helpers (evidence: `seals/seals_generate_base_data.py`)
- Coarse change → Spatial utilities: uses helpers (evidence: `seals/seals_process_coarse_timeseries.py`)
- Coarse change → Model configuration: uses settings (evidence: `seals/seals_process_coarse_timeseries.py`)
- Allocation model → Spatial utilities: uses helpers (evidence: `seals/seals_main.py`)
- Allocation model → Plot functions: uses plots (evidence: `seals/seals_main.py`)
- Spatial utilities → Compiled functions: calls compiled code (evidence: `seals/seals_utils.py`)
- Visualization tasks → Plot functions: uses plots (evidence: `seals/seals_visualization_tasks.py`)
- Ecosystem services → Spatial utilities: imports helpers (evidence: `seals/old_run_files/ecosystem_services.py`)
- Bonn coupling run → Project task tree: builds task tree (evidence: `seals/old_run_files/run_seals_bonn.py`)
- Bonn coupling run → Fine data prep: registers tasks (evidence: `seals/old_run_files/run_seals_bonn.py`)
- Bonn coupling run → Coarse change: registers tasks (evidence: `seals/old_run_files/run_seals_bonn.py`)
- Bonn coupling run → Allocation model: registers tasks (evidence: `seals/old_run_files/run_seals_bonn.py`)
- CGEBox coupling run → Project task tree: builds task tree (evidence: `seals/old_run_files/run_seals_cgebox.py`)
- CGEBox coupling run → Fine data prep: registers tasks (evidence: `seals/old_run_files/run_seals_cgebox.py`)
- CGEBox coupling run → Coarse change: registers tasks (evidence: `seals/old_run_files/run_seals_cgebox.py`)
- CGEBox coupling run → Allocation model: registers tasks (evidence: `seals/old_run_files/run_seals_cgebox.py`)
