# japq91/uncert_cmip architecture

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

- Interactive diagram: https://gitdiagram.com/japq91/uncert_cmip
- Repository: https://github.com/japq91/uncert_cmip

## Overview

This repository is a CMIP6 climate-projection analysis workflow for South America, with emphasis on Peru. Users select a climate variable and season; the analysis reads model/SSP NetCDF series, calculates anomalies and the SU, MU, and VI uncertainty components, then derives signal-to-noise and Time of Emergence (TOE). A plotting stage turns those results into TOE maps and Peru uncertainty-fraction figures. A separate script plots model time series by scenario. The README documents a shell-driven workflow, but its implementation was not sampled; edges reflect only documented or excerpted relationships.

Main entry points: [`02_grafica.py`](https://github.com/japq91/uncert_cmip/blob/main/02_grafica.py) (TOE maps), [`01_uncertainty.py`](https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py) (Uncertainty analysis), [`03_series_modelos.py`](https://github.com/japq91/uncert_cmip/blob/main/03_series_modelos.py) (Model time series), [`data`](https://github.com/japq91/uncert_cmip/tree/main/data) (Climate NetCDF)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_analysis["Climate analysis"]
  node_uncertainty["Uncertainty analysis<br/>[01_uncertainty.py]"]
  node_components["SU MU VI<br/>[01_uncertainty.py]"]
  node_emergence["STN and TOE<br/>[01_uncertainty.py]"]
end

subgraph group_visualization["Visualization"]
  node_maps["TOE maps<br/>[02_grafica.py]"]
  node_fractions["Peru fractions<br/>[02_grafica.py]"]
  node_model_series["Model time series"]
end

subgraph group_inputs["Inputs and results"]
  node_climate_data[("Climate NetCDF")]
  node_results[("Analysis NetCDF")]
  node_shapefiles[("Regional borders")]
  node_figures["Figures"]
end

node_user(("Analyst"))

node_user -->|"selects inputs"| node_uncertainty
node_climate_data -->|"provides series"| node_uncertainty
node_uncertainty -->|"calculates"| node_components
node_components -->|"derives STN TOE"| node_emergence
node_emergence -->|"writes NetCDF"| node_results
node_user -->|"selects results"| node_maps
node_results -->|"reads TOE"| node_maps
node_results -->|"reads components"| node_fractions
node_shapefiles -->|"draws borders"| node_maps
node_maps -->|"saves maps"| node_figures
node_fractions -->|"saves plot"| node_figures
node_user -->|"selects inputs"| node_model_series
node_climate_data -->|"provides series"| node_model_series
node_model_series -->|"saves plots"| node_figures

click node_climate_data "https://github.com/japq91/uncert_cmip/tree/main/data"
click node_uncertainty "https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py"
click node_components "https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py"
click node_emergence "https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py"
click node_maps "https://github.com/japq91/uncert_cmip/blob/main/02_grafica.py"
click node_fractions "https://github.com/japq91/uncert_cmip/blob/main/02_grafica.py"
click node_shapefiles "https://github.com/japq91/uncert_cmip/tree/main/shape"
click node_model_series "https://github.com/japq91/uncert_cmip/blob/main/03_series_modelos.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_uncertainty,node_components,node_emergence toneBlue
class node_maps,node_fractions,node_model_series toneAmber
class node_climate_data,node_results,node_shapefiles,node_figures toneMint
class node_user toneIndigo
```

## Components

### Climate analysis

- [Uncertainty analysis](https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py): `01_uncertainty.py`
- [SU MU VI](https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py): `01_uncertainty.py`
- [STN and TOE](https://github.com/japq91/uncert_cmip/blob/main/01_uncertainty.py): `01_uncertainty.py`

### Visualization

- [TOE maps](https://github.com/japq91/uncert_cmip/blob/main/02_grafica.py): `02_grafica.py`
- [Peru fractions](https://github.com/japq91/uncert_cmip/blob/main/02_grafica.py): `02_grafica.py`
- [Model time series](https://github.com/japq91/uncert_cmip/blob/main/03_series_modelos.py): `03_series_modelos.py`

### Inputs and results

- [Climate NetCDF](https://github.com/japq91/uncert_cmip/tree/main/data): `data`
- **Analysis NetCDF**
- [Regional borders](https://github.com/japq91/uncert_cmip/tree/main/shape): `shape`
- **Figures**

### Other components

- **Analyst**

## Connections

- Analyst → Uncertainty analysis: selects inputs (evidence: `README.md`)
- Climate NetCDF → Uncertainty analysis: provides series (evidence: `README.md`)
- Uncertainty analysis → SU MU VI: calculates (evidence: `01_uncertainty.py`)
- SU MU VI → STN and TOE: derives STN TOE (evidence: `01_uncertainty.py`)
- STN and TOE → Analysis NetCDF: writes NetCDF (evidence: `01_uncertainty.py`)
- Analyst → TOE maps: selects results (evidence: `README.md`)
- Analysis NetCDF → TOE maps: reads TOE (evidence: `02_grafica.py`)
- Analysis NetCDF → Peru fractions: reads components (evidence: `02_grafica.py`)
- Regional borders → TOE maps: draws borders (evidence: `02_grafica.py`)
- TOE maps → Figures: saves maps (evidence: `02_grafica.py`)
- Peru fractions → Figures: saves plot (evidence: `02_grafica.py`)
- Analyst → Model time series: selects inputs (evidence: `03_series_modelos.py`)
- Climate NetCDF → Model time series: provides series (evidence: `03_series_modelos.py`)
- Model time series → Figures: saves plots (evidence: `03_series_modelos.py`)
