APSDMA Heat Early Warning System v2 — Handover Summary

Built 19-22 May 2026 in ≤ 3 days · 13 Python modules · 3 scheduled tasks · 8 portal endpoints · NDMA + WMO-WHO aligned

📦 What was delivered

ComponentWhereWhat it does
Interactive map /heatwave-v2/ 688 mandals × 5 days, tier colour, click-popup with all 9 indices, search box, day selector, tier-history strip per mandal
Skill report /heatwave-v2/skill.html Nightly forecast-vs-observed for 6 sources; updates 23:30 IST
Design + ops doc /heatwave-v2/design.html 5-layer architecture, formulas, rules, references — single shareable file
District HAP PDFs /heatwave-v2/hap.html 28 auto-generated bilingual Telugu+English action plans per district
Run archive /heatwave-v2/archive.html Browse past runs — state PDF + press PNG per archived day
State-wide PDF latest_state.pdf One-page A3-landscape — 28×5 heatmap + statewide bars + top-10 table — for SEOC/CM
JSON API /data/api/v1/ Machine-readable mandal-day records + district rollup + schema spec — for SEOC dashboard or mobile apps
Excel workbook latest.xlsx 33-column mandal-day matrix — full transparency for analysts
CSV latest.csv Same as Excel, machine-readable for QGIS / R / Python downstream
Press PNG (D+1) latest_press.png Bilingual map of tomorrow's tier per mandal — for press release
SMS templates sms_latest.json 140 ready-to-send Telugu+English messages — 3 length tiers (citizen, operational, extended)
Mandal history mandal_history.json D+1 tier history per mandal across past archived runs (rolling 30-day window)

🔬 Scientific basis (all formulas cited)

⏰ Automation — scheduled tasks (all Ready)

TaskWhenWhat
APSDMA_HeatEWS_DailyDaily 10:35 IST Full pipeline — Excel/CSV/PDF/PNG/SMS/JSON/portal refresh (~45 s)
APSDMA_HeatEWS_VerifyDaily 23:30 IST Compute forecast skill vs DES observations → skill.html
APSDMA_HeatEWS_MOS_TrainSundays 03:00 IST Refresh per-district MOS coefficients on rolling 60-day window

🛡️ Safety — external dispatch is gated

Email + Telegram dispatch only triggers when heat_ews_daily.py is invoked with the --send flag. The scheduled task batch (start_heat_ews_daily.bat) does not include --send. Enable external dispatch only after stakeholder review of the daily output.

📊 Reference performance

MetricValue
End-to-end pipeline wall-clock~45 s
Mandal-day rows per run3,440 (688 × 5 days)
MOS coefficients fitted196 (district × lead pairs)
MOS RMSE improvement−1.1 °C
Ensemble sources blended6 of 6 active (GFS, IMD MME, ECMWF, GFS NCEP, ICON, imd_gfs_grib)
Phase A WRF probeConnected — 147 files / 8.65 GB per run available at IMD upstream
Healthcheck17 OK / 2 WARN / 0 FAIL

📂 Code layout

E:\Heat_EWS_v2\
├── config.yaml                  ← SINGLE source of truth (thresholds, rules, paths)
├── heat_ews_daily.py            ← main orchestrator (13 modules, ~45s)
├── export_portal_geojson.py     ← portal data publisher
├── verify_daily.py              ← nightly skill report
├── healthcheck.py               ← operator health check
├── heat_ews/
│   ├── climatology.py           ← wraps heatwave.* DB tables
│   ├── indices.py               ← 9 scientific indices, unit-tested
│   ├── tiering.py               ← YAML-driven 5-tier engine
│   ├── mos.py                   ← per-district MOS bias correction
│   ├── ensemble.py              ← 6-model forecast blend
│   ├── impact.py                ← tier × HVI × duration scoring
│   ├── dispatch.py              ← press PNG + email + Telegram (gated)
│   ├── hap_pdf.py               ← 28 district HAP PDFs
│   ├── sms_templates.py         ← 140 SMS messages, trilingual
│   ├── state_summary_pdf.py     ← single-page state-wide PDF
│   ├── archive.py               ← run archival + portal index
│   ├── api_compact_json.py      ← REST-like JSON API
│   ├── history_compile.py       ← mandal tier history across runs
│   └── wrf_sync.py              ← Phase A scaffold (probe-only)
├── tests/test_indices.py        ← unit tests
├── output/                      ← daily artifacts
├── logs/                        ← daily.log, verify.log, mos_train.log
└── start_heat_ews_*.bat         ← scheduled-task launchers

🚀 Phase roadmap

  1. Phase A — WRF 3km NetCDF (probe scaffold done; set OPERATIONAL=True in wrf_sync.py after disk + bandwidth approval to add as 7th ensemble member)
  2. Phase B — Full Brode 2012 UTCI with solar radiation forecast
  3. Phase C — SMS gateway integration (VAANI / APSFL — procurement-gated)
  4. Phase D — Mobile app (Flutter, read-only tier viewer for public)
  5. Phase E — Health-dept mortality coupling (heatstroke admissions pilot — partnership-gated)
  6. Phase F — Citizen sensors / IoT ingestion (handheld AWS, school weather stations)

Generated by Heat EWS v2 handover · auto-produced from the operational pipeline state · last updated by the daily run.