# mayaby/nahosmip_monsoons architecture

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

- Interactive diagram: https://gitdiagram.com/mayaby/nahosmip_monsoons
- Repository: https://github.com/mayaby/nahosmip_monsoons
- Video tour (about a minute): https://gitdiagram.com/mayaby/nahosmip_monsoons/video

## Overview

This repository is research-analysis code for comparing monsoon rainfall under AMOC collapse across climate models. The documented Figure 3 workflow starts with CDO regridding and processing, continues through SI_tables.ipynb calculations, and finishes in Main_Plots.ipynb. Other analysis branches calculate dry/wet seasons, ITCZ position, and SNS/DNS indices; notebooks produce supplementary figures, stippling regions, and tables. functions.py supplies shared data and plotting utilities. The README describes notebook capabilities and workflow; notebook internals were not sampled, so connections beyond that documented workflow are not inferred.

Main entry points: [`SI_tables.ipynb`](https://github.com/mayaby/nahosmip_monsoons/blob/main/SI_tables.ipynb) (Supplementary tables), [`cdo_examples.sh`](https://github.com/mayaby/nahosmip_monsoons/blob/main/cdo_examples.sh) (CDO processing examples), [`get_seasons.py`](https://github.com/mayaby/nahosmip_monsoons/blob/main/get_seasons.py) (Season lengths and rainfall), [`Main_Plots.ipynb`](https://github.com/mayaby/nahosmip_monsoons/blob/main/Main_Plots.ipynb) (Main-text figures)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Data preparation"]
  node_cdo["CDO processing examples<br/>[cdo_examples.sh]"]
end

subgraph group_diagnostics["Climate diagnostics"]
  node_season_calc["Season lengths and rainfall<br/>[get_seasons.py]"]
  node_itcz_calc["ITCZ calculation<br/>[itcz.py]"]
  node_sns_calc["SNS index<br/>[SNS.py]"]
  node_dns_calc["DNS indices<br/>[DNS_seas.py]"]
end

subgraph group_notebooks["Analysis notebooks"]
  node_tables["Supplementary tables<br/>[SI_tables.ipynb]"]
  node_main_figures["Main-text figures<br/>[Main_Plots.ipynb]"]
  node_si_figures["Supplementary figures<br/>[SI_plots.ipynb]"]
  node_stippling["Stippling regions"]
end

subgraph group_shared["Shared utilities"]
  node_shared_functions["Data and plot helpers<br/>[functions.py]"]
end

node_analyst(("Research analyst"))
node_climate_data[("Climate data")]
node_processed_data[("Processed model data")]

node_analyst -->|"runs processing"| node_cdo
node_climate_data -->|"input data"| node_cdo
node_cdo -->|"regrids and processes"| node_processed_data
node_analyst -->|"runs analysis"| node_season_calc
node_analyst -->|"runs analysis"| node_itcz_calc
node_analyst -->|"runs analysis"| node_sns_calc
node_analyst -->|"runs analysis"| node_dns_calc
node_analyst -->|"runs notebook"| node_tables
node_processed_data -->|"analysis input"| node_tables
node_tables -->|"provides calculations"| node_main_figures
node_analyst -->|"runs notebook"| node_main_figures
node_analyst -->|"runs notebook"| node_si_figures
node_analyst -->|"runs notebook"| node_stippling
node_tables -->|"imports helpers"| node_shared_functions
node_season_calc -->|"imports helpers"| node_shared_functions

click node_cdo "https://github.com/mayaby/nahosmip_monsoons/blob/main/cdo_examples.sh"
click node_season_calc "https://github.com/mayaby/nahosmip_monsoons/blob/main/get_seasons.py"
click node_itcz_calc "https://github.com/mayaby/nahosmip_monsoons/blob/main/itcz.py"
click node_sns_calc "https://github.com/mayaby/nahosmip_monsoons/blob/main/SNS.py"
click node_dns_calc "https://github.com/mayaby/nahosmip_monsoons/blob/main/DNS_seas.py"
click node_tables "https://github.com/mayaby/nahosmip_monsoons/blob/main/SI_tables.ipynb"
click node_main_figures "https://github.com/mayaby/nahosmip_monsoons/blob/main/Main_Plots.ipynb"
click node_si_figures "https://github.com/mayaby/nahosmip_monsoons/blob/main/SI_plots.ipynb"
click node_stippling "https://github.com/mayaby/nahosmip_monsoons/blob/main/Get_stippling_regions.ipynb"
click node_shared_functions "https://github.com/mayaby/nahosmip_monsoons/blob/main/functions.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_cdo toneBlue
class node_season_calc,node_itcz_calc,node_sns_calc,node_dns_calc,node_climate_data,node_processed_data toneAmber
class node_tables,node_main_figures,node_si_figures,node_stippling toneMint
class node_shared_functions toneRose
class node_analyst toneIndigo
```

## Components

### Data preparation

- [CDO processing examples](https://github.com/mayaby/nahosmip_monsoons/blob/main/cdo_examples.sh): `cdo_examples.sh`

### Climate diagnostics

- [Season lengths and rainfall](https://github.com/mayaby/nahosmip_monsoons/blob/main/get_seasons.py): `get_seasons.py`
- [ITCZ calculation](https://github.com/mayaby/nahosmip_monsoons/blob/main/itcz.py): `itcz.py`
- [SNS index](https://github.com/mayaby/nahosmip_monsoons/blob/main/SNS.py): `SNS.py`
- [DNS indices](https://github.com/mayaby/nahosmip_monsoons/blob/main/DNS_seas.py): `DNS_seas.py`

### Analysis notebooks

- [Supplementary tables](https://github.com/mayaby/nahosmip_monsoons/blob/main/SI_tables.ipynb): `SI_tables.ipynb`
- [Main-text figures](https://github.com/mayaby/nahosmip_monsoons/blob/main/Main_Plots.ipynb): `Main_Plots.ipynb`
- [Supplementary figures](https://github.com/mayaby/nahosmip_monsoons/blob/main/SI_plots.ipynb): `SI_plots.ipynb`
- [Stippling regions](https://github.com/mayaby/nahosmip_monsoons/blob/main/Get_stippling_regions.ipynb): `Get_stippling_regions.ipynb`

### Shared utilities

- [Data and plot helpers](https://github.com/mayaby/nahosmip_monsoons/blob/main/functions.py): `functions.py`

### Other components

- **Research analyst**
- **Climate data**
- **Processed model data**

## Connections

- Research analyst → CDO processing examples: runs processing
- Climate data → CDO processing examples: input data
- CDO processing examples → Processed model data: regrids and processes
- Research analyst → Season lengths and rainfall: runs analysis
- Research analyst → ITCZ calculation: runs analysis
- Research analyst → SNS index: runs analysis
- Research analyst → DNS indices: runs analysis
- Research analyst → Supplementary tables: runs notebook
- Processed model data → Supplementary tables: analysis input
- Supplementary tables → Main-text figures: provides calculations
- Research analyst → Main-text figures: runs notebook
- Research analyst → Supplementary figures: runs notebook
- Research analyst → Stippling regions: runs notebook
- Supplementary tables → Data and plot helpers: imports helpers
- Season lengths and rainfall → Data and plot helpers: imports helpers
