Has Malawi's planting season shifted since 1990?
A data science project using ERA5 reanalysis and CHIRPS rainfall data to detect shifts in onset-of-rains (OOR) dates across Malawi's districts from 1990–2024, with implications for smallholder maize farming.
Climate change is altering rainfall seasonality across sub-Saharan Africa. This project quantifies how much and where Malawi's agricultural calendar has shifted by:
- Extracting onset-of-rains (OOR) dates per district (1990–2024)
- Fitting linear trends to detect statistically significant shifts
- Mapping spatial patterns of change
- Generating an interactive Streamlit dashboard and Quarto report
crop-calendar-shift/
│
├── data/
│ ├── raw/ # Downloaded ERA5 / CHIRPS NetCDF files
│ └── processed/ # Cleaned CSVs ready for analysis
│
├── scripts/
│ ├── python/
│ │ ├── 01_download_chirps.py # Download CHIRPS rainfall via API
│ │ ├── 02_extract_oor_dates.py # Compute onset-of-rains per district
│ │ └── 03_export_for_r.py # Export clean CSV for R analysis
│ └── r/
│ ├── 04_trend_analysis.R # Linear trend fitting + Mann-Kendall
│ └── 05_visualisations.R # ggplot2 maps and charts → outputs/
│
├── dashboard/
│ └── app.py # Streamlit interactive dashboard
│
├── report/
│ ├── report.qmd # Quarto report (rendered to HTML/PDF)
│ └── references.bib
│
├── outputs/
│ ├── figures/ # All saved plots
│ └── tables/ # Trend result tables (CSV)
│
├── environment.yml # Conda environment
├── requirements.txt # pip requirements
├── renv.lock # R package lockfile (generated by renv)
└── README.md
conda env create -f environment.yml
conda activate crop-calendarOr with pip:
pip install -r requirements.txtpython scripts/python/01_download_chirps.py
python scripts/python/02_extract_oor_dates.py
python scripts/python/03_export_for_r.pysource("scripts/r/04_trend_analysis.R")
source("scripts/r/05_visualisations.R")streamlit run dashboard/app.pyquarto render report/report.qmdFollowing FAO/FEWS NET standards, OOR is defined as the first day after October 1st when:
- Cumulative rainfall ≥ 25mm over 3 consecutive days
- No dry spell > 10 days in the following 20 days
- Sen's slope estimator — robust linear trend (mm/year or days/decade)
- Mann-Kendall test — non-parametric significance test (p < 0.05)
- Applied per district, significance mapped spatially
| Dataset | Variable | Resolution | Source |
|---|---|---|---|
| CHIRPS v2.0 | Daily precipitation | 0.05° | UCSB CHG |
| ERA5-Land | 2m temperature, ET | 0.1° | Copernicus CDS |
| GADM Malawi | District boundaries | Vector | GADM |
George Sichinga
MSc Applied Data Science (Environment & Climate Modelling)
LUANAR, Malawi
georgesichinga.github.io
MIT