# soberana-sensing/soberana-cube architecture

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

- Interactive diagram: https://gitdiagram.com/soberana-sensing/soberana-cube
- Repository: https://github.com/soberana-sensing/soberana-cube

## Overview

soberana-cube prepares raster datasets for spatial analysis, aligning openEO collections, remote COGs, and local rasters to a shared AOI grid. Its main workflow is configuration and planning, source acquisition or ingestion, then product materialization and registry updates; users access results through Python, CLI reports, maps, tables, and time-series views. The graph includes documented modeling and browser capabilities. Some links reflect explicit README behavior or source-index references; unsampled implementation details are not inferred as certain calls.

Main entry points: [`soberana_cube/cube.py`](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cube.py) (Cube and modeling API), [`soberana_cube/pipeline.py`](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/pipeline.py) (Plan and run), [`soberana_cube/cli.py`](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cli.py) (CLI commands), [`soberana_cube/registry.py`](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/registry.py) (Source registry)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Configuration and control"]
  node_cli["CLI commands<br/>[cli.py]"]
  node_config["Config loader<br/>[config.py]"]
  node_pipeline["Plan and run<br/>[pipeline.py]"]
  node_checks["Source checks<br/>[check.py]"]
end

subgraph group_sources["Source acquisition"]
  node_openeo{{"openEO service"}}
  node_fetch["openEO jobs<br/>[fetch.py]"]
  node_engine["Process graphs<br/>[engine.py]"]
  node_remote["Remote COG reader<br/>[remote.py]"]
  node_ingest["Local raster ingest<br/>[ingest.py]"]
  node_registry[("Source registry<br/>[registry.py]")]
end

subgraph group_processing["Spatial processing"]
  node_grid["AOI master grid<br/>[grid.py]"]
  node_formula["Index formulas<br/>[formula.py]"]
  node_derive["Local index derivation<br/>[derive.py]"]
  node_materialize["Product materializer<br/>[materialize.py]"]
  node_products[("Materialized raster products<br/>[materialize.py]")]
end

subgraph group_access["Data access and outputs"]
  node_cube["Cube and modeling API<br/>[cube.py]"]
  node_report["Status and reports<br/>[report.py]"]
  node_viewer["Map and series views<br/>[viewer.py]"]
  node_app["Browser interface<br/>[app.py]"]
  node_tables["Tables and pixel queries<br/>[cube.py]"]
end

node_user(("Project user"))

node_user -->|"runs commands"| node_cli
node_cli -->|"loads config"| node_config
node_cli -->|"plans or runs"| node_pipeline
node_cli -->|"queries data"| node_cube
node_cli -->|"requests reports"| node_report
node_cli -->|"requests views"| node_viewer
node_pipeline -->|"checks sources"| node_checks
node_pipeline -->|"runs jobs"| node_fetch
node_pipeline -->|"reads COG windows"| node_remote
node_pipeline -->|"ingests files"| node_ingest
node_pipeline -->|"builds products"| node_materialize
node_fetch -->|"builds graph"| node_engine
node_fetch -->|"submits jobs"| node_openeo
node_fetch -->|"records source"| node_registry
node_engine -->|"builds indices"| node_formula
node_remote -->|"reprojects data"| node_grid
node_remote -->|"records source"| node_registry
node_ingest -->|"clips and reprojects"| node_grid
node_ingest -->|"records source"| node_registry
node_materialize -->|"reads source path"| node_registry
node_materialize -->|"aligns products"| node_grid
node_materialize -->|"derives indices"| node_derive
node_derive -->|"evaluates formulas"| node_formula
node_materialize -->|"writes products"| node_products
node_cube -->|"uses settings"| node_config
node_cube -->|"resolves sources"| node_registry
node_cube -->|"opens products"| node_products
node_cube -->|"queries grid cells"| node_grid
node_report -->|"summarizes plan"| node_pipeline
node_report -->|"reads metadata"| node_registry
node_viewer -.->|"reads fields"| node_cube
node_user -.->|"browses data"| node_app
node_app -.->|"uses data API"| node_cube
node_cube -->|"exports tables"| node_tables

