Thinking global, living local

How to use kalki_flooding: 125 years of Indian city rainfall extremes from IMD gridded data

October 19, 2026

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

Skip to article content
Text Size

Revised · v1.0.0 · what changed

1,623city-years of metrics regenerated
125years per city, 1901-2025
12city series incl. a Pune station
~3 sto rebuild metrics and 2 charts

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
Not for.
  • 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

RequirementWhyHow to get it
Python 3 with matplotlibcity_rain_metrics.py draws chartspip install matplotlib
IUDX client credentialsonly for collector.py, not run hereregister 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:

ToolWhat you needBest for
GitHubFree account to fork or star; git to clone, or the green Code button, then Download ZIP, or open in CodespacesGetting the code and keeping up with updates
Claude CodeClaude subscription or API key; run claude inside the cloned folderLetting the AI read and run the whole repo
Gemini CLIGoogle account; run gemini inside the cloned folderThe same hands-on workflow with Gemini
Claude.ai, Gemini or ChatGPT in the browserA 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 firstEditing and extending the code
git clone https://github.com/herrrickshaw/kalki_flooding.git
cd kalki_flooding
claude      # or: gemini

Install

  1. 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

MethodHow it works
Compare citiesLoad city_rain_metrics.csv in a notebook and plot heavy_days by decade.
Pair with sensorsUse 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.

Revision history.
  • 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.

Umashankar Triplicane Dwarakanathan
Contact Us
Umashankar Triplicane Dwarakanathan
Investment Promotion & Energy-Sector Leader · Chennai, Tamil Nadu, India
LinkedIn → GitHub → Email +91 78273 81696
How this site works

Data-led analysis of India's trade, currency and industrial policy. Every article is built from primary official sources, and every figure links back to the release, table or filing it came from.

Sources. DGCI&S TradeStat (imports/exports, HSN-wise) · PIB (government press releases, January 2017 to today, refreshed daily) · RBI (circulars, balance of payments) · MoSPI (CPI/WPI, IIP) · PARIVESH (environmental clearances) · CCIL (bond yields) · BIS (policy rates) · SEBI, NSE/BSE and SEC filings for company data.

Interpretation. Figures carry their vintage and retrieval date; estimates and press-reported numbers are labelled as such; where sources disagree, both are shown. Corrections are made visibly, never silently. Articles are written with AI assistance from the cited sources — AI-generated text can misstate figures even when working from real material, so verify any number that matters to a decision against the linked primary source.

footer

Browse all articles by topic

Every piece on this blog, grouped. Or read the full index.

Agriculture & FertilisersAI ToolsChemicalsClimate & CarbonEnergy & FuelsGas & LNGImport SubstitutionIndustrial PolicyMarkets & FinanceMobility & EVPrices & InflationTextilesTrade & Tariffs

Each topic is a live archive page that updates itself as pieces are labelled. It replaces a hand-kept list that had fallen 18 articles behind.