APSDMA Heat Early Warning System v2 — Architecture & Operations

Mandal-resolved · 5-tier · NDMA + WMO-WHO aligned · Built 19-22 May 2026 in ≤ 3 days

1 · Executive summary

Heat EWS v2 is the new operational heat-warning pipeline replacing the v1 patchwork. It produces a daily 5-day forecast for all 688 AP mandals with five scientific indices, IMD HW/SHW classification, MOS-bias-corrected GFS forecasts, ensemble agreement across 6 forecast sources, vulnerability-weighted impact scores, and a 5-tier alert (GREEN/YELLOW/ORANGE/RED/MAROON) — published as both an Excel workbook and a live interactive portal at /heatwave-v2/.

What it answers: for every mandal in AP, every day of the next 5 days, what is the tier (severity), the underlying physical drivers, and the priority for ASHA/health/labour response — with built-in validation against ground truth.

2 · Five-layer architecture

L1 · Data ingestion DES AWS 2.2k stations · IMD AWS · IMD GFS GRIB · GEFS ensemble · IMD MME · ECMWF IFS · GFS NCEP · ICON DWD · 30-yr ERA5 climatology · 30-yr IMD station normals · NRSC LST L2 · Processing MOS bias correction (per district, per lead) · 9 indices (HI, AT, UTCI, WBGT, EHF, HWMID, Tmin-anomaly, IMD HW/SHW class) · Mandal-resolved zonal stats · Duration tracking · Ensemble agreement (6 sources) L3 · 5-tier classification YAML-driven rule engine · NDMA-aligned · GREEN / YELLOW / ORANGE / RED / MAROON · Multi-factor (IMD HW class + Tmin anomaly + duration + HI) L4 · Impact scoring Impact = tier_severity × (0.5 + 0.5·HVI_norm) × (1 + 0.15·(dur-1)) · 0-100 priority ranking · Per-day mandal triage list L5 · Dispatch & portal Excel/CSV · Bilingual Telugu+English press PNG · Top-30 impact chart · Leaflet interactive portal /heatwave-v2/ · Email + Telegram (with --send) · Nightly verification report
End-to-end pipeline: each layer is one Python module under heat_ews/, with a single YAML config holding all thresholds, tier rules, and output paths.

3 · Modules — what each file does

FileResponsibilityKey external surface
config.yamlSingle source of truth — thresholds, paths, tier rules, action plans
heat_ews/climatology.pyWraps existing heatwave.* tables: thresholds, normals, HVIget_thresholds_for_date(date), get_multi_param_normals_for_date(date)
heat_ews/indices.py9 scientific indices (HI Rothfusz, AT Steadman, UTCI, WBGT, HWMID Russo, EHF Nairn, Tmin anomaly, IMD HW class)compute_all_indices(...)
heat_ews/tiering.pyYAML-driven 5-tier rule engineclassify(record), enrich_record(record, thresholds)
heat_ews/mos.pyPer-district per-lead linear MOS; writes weather.mos_coefficients_districttrain(), apply_correction(district, lead, raw)
heat_ews/ensemble.py6-model forecast ensemble, weighted mean + spread + HW/SHW probabilityget_ensemble_for_date, get_ensemble_agreement
heat_ews/impact.pyImpact score combining tier × HVI × durationimpact_score(tier, hvi, dur), compute_dataframe(df)
heat_ews/dispatch.pyPress PNG + email + Telegram (gated by --send flag)make_press_png, send_email, send_telegram
heat_ews_daily.pySingle-command orchestrator — runs all of the aboveCLI: python heat_ews_daily.py [RUN_ID] [--send] [--retrain-mos]
export_portal_geojson.pyJoins CSV with mandal polygons → publishes GeoJSON to /heatwave-v2/data/CLI: python export_portal_geojson.py RUN_ID
verify_daily.pyNightly forecast-vs-observation skill reportWrites /heatwave-v2/skill.html

4 · Scientific indices — formulas & references

IndexDefinitionReferenceWhere used
Heat IndexNWS Rothfusz polynomial (full + adjusted)Rothfusz 1990Modifier in tiering when ≥ 41 °C
Apparent TemperatureTa + 0.33·e − 0.70·V − 4.0Steadman 1984Press bulletin context
UTCI (approx)Ta + 0.33·(e − 6.105) − 0.70·V − 4Brode et al. 2012 (shaded)Reference column (true UTCI in Phase 2)
WBGT (no sun)0.7·Twb + 0.3·Ta; Twb via Stull 2011ACGIHOccupational heat-stress reference
HWMID(Tmax − T25) / (T75 − T25) for daily Tmax over T_thresholdRusso et al. 2014Magnitude column
EHF (Excess Heat Factor)EHI_sig × max(1, EHI_accl)Nairn & Fawcett 2013Severity column
Tmin anomalyTmin − Tmin_normal; warm night ≥ +4.5, very warm ≥ +6.5IMD conventionTier modifier (warm-night escalation)
IMD HW / SHW classPlains: Tmax ≥ 40 °C & dep ≥ 4.5 (HW) / 6.4 (SHW); zone-adjusted for coastal/hillsIMD HAPPrimary tier driver

