Skip to content

Add WPC Winter Weather Outlook (PWPF) snow/freezing-rain feed - #34

Merged
MikeWills merged 2 commits into
masterfrom
feature/wpc-pwpf-winter-outlook
Sep 11, 2026
Merged

MikeWills merged 2 commits into
masterfrom
feature/wpc-pwpf-winter-outlook

Conversation

@MikeWills

@MikeWills MikeWills commented Sep 11, 2026 •

Copy link
Copy Markdown
Owner

Summary

New synthetic-alert feed for WPC's Probabilistic Winter Precipitation Forecast (PWPF), Day 1/2 only. Closes #33.

  • Pwpf settings block: Enabled, CheckIntervalSeconds (1800), MinProbabilityPercent (40), SnowThresholds ("1,4,8,12"), IceThresholds ("0.10,0.25")
  • WpcPwpfService downloads WPC's per-threshold contour KMZ (/pwpf/latest_kml/prb_24h{snow|icez}_ge{..}_f{024|048}_cntr_latest.kmz), unzips, parses the KML contour rings into NTS polygons, and takes the highest contour level covering any monitored zone/county centroid
  • One alert per day per precip type (WPC Day 1 Snowfall Outlook, WPC Day 1 Freezing Rain Outlook, …) when the highest configured threshold's band ≥ MinProbabilityPercent; body lists every threshold's band
  • Re-posts only when the forecast goes up — dedup ID WPC-PWPF-Day{n}-{Snow|Ice}-{validDate}-ge{thr}-p{band}; the service checks posted_alerts.txt for any higher-threshold or same-threshold-higher-band ID before returning an alert, so unchanged/downgraded 00Z→12Z cycles are silent and restarts don't re-post
  • Severity: snow 1–2" Minor / 4–6" Moderate / 8" Severe / 12"+ Extreme; ice 0.01 / 0.10 / 0.25 / 0.50 likewise
  • New IncludePwpf per-platform flag (default true); IsPwpf/PwpfThreshold/PwpfBand on NwsAlert
  • Map image: same zoomed Mapbox area map as NWS alerts — the triggering probability ring is unioned, clipped to a padded box around the configured zones, and set as alert.GeometryJson so MapService's existing Mapbox path draws it like a warning polygon. Falls back to WPC's static CONUS gif when Mapbox isn't configured.
  • No new NuGet packages

Why PWPF and not the WWD KML/shapefiles

The forecaster-drawn /kml/winwx/ and /shapefiles/ww/ products only exist for ≥4/8/12" — no ≥1" product. The PWPF contour KMZ has 1/2/4/6/8/12/18" plus freezing rain, in plain KML. Details in #33.

Test plan

  • dotnet test — 135 pass (27 new: KML parse, valid-window regex, FindBand nesting, file naming, threshold parsing, BuildAlert, severity, overlay clipping, image URL fallback)
  • Parser run once against a real downloaded prb_24hsnow_ge01_f024_cntr_latest.kmz (Sept — one 1% ring over the Canadian Rockies) — valid window + polygon parse, point-in-ring correct
  • Live: enable Pwpf on the CI/CD instance once there's an actual snow forecast and confirm one post per day/type, the zoomed Mapbox overlay renders, and no re-post on an unchanged cycle

Docs

README feed table + feed-list mentions + Mapbox note, docs/TECHNICAL.md Configuration Reference (Pwpf block, IncludePwpf row) + new "WPC Winter Weather Outlook (PWPF) — How It Works" section, CHANGELOG, CLAUDE.md feed/interface lists.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UokAERat9fVzmcmsfJzsJF

MikeWills and others added 2 commits September 11, 2026 17:29
New WpcPwpfService + Pwpf settings block monitor WPC's Probabilistic Winter
Precipitation Forecast contour KMZ files for Day 1/2: probability of >=1/4/8/12"
snow (configurable from WPC's 1/2/4/6/8/12/18) and >=0.10/0.25" freezing rain
(from 0.01/0.10/0.25/0.50) in 24 hours at any configured zone/county centroid.

- Posts when a threshold's contour band reaches MinProbabilityPercent (default 40)
- Re-posts a given day only when the forecast goes up (higher threshold qualifies,
  or same threshold's band rises) - checked against the persisted posted_alerts.txt
  so restarts don't re-post
- Severity keyed to the highest qualifying threshold; new per-platform IncludePwpf
- No new NuGet: KMZ = zip + KML parsed with System.IO.Compression/System.Xml.Linq
  into NetTopologySuite polygons
- Unit tests for KML parsing, band lookup, file naming, alert building, severity
- Docs: README feed table, TECHNICAL config reference + "How It Works", CHANGELOG,
  CLAUDE.md feed lists

Closes #33

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UokAERat9fVzmcmsfJzsJF
…red area

Instead of WPC's national CONUS gif, the triggering threshold's contour ring is
unioned, clipped to a padded box around the configured zones/counties, and set as
alert.GeometryJson so MapService's existing Mapbox path renders it exactly like an
NWS warning polygon. Falls back to the national gif when Mapbox isn't configured
or the ring can't be clipped.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UokAERat9fVzmcmsfJzsJF
@MikeWills
MikeWills merged commit 610b65f into master Sep 11, 2026
1 of 2 checks passed
@MikeWills
MikeWills deleted the feature/wpc-pwpf-winter-outlook branch September 11, 2026 22:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: WPC winter storm (PWPF) snow-probability feed — Day 1/2, ≥1/4/8/12 in

1 participant