# alexborowiak/mjo_and_rainfall_trend architecture

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

- Interactive diagram: https://gitdiagram.com/alexborowiak/mjo_and_rainfall_trend
- Repository: https://github.com/alexborowiak/mjo_and_rainfall_trend

## Overview

This repository supports research for a paper on the relationship between the Madden–Julian Oscillation (MJO) and rainfall trends in Northwest Australia. The apparent workflow is to load rainfall and MJO-index data, classify observations by MJO phase or subphase, calculate rainfall summaries and trends, assess statistical significance, and visualize spatial and phase-based results. The README establishes the research purpose, while sampled modules show the data-loading, calculation, statistical, and plotting layers. Notebook-level orchestration and several documented-in-code capabilities are not fully visible in the excerpts, so their connections are left out where unsupported.

Main entry points: [`load_dataset.py`](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/load_dataset.py) (Rainfall loader), [`constants.py`](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/constants.py) (Data settings), [`miscellaneous.py`](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/miscellaneous.py) (Spatial masking), [`phase_calc_functions.py`](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/phase_calc_functions.py) (Phase analysis)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_data["Data access"]
  node_rainfall_loader["Rainfall loader<br/>[load_dataset.py]"]
  node_rmm_loader["RMM loader<br/>[load_dataset.py]"]
  node_legacy_loader["Legacy loaders<br/>[load_dataset_ot.py]"]
  node_constants["Data settings<br/>[constants.py]"]
end

subgraph group_analysis["MJO and rainfall analysis"]
  node_phase_analysis["Phase analysis"]
  node_legacy_phase["Legacy phase analysis"]
  node_subphase_analysis["Subphase analysis"]
  node_calculations["Time calculations"]
  node_masking["Spatial masking<br/>[miscellaneous.py]"]
end

subgraph group_statistics["Trend statistics"]
  node_trend_statistics["Trend analysis"]
  node_significance_tests["Mann–Kendall tests<br/>[mystats.py]"]
end

subgraph group_visualization["Visualization"]
  node_trend_maps["Trend maps"]
  node_phase_plots["Phase plots"]
  node_analysis_plots["Analysis plots"]
end

node_researcher(("Researcher"))

node_rainfall_loader -->|"reads path"| node_constants
node_rmm_loader -->|"reads path"| node_constants
node_researcher -.->|"requests RMM data"| node_rmm_loader
node_phase_analysis -->|"calls tests"| node_significance_tests
node_phase_analysis -->|"uses conversions"| node_calculations
node_phase_analysis -.->|"loads data"| node_rainfall_loader
node_legacy_phase -->|"uses tests"| node_significance_tests
node_legacy_phase -->|"loads data"| node_rainfall_loader
node_subphase_analysis -.->|"loads data"| node_rainfall_loader
node_calculations -->|"applies masks"| node_masking
node_trend_statistics -->|"computes p-values"| node_significance_tests
node_trend_maps -->|"loads mask"| node_rainfall_loader
node_trend_maps -->|"uses settings"| node_constants
node_trend_maps -->|"uses utilities"| node_masking
node_phase_plots -->|"uses utilities"| node_masking
node_analysis_plots -->|"filters data"| node_calculations
node_analysis_plots -->|"uses settings"| node_constants
node_analysis_plots -->|"uses utilities"| node_masking

click node_rainfall_loader "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/load_dataset.py"
click node_rmm_loader "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/load_dataset.py"
click node_legacy_loader "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/load_dataset_ot.py"
click node_constants "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/constants.py"
click node_phase_analysis "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/phase_calc_functions.py"
click node_legacy_phase "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/zzzz_def_____phase_calc_functions-Copy1.py"
click node_subphase_analysis "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/subphase_calc_functions.py"
click node_calculations "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/calculation_functions.py"
click node_masking "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/miscellaneous.py"
click node_trend_statistics "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/phase_calc_functions.py"
click node_significance_tests "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/mystats.py"
click node_trend_maps "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/map_trend_functions.py"
click node_phase_plots "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/phase_plot_functions.py"
click node_analysis_plots "https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/plotting_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_rainfall_loader,node_rmm_loader,node_legacy_loader,node_constants toneBlue
class node_phase_analysis,node_legacy_phase,node_subphase_analysis,node_calculations,node_masking toneAmber
class node_trend_statistics,node_significance_tests toneMint
class node_trend_maps,node_phase_plots,node_analysis_plots toneRose
class node_researcher toneIndigo
```

## Components

### Data access

- [Rainfall loader](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/load_dataset.py): `load_dataset.py`
- [RMM loader](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/load_dataset.py): `load_dataset.py`
- [Legacy loaders](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/load_dataset_ot.py): `drafts/load_dataset_ot.py`
- [Data settings](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/constants.py): `constants.py`

### MJO and rainfall analysis

- [Phase analysis](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/phase_calc_functions.py): `phase_calc_functions.py`
- [Legacy phase analysis](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/zzzz_def_____phase_calc_functions-Copy1.py): `drafts/zzzz_def_____phase_calc_functions-Copy1.py`
- [Subphase analysis](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/subphase_calc_functions.py): `drafts/subphase_calc_functions.py`
- [Time calculations](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/calculation_functions.py): `calculation_functions.py`
- [Spatial masking](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/miscellaneous.py): `miscellaneous.py`

### Trend statistics

- [Trend analysis](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/phase_calc_functions.py): `phase_calc_functions.py`
- [Mann–Kendall tests](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/mystats.py): `mystats.py`

### Visualization

- [Trend maps](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/map_trend_functions.py): `map_trend_functions.py`
- [Phase plots](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/drafts/phase_plot_functions.py): `drafts/phase_plot_functions.py`
- [Analysis plots](https://github.com/alexborowiak/mjo_and_rainfall_trend/blob/main/plotting_functions.py): `plotting_functions.py`

### Other components

- **Researcher**

## Connections

- Rainfall loader → Data settings: reads path (evidence: `load_dataset.py`)
- RMM loader → Data settings: reads path (evidence: `load_dataset.py`)
- Researcher → RMM loader: requests RMM data
- Phase analysis → Mann–Kendall tests: calls tests (evidence: `phase_calc_functions.py`)
- Phase analysis → Time calculations: uses conversions (evidence: `phase_calc_functions.py`)
- Phase analysis → Rainfall loader: loads data (evidence: `phase_calc_functions.py`)
- Legacy phase analysis → Mann–Kendall tests: uses tests (evidence: `drafts/zzzz_def_____phase_calc_functions-Copy1.py`)
- Legacy phase analysis → Rainfall loader: loads data (evidence: `drafts/zzzz_def_____phase_calc_functions-Copy1.py`)
- Subphase analysis → Rainfall loader: loads data
- Time calculations → Spatial masking: applies masks (evidence: `calculation_functions.py`)
- Trend analysis → Mann–Kendall tests: computes p-values (evidence: `phase_calc_functions.py`)
- Trend maps → Rainfall loader: loads mask (evidence: `map_trend_functions.py`)
- Trend maps → Data settings: uses settings (evidence: `map_trend_functions.py`)
- Trend maps → Spatial masking: uses utilities (evidence: `map_trend_functions.py`)
- Phase plots → Spatial masking: uses utilities (evidence: `drafts/phase_plot_functions.py`)
- Analysis plots → Time calculations: filters data (evidence: `plotting_functions.py`)
- Analysis plots → Data settings: uses settings (evidence: `plotting_functions.py`)
- Analysis plots → Spatial masking: uses utilities (evidence: `plotting_functions.py`)