5 · 5-tier rules — exact thresholds

Rules are evaluated in order MAROON → RED → ORANGE → YELLOW → GREEN (highest matching wins). Each tier has any-of rule blocks; all conditions inside a block must match.

TierColorTriggering rules (any-of)
MAROON
Extreme emergency
imd_hw_class == "extreme" (Tmax ≥ 47 °C)
imd_hw_class == "shw" AND duration_days ≥ 3
imd_hw_class == "shw" AND tmin_class == "very_warm_night"
RED
Severe heat wave
imd_hw_class == "shw" (single-day, Tmax ≥ normal + 6.4 °C)
imd_hw_class == "hw" AND duration_days ≥ 3
imd_hw_class == "hw" AND tmin_class == "very_warm_night"
ORANGE
Heat wave
imd_hw_class == "hw" (Tmax ≥ normal + 4.5 °C)
tmax_p95_exceed AND tmin_class == "warm_night"
YELLOW
Hot day caution
tmax_p90_exceed (above mandal 90th-percentile, but not IMD HW)
heat_index ≥ 41 °C
GREEN
Normal
fallback when none of the above match

All rules and thresholds live in config.yaml. Edit that file (not code) to retune.

6 · Impact-based scoring

impact = tier_severity × (0.5 + 0.5 × HVI/100) × (1 + 0.15 × max(0, duration−1))

tier_severity: GREEN=0, YELLOW=20, ORANGE=45, RED=70, MAROON=95. Bounded to [0, 100]. The half-weighted HVI ensures a high-vulnerability mandal with moderate temperature can still rank above a low-vulnerability mandal with extreme temperature — matching WMO-WHO 2024 impact-based forecasting guidance.

7 · Data sources consumed

SourceTable / pathVolume
IMD GFS Mandal Forecast (today's run)C:\…\IMD_Daily_Output\YYYYMMDD\*.xlsx3,440 mandal-days × 5 days
IMD 1991–2020 mandal normalsheatwave.imd_mandal_normals251,808 rows
Multi-param normals (RH, WBGT, HI, AT)heatwave.multi_param_normals251,808 rows × 32 cols
Daily Tmax thresholds (p90, p95, HW, SHW)heatwave.mandal_daily_thresholds83,936 rows
Mandal HVI (688 mandals, 31 cols)heatwave.mandal_hvi688 rows
Multi-model forecasts (6 sources)sde.forecast_daily~95,880 active rows
DES + IMD AWS observed dailysde.observed_daily~3,100 paired district-days
MOS coefficientsweather.mos_coefficients_district196 (district × lead) pairs

8 · Operations

8.1 Scheduled tasks

TaskSchedule (IST)What it does
APSDMA_IMD_GFS_Pipeline (existing)10:00–15:00 / every 30 minPulls GRIB, generates IMD GFS bulletin Excel
APSDMA_HeatEWS_Daily10:35 dailyRuns heat_ews_daily.py + portal export
APSDMA_HeatEWS_Verify23:30 dailyUpdates /heatwave-v2/skill.html
APSDMA_HeatEWS_MOS_Train03:00 SundaysRefreshes MOS coefficients on rolling 60-day window

8.2 Manual operations

# Default — files only, no external dispatch:
python E:\Heat_EWS_v2\heat_ews_daily.py

# Force-regenerate for a past run:
python E:\Heat_EWS_v2\heat_ews_daily.py 2026051900

# Re-train MOS first:
python E:\Heat_EWS_v2\heat_ews_daily.py --retrain-mos

# External email + Telegram (ONLY after operator approval):
python E:\Heat_EWS_v2\heat_ews_daily.py --send

# Skill report:
python E:\Heat_EWS_v2\verify_daily.py

8.3 Outputs per run

8.4 Portal

Live at https://apsdmagis.ap.gov.in/heatwave-v2/ — Leaflet interactive map, tier filter, day selector, click-any-mandal popup with all indices, top-20 highest-impact ranking sidebar, downloadable CSV.

9 · Day-2 reference performance

MetricValue
Wall-clock end-to-end32 s
Mandal-day rows classified3,440
MOS pairs trained196 (district × lead)
MOS RMSE improvement (avg)−1.1 °C
Ensemble sources joined6 of 6 active
Tier distribution (run 2026051900)MAROON 5.8% · RED 14.5% · ORANGE 22.7% · YELLOW 55.6% · GREEN 1.2%

10 · Roadmap (post-Day-3)

PhaseItemEffort
Phase AWRF 3 km NetCDF integration (IMD upstream — 8.9 GB/day)2 wks
Phase BFull Brode 2012 UTCI with solar radiation forecast1 wk
Phase CSMS/IVRS dissemination via VAANI or APSFL gateway4 wks (procurement-gated)
Phase DMobile app (Flutter, read-only public tier viewer)4 wks
Phase EHealth-dept mortality coupling — heat-stroke admissions pilot6 wks (partnership-gated)
Phase FCitizen-sensor / IoT ingestion (handheld AWS, school weather stations)4 wks

11 · References


Generated 2026-05-22 · APSDMA RS & GIS Lab · Heat EWS v2 design + ops handbook.