Keep radar history per location from the IEM archive, with lead-in and self-healing gaps (#210) #211
No reviewers
Labels
No labels
area:ai
area:ci-cd
area:notifications
area:observability
area:public-pages
backlog
bug
duplicate
enhancement
help wanted
invalid
question
security
type:decision
type:feature
type:infra
type:maintenance
type:security
v1.0.1
v1.1.0
v1.2.0
v1.3.0
v2.0.0
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
rbrooks/WeatherBot!211
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/location-radar-archive"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Implements #210. Design decisions (tiers, 60/30 minute lead-in and tail, IEM as the source, shipping in v2.0.0) were made by @rbrooks on 2026-10-13.
What changes
Radar capture for the Explorer's event loops moves from "fetch NOAA's current image per alert, capped at 24" to "reconcile each location's frames against Iowa State's time-enabled archive".
location_radar_frames(migration0038): one row per(location_id, valid_at)on a 5-minute grid. Overlapping alerts share frames.app/services/radar_archive.py: tiering, slot maths, the IEM fetcher, blank detection, the fill job, coverage accounting and the incomplete-capture admin alert.poll_alert_radar_frames. Each run plans the slots every location's alerts want (alert life, plus 60 minutes before and 30 after), subtracts what is stored, and fetches the rest sequentially, oldest first, up to 120 per run. Alerts that ended in the last 48 hours are still planned, which is what repairs gaps.Tiers
Things worth a reviewer's attention
location_radar/{location_id}_{YYYYMMDD}_{HHMM}.png): the media storage abstraction allows one directory level.radar_frames.pyis deleted along with the job it fixed. Cadence is now the 5-minute slot grid.Unchanged
alert_radar_framesrows, files and retention.ALERT_RADAR_FRAME_MAX_PER_EVENTis still accepted in env files but no longer used.How it was built
Implementation was delegated from a written spec; I reviewed the result and changed three things: the never-clearing-alert bounds, the backlog guard on the admin alert, and deriving an event's expected frame count from its own alerts' schedule (the first version inferred it from frame timestamps).
Verification
tests/test_radar_archive.py)alembic upgrade headfor0038. CI runs both.After merge
0033 → 0038.🤖 Generated with Claude Code