A repository of Python scripts and committed IMD-derived daily rainfall series for Indian cities that computes yearly heavy-rain metrics and charts, plus a flood-sensor collector for the IUDX network.
Open-Source Tools · How-To · Misc analysis
How to use kalki_flooding: 125 years of Indian city rainfall extremes from IMD gridded data
Revised
· v1.0.0 · what changed
Code: github.com/herrrickshaw/kalki_flooding
Watch the walkthrough
Watch on YouTube: youtu.be/JcUzIvraEho
Why it is useful
- Urban flood questions need long rain records; the repo ships city daily series so you can recompute extreme-rain metrics without downloading raw grids.
- It uses IMD's official intensity categories (heavy 64.5 mm, very heavy 115.6 mm, extremely heavy 204.5 mm), so results map to terms in weather bulletins.
- A DATA_CAVEATS file documents where gridded data misleads (Pune cell, sea-masked Mumbai and Chennai points); this matters before citing any number.
- Evidence from the run: city_rain_metrics.py regenerated 1,623 city-years in about 3 seconds and the output CSV was identical to the committed one.
What it is for
Recompute per-city yearly rainfall metrics (annual, monsoon, rainy days, heavy-day counts, wettest day) and charts from the committed daily CSVs.
The repo also holds collector.py and request_access.py for the IUDX flood-sensor network. Those need registered client credentials and provider approval and were not run.
Who it is for
- Students, journalists and planners exploring long-run heavy-rain trends
- Analysts who want a documented starting dataset for city flood-risk work
- Operational flood warning or engineering design (conceptual analysis only, not engineering advice)
- Citing Pune cell trends or absolute city-centre extremes without reading DATA_CAVEATS.md
- Running the IUDX collector without your own credentials and provider consent
What you need
| Requirement | Why | How to get it |
|---|---|---|
| Python 3 with matplotlib | city_rain_metrics.py draws charts | pip install matplotlib |
| IUDX client credentials | only for collector.py, not run here | register at catalogue.iudx.org.in |
Get the code and an AI assistant
You do not have to be a programmer. Get the repository, give it to an AI assistant, and ask in plain language. Any of these routes works:
| Tool | What you need | Best for |
|---|---|---|
| GitHub | Free account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in Codespaces | Getting the code and keeping up with updates |
| Claude Code | Claude subscription or API key; run claude inside the cloned folder | Letting the AI read and run the whole repo |
| Gemini CLI | Google account; run gemini inside the cloned folder | The same hands-on workflow with Gemini |
| Claude.ai, Gemini or ChatGPT in the browser | A chat account; upload README.md and the files you care about (or paste the output of git ls-files) | Understanding the project and asking questions without installing anything |
| Other tools (Copilot Chat, Cursor, Codex CLI) | Open the cloned folder in the tool and point it at README.md first | Editing and extending the code |
git clone https://github.com/herrrickshaw/kalki_flooding.git
cd kalki_flooding
claude # or: gemini
Install
- Clone and create a virtualenv.
git clone https://github.com/herrrickshaw/kalki_flooding.git cd kalki_flooding/analysis python3 -m venv .venv && .venv/bin/pip install matplotlib
Quick start: commands and what you should see
Rebuild the metrics and two charts
.venv/bin/python city_rain_metrics.py
Prints 'wrote .../city_rain_metrics.csv (1623 city-years)' and 'wrote city_monsoon_trend.png, city_extreme_days.png'. It overwrites those files in the folder, so run it in a copy if you want to keep originals.
Sample outputs
Real output from a run on the date shown in the sources line; trimmed to fit.
Rebuild run
.venv/bin/python city_rain_metrics.py
wrote .../city_rain_metrics.csv (1623 city-years)
wrote city_monsoon_trend.png, city_extreme_days.png
Output CSV matched the committed file.
Heavy-rain days per year, early vs recent, from the CSV (Pune cell excluded)
pandas: mean heavy_days for years <=1960 vs >=1996, per city
city 1901-60 1996-2025 wettest day (mm, year)
ahmedabad 1.88 2.47 384.3 (1927)
bengaluru 0.82 1.20 188.5 (1998)
chennai 3.40 3.20 329.3 (2015)
delhi 1.20 0.53 234.6 (1963)
kolkata 1.82 2.80 326.2 (1978)
mumbai 12.42 13.30 423.4 (2005)
surat 3.42 5.23 400.4 (1941)
Gridded 25 km cells mute extremes (Delhi, Mumbai); see DATA_CAVEATS.md. Differences are descriptive, not tested for significance.
Ways to use it
| Method | How it works |
|---|---|
| Compare cities | Load city_rain_metrics.csv in a notebook and plot heavy_days by decade. |
| Pair with sensors | Use the Bengaluru waterlogging data and rain_event_correlation.py as a starting point. |
Sample prompts for your AI assistant
Copy, paste and edit the parts in [brackets].
- Read analysis/DATA_CAVEATS.md and summarise which cities' numbers I should not compare.
- Using city_rain_metrics.csv, plot heavy_days by decade for Surat and Kolkata.
- Explain the IMD intensity categories used in city_rain_metrics.py.
- Suggest a significance test for the early vs recent heavy-day difference.
- Explain what collector.py does and what I must do before running it.
Limits and honest caveats
- Pune's grid cell is unusable for trends (documented artefact); Mumbai and Chennai points are shifted off the sea mask; Delhi extremes are muted by gridding.
- Early-vs-recent differences are descriptive; no significance testing was done.
- collector.py, request_access.py and the other analysis scripts were not run.
- Not for operational flood forecasting or engineering design.
Sources: the kalki_flooding README, analysis/DATA_CAVEATS.md and committed city_daily CSVs (IMD gridded data); city_rain_metrics.py run on 19 October 2026 in a scratch copy with a fresh virtualenv. Other scripts and the IUDX collector not run.
- v1.0.0 — 19 October 2026 — first published.
About this article: Researched, written and edited by Umashankar Triplicane Dwarakanathan, with AI research assistance; every figure is meant to trace to the primary source cited. See the Editorial Policy for how sourcing, AI use and corrections work.