prop/lib/microwaveprop/workers
Graham McIntire 7a2b1f292c
feat(pskr): hourly calibration sampler joining spots × HRRR × Kp
PSK Reporter is now an always-on data feed, so the calibration
corpus that recalibration will eventually train against can grow
hourly from when the firehose started. One row per (hour, band,
0.125° midpoint cell) joins three sources:

  * `pskr_spots_hourly` — observed spot density (truth signal)
  * `hrrr_profiles` nearest match at the cell midpoint at hour
    boundary (atmospheric features: T, Td, PWAT, P, dN/dh, HPBL,
    ducting flag)
  * `geomagnetic_observations` latest Kp at the hour (space weather)

Predicted scores are intentionally NOT stored — they're a function
of the algorithm version under evaluation. Storing only features
keeps the corpus stable across every weight refit; the recalibrator
computes predictions on demand.

Components:

  * Migration `20260504210756_create_pskr_calibration_samples` —
    new table + unique index on (hour, band, midpoint_lat, lon),
    plus a midpoint spatial index on `pskr_spots_hourly` to keep
    the join cheap.
  * `Pskr.CalibrationSample` — schema mirror of the table with
    the same `(hour, band, midpoint_lat, lon)` unique constraint.
  * `Pskr.CalibrationSampler.build_for_hour/1` — pulls all spots
    for the hour, snaps midpoints to the propagation grid (0.125°),
    builds an in-memory HRRR index over a ±0.07°/±60 min window,
    and bulk-upserts samples. Idempotent — re-runs upsert.
  * `Workers.PskrCalibrationWorker` — Oban cron entry on the
    `:backfill_enqueue` queue. Default args target the previous
    full hour; explicit `hour_utc` arg reruns any hour.
  * Cron `25 * * * *` — fires past HRRR analysis publish window
    (~HH:50→HH:05) and PSKR aggregator's 60s flush.

Forward-only: PSKR has no historical archive, so the corpus only
grows from when the feed started. Recalibration weight refits
should wait for ~30 days / ~10k samples to cover diurnal and
synoptic variability.

Tests cover cell-snapping, HRRR feature joining, Kp stamping,
median-distance aggregation, mode dedup, idempotent reruns, and
the worker's default-hour and explicit-hour args (12 new tests,
all passing).

Backfill pipeline untouched — none of these changes feed into
contact enrichment.
2026-05-04 16:12:47 -05:00
..
admin_task_worker.ex fix(review): address code-reviewer findings 2026-04-21 10:09:46 -05:00
backfill_enqueue_worker.ex fix(hrrr): mark contacts :unavailable on failed fetch tasks 2026-04-22 17:46:51 -05:00
canadian_sounding_fetch_worker.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
common_volume_radar_worker.ex perf+hygiene: batch 1 of system-review fixes 2026-04-21 17:06:07 -05:00
contact_import_worker.ex perf+hygiene: batch 1 of system-review fixes 2026-04-21 17:06:07 -05:00
contact_position_backfill_worker.ex test: override stale distance_km when filling a missing pos 2026-04-16 14:09:45 -05:00
contact_weather_enqueue_worker.ex fix(weather): reconcile hrrr_status + iemre_status stuck in :queued 2026-04-24 13:38:52 -05:00
gefs_fetch_worker.ex fix: log swallowed async task exits in GEFS scoring and HRRR range fetch 2026-04-27 14:22:10 -05:00
grid_cache_prune_worker.ex feat(workers): add GridCachePruneWorker 2026-04-21 13:19:52 -05:00
hrdps_grid_worker.ex feat(hrdps): scope to current-hour-only at 0.5° step 2026-04-30 10:36:00 -05:00
hrrr_native_grid_worker.ex refactor(db): use explicit on_conflict set clauses over :replace_all_except 2026-04-21 14:22:15 -05:00
iemre_fetch_worker.ex test: expand coverage and refactor to idiomatic style 2026-04-23 13:28:42 -05:00
ionosphere_fetch_worker.ex perf+hygiene: batch 1 of system-review fixes 2026-04-21 17:06:07 -05:00
mechanism_classify_worker.ex fix(workers): propagate transient errors so Oban retries + counters fire 2026-04-21 13:15:27 -05:00
narr_fetch_worker.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
nexrad_worker.ex refactor(db): use explicit on_conflict set clauses over :replace_all_except 2026-04-21 14:22:15 -05:00
propagation_grid_worker.ex feat(prop): adaptive HRRR cycle selection — prefer fresh, fall back if late 2026-04-24 19:44:07 -05:00
propagation_prune_worker.ex fix(propagation): hourly grid chain preempts MRMS/prune backlog 2026-04-19 08:42:22 -05:00
pskr_calibration_worker.ex feat(pskr): hourly calibration sampler joining spots × HRRR × Kp 2026-05-04 16:12:47 -05:00
radar_frame_worker.ex refactor(db): use explicit on_conflict set clauses over :replace_all_except 2026-04-21 14:22:15 -05:00
rover_mission_backfill_worker.ex feat(rover-planning): hourly backfill worker recovers stuck paths 2026-05-03 13:52:27 -05:00
rover_mission_reconcile_worker.ex fix(rover-planning): async reconcile + strict band match in path worker 2026-05-03 14:16:48 -05:00
rover_path_profile_worker.ex ops: split RoverPathProfileWorker onto :rover_path queue at 1 slot/pod 2026-05-03 15:44:35 -05:00
solar_index_worker.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
space_weather_fetch_worker.ex SpaceWeather: SWPC JSON ingestion (Kp, F10.7, GOES X-ray) 2026-04-15 14:55:24 -05:00
station_elevation_worker.ex feat(rover): Oban worker enriches station elevation post-insert 2026-04-25 16:26:33 -05:00
terrain_profile_worker.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
user_home_qth_lookup_worker.ex feat(accounts): auto-prefill home QTH from QRZ on register + backfill on boot 2026-04-25 17:03:01 -05:00
weather_fetch_worker.ex perf(weather): asos_day — one job per unique (station, UTC date) 2026-04-24 13:19:20 -05:00