click node_cli "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cli.py"
click node_config "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/config.py"
click node_pipeline "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/pipeline.py"
click node_checks "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/check.py"
click node_fetch "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/fetch.py"
click node_engine "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/engine.py"
click node_remote "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/remote.py"
click node_ingest "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/ingest.py"
click node_registry "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/registry.py"
click node_grid "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/grid.py"
click node_formula "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/formula.py"
click node_derive "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/derive.py"
click node_materialize "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/materialize.py"
click node_products "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/materialize.py"
click node_cube "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cube.py"
click node_report "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/report.py"
click node_viewer "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/viewer.py"
click node_app "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/app.py"
click node_tables "https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cube.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_cli,node_config,node_pipeline,node_checks,node_user toneBlue
class node_openeo,node_fetch,node_engine,node_remote,node_ingest,node_registry toneAmber
class node_grid,node_formula,node_derive,node_materialize,node_products toneMint
class node_cube,node_report,node_viewer,node_app,node_tables toneRose
```

## Components

### Configuration and control

- [CLI commands](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cli.py): `soberana_cube/cli.py`
- [Config loader](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/config.py): `soberana_cube/config.py`
- [Plan and run](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/pipeline.py): `soberana_cube/pipeline.py`
- [Source checks](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/check.py): `soberana_cube/check.py`

### Source acquisition

- **openEO service**
- [openEO jobs](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/fetch.py): `soberana_cube/fetch.py`
- [Process graphs](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/engine.py): `soberana_cube/engine.py`
- [Remote COG reader](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/remote.py): `soberana_cube/remote.py`
- [Local raster ingest](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/ingest.py): `soberana_cube/ingest.py`
- [Source registry](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/registry.py): `soberana_cube/registry.py`

### Spatial processing

- [AOI master grid](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/grid.py): `soberana_cube/grid.py`
- [Index formulas](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/formula.py): `soberana_cube/formula.py`
- [Local index derivation](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/derive.py): `soberana_cube/derive.py`
- [Product materializer](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/materialize.py): `soberana_cube/materialize.py`
- [Materialized raster products](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/materialize.py): `soberana_cube/materialize.py`

### Data access and outputs

- [Cube and modeling API](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cube.py): `soberana_cube/cube.py`
- [Status and reports](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/report.py): `soberana_cube/report.py`
- [Map and series views](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/viewer.py): `soberana_cube/viewer.py`
- [Browser interface](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/app.py): `soberana_cube/app.py`
- [Tables and pixel queries](https://github.com/soberana-sensing/soberana-cube/blob/main/soberana_cube/cube.py): `soberana_cube/cube.py`

### Other components

- **Project user**

## Connections

- Project user → CLI commands: runs commands (evidence: `README.md`)
- CLI commands → Config loader: loads config (evidence: `soberana_cube/cli.py`)
- CLI commands → Plan and run: plans or runs (evidence: `soberana_cube/cli.py`)
- CLI commands → Cube and modeling API: queries data (evidence: `soberana_cube/cli.py`)
- CLI commands → Status and reports: requests reports (evidence: `soberana_cube/cli.py`)
- CLI commands → Map and series views: requests views (evidence: `soberana_cube/cli.py`)
- Plan and run → Source checks: checks sources (evidence: `soberana_cube/pipeline.py`)
- Plan and run → openEO jobs: runs jobs (evidence: `soberana_cube/pipeline.py`)
- Plan and run → Remote COG reader: reads COG windows (evidence: `soberana_cube/pipeline.py`)
- Plan and run → Local raster ingest: ingests files (evidence: `soberana_cube/pipeline.py`)
- Plan and run → Product materializer: builds products (evidence: `soberana_cube/pipeline.py`)
- openEO jobs → Process graphs: builds graph (evidence: `soberana_cube/fetch.py`)
- openEO jobs → openEO service: submits jobs (evidence: `soberana_cube/fetch.py`)
- openEO jobs → Source registry: records source (evidence: `soberana_cube/fetch.py`)
- Process graphs → Index formulas: builds indices (evidence: `soberana_cube/engine.py`)
- Remote COG reader → AOI master grid: reprojects data (evidence: `soberana_cube/remote.py`)
- Remote COG reader → Source registry: records source (evidence: `soberana_cube/remote.py`)
- Local raster ingest → AOI master grid: clips and reprojects (evidence: `soberana_cube/ingest.py`)
- Local raster ingest → Source registry: records source (evidence: `soberana_cube/ingest.py`)
- Product materializer → Source registry: reads source path (evidence: `soberana_cube/materialize.py`)
- Product materializer → AOI master grid: aligns products (evidence: `soberana_cube/materialize.py`)
- Product materializer → Local index derivation: derives indices (evidence: `soberana_cube/materialize.py`)
- Local index derivation → Index formulas: evaluates formulas (evidence: `soberana_cube/derive.py`)
- Product materializer → Materialized raster products: writes products (evidence: `soberana_cube/materialize.py`)
- Cube and modeling API → Config loader: uses settings (evidence: `soberana_cube/cube.py`)
- Cube and modeling API → Source registry: resolves sources (evidence: `soberana_cube/cube.py`)
- Cube and modeling API → Materialized raster products: opens products (evidence: `soberana_cube/cube.py`)
- Cube and modeling API → AOI master grid: queries grid cells (evidence: `soberana_cube/cube.py`)
- Status and reports → Plan and run: summarizes plan (evidence: `soberana_cube/report.py`)
- Status and reports → Source registry: reads metadata (evidence: `soberana_cube/report.py`)
- Map and series views → Cube and modeling API: reads fields
- Project user → Browser interface: browses data (evidence: `README.md`)
- Browser interface → Cube and modeling API: uses data API
- Cube and modeling API → Tables and pixel queries: exports tables (evidence: `README.md`)
