Commit graph

623 commits

Author SHA1 Message Date
FluxCD
9451b7f451 chore: update prop image to git.mcintire.me/graham/prop:main-1775918264-f6643e5 [skip ci] 2026-04-11 14:38:47 +00:00
8425edbdc4 Add comma separators to MHz frequencies on beacon pages
Formats frequencies like 10368.1 as "10,368.1" on both the
beacon list table and detail page (subtitle, map label, stat field).
2026-04-11 09:37:26 -05:00
FluxCD
6608e6105a chore: update prop image to git.mcintire.me/graham/prop:main-1775916293-ef44ae9 [skip ci] 2026-04-11 14:09:35 +00:00
ab819852ae Install Docker CLI in CI runner container 2026-04-11 09:04:22 -05:00
11c5d5fb43 Add -s flag to wgrib2 -lon extraction for inventory output
Without -s, wgrib2 -lon only outputs msg:offset:lon=X,lat=Y,val=Z
with no variable name or level. The -s flag adds the short inventory
(d=DATE:VAR:LEVEL:...) so the parser can identify which variable
each value belongs to.
2026-04-11 09:03:09 -05:00
FluxCD
0a970594a3 chore: update prop image to git.mcintire.me/graham/prop:main-1775916097-bb90bc8 [skip ci] 2026-04-11 14:02:34 +00:00
ac36441102 Remove grid squares toggle from rover planner page
The rover page now shows only: station markers, band selector,
propagation heatmap, and URL sharing. Grid overlay remains on
the main /map page.
2026-04-10 17:31:23 -05:00
FluxCD
1d76497db5 chore: update prop image to git.mcintire.me/graham/prop:main-1775859782-ceffcbc [skip ci] 2026-04-10 22:25:43 +00:00
669fe07bcf Replace buildx/login GitHub Actions with plain docker commands
setup-buildx-action downloads from GitHub Releases which is slow
and unreliable from the Forgejo runner. Plain docker build/push
works fine since Docker is already on the runner host.
2026-04-10 17:22:57 -05:00
b42b777150 Use wgrib2 -lon for native profile extraction instead of -lola grid
Points spread coast-to-coast created a ~476k cell bounding grid
(350 messages × 476k cells × 4 bytes ≈ 665 MB), causing OOM.

Switch to -lon which extracts values at specific lat/lon points
with text output. One wgrib2 call, one file scan, negligible
BEAM memory regardless of point geographic spread.
2026-04-10 17:12:11 -05:00
33fae7b7c9 Reduce memory pressure: Stream large collections, GC between phases
- Stream profile storage and score upsert instead of materializing
  full 20k+ item lists (propagation_grid_worker, propagation.ex)
- GC between forecast hours and store/compute phases to reclaim
  ~400 MB of grid data between steps
- Single-pass field extraction in scorer.ex path_integrated_conditions
  instead of 6 separate Enum traversals
- Eliminate intermediate merged map in fetch_grid by combining
  merge + profile build into one pipe
- Fix UUID bug: bingenerate → generate in native grid worker
  (same issue previously fixed in nexrad_worker)
2026-04-10 16:45:50 -05:00
FluxCD
2c9613ccc3 chore: update prop image to git.mcintire.me/graham/prop:main-1775856202-f89dfb0 [skip ci] 2026-04-10 21:24:54 +00:00
02467f96c4 Trigger CI: test runner fix with node 22 + docker group 2026-04-10 16:23:12 -05:00
a0baaf3151 Trigger CI build to test runner fix 2026-04-10 16:20:28 -05:00
2973fe978b Download HRRR ranges sequentially to prevent memory accumulation
The parallel download was holding all ~530MB of range responses in
memory before writing to disk. Now each range is fetched and written
one at a time, so only one chunk is in memory at a time.
2026-04-10 15:58:47 -05:00
FluxCD
525a63d246 chore: update prop image to git.mcintire.me/graham/prop:main-1775853912-221e06d [skip ci] 2026-04-10 20:46:38 +00:00
f2efdd4ece Stream HRRR native downloads to disk to prevent OOM
Instead of holding ~530MB GRIB binary in BEAM memory, download
ranges directly to a temp file and run wgrib2 on it. Peak memory
drops from ~530MB to just HTTP chunk buffers.
2026-04-10 15:44:36 -05:00
FluxCD
1c896ec676 chore: update prop image to git.mcintire.me/graham/prop:main-1775848424-575a9af [skip ci] 2026-04-10 19:15:22 +00:00
4487fc22e9 Fix NexradWorker UUID type: use generate() not bingenerate() for insert_all 2026-04-10 14:13:38 -05:00
FluxCD
1f8fc4d4aa chore: update prop image to git.mcintire.me/graham/prop:main-1775848082-4708df9 [skip ci] 2026-04-10 19:09:19 +00:00
0edb1bd95a Fix NexradWorker crash when minute key is missing from args
Jobs enqueued via backfill only have year/month/day/hour — default
minute to 0 instead of requiring it in the pattern match.
2026-04-10 14:07:55 -05:00
FluxCD
147ef7dd6b chore: update prop image to git.mcintire.me/graham/prop:main-1775847868-948cb6d [skip ci] 2026-04-10 19:05:19 +00:00
ea0c41ef50 Fix crash on /submit when LiveStash restores CSV tab without csv_result assign
Set all assigns before LiveStash recovery so reconnecting to the CSV
tab doesn't crash on missing :csv_result / :csv_preview keys.
2026-04-10 14:04:16 -05:00
FluxCD
d071b02cea chore: update prop image to git.mcintire.me/graham/prop:main-1775846284-76029d9 [skip ci] 2026-04-10 18:41:29 +00:00
0e3c06d040 Reduce hrrr queue to 1 per pod to prevent OOM
Native HRRR files are ~400MB each. At hrrr:5 per pod, 5 concurrent
downloads exceed the 4GB pod memory limit causing OOMKilled.
2026-04-10 13:37:37 -05:00
FluxCD
b5d33def74 chore: update prop image to git.mcintire.me/graham/prop:main-1775843322-3bd02fa [skip ci] 2026-04-10 17:51:50 +00:00
e7a7ae073d Phase 9.3, 9.4, and Phase 3 NEXRAD pipeline
Task 9.3 - Weight recalibration via gradient descent:
- Recalibrator module fits logistic regression weights using Nx
- Trains on QSO positives vs random baseline negatives
- Cross-validates by month, normalizes weights to sum to 1.0
- Mix task: mix recalibrate_scorer --sample 5000 --epochs 2000

Task 9.4 - Side-by-side scorer comparison:
- ScorerDiff.compare/3 re-scores grid with old vs new weights
- Reports mean diff, regressions, improvements, per-band breakdown
- Mix task: mix scorer_diff --new-weights '{...}'

Phase 3 - NEXRAD ingestion pipeline:
- NexradClient fetches IEM n0q composite PNGs, extracts per-point
  box statistics (mean/max dBZ, texture variance)
- NexradObservation schema with unique (lat, lon, observed_at)
- NexradWorker on :nexrad queue for background processing
- nexrad_texture backtest feature in Features module
- mix nexrad_backfill --limit 200

All tasks added to AdminTaskWorker and Release for production use.
1116 tests, 0 failures.
2026-04-10 12:48:36 -05:00
FluxCD
ae049dcb8f chore: update prop image to git.mcintire.me/graham/prop:main-1775841968-8f0a37c [skip ci] 2026-04-10 17:28:26 +00:00
01909dbe66 Run admin tasks as Oban jobs instead of blocking eval
Release.backtest_all, climatology, native_derive now enqueue an
AdminTaskWorker job on the new :admin queue and return immediately.
Progress visible in Oban Web at /admin/oban.
2026-04-10 12:26:01 -05:00
FluxCD
046bef6c17 chore: update prop image to git.mcintire.me/graham/prop:main-1775841362-c8237c7 [skip ci] 2026-04-10 17:17:23 +00:00
d5842cb45c Add release tasks for backtest, climatology, and native backfill
All mix tasks now have equivalents in Microwaveprop.Release for
production use via `bin/microwaveprop eval`.
2026-04-10 12:14:41 -05:00
FluxCD
6c4d036177 chore: update prop image to git.mcintire.me/graham/prop:main-1775840246-033e4cc [skip ci] 2026-04-10 16:58:19 +00:00
6d92973853 Phase 9.1: Consolidated backtest report and contest log import
- Add `mix backtest --all` for consolidated pass/fail table across all features
- Add Backtest.consolidated_report/2 and to_consolidated_markdown/1
- Add Features.all_features/0 to auto-discover backtestable features
- Add `mix import_contest_logs` for bulk ARRL contest CSV import with dedup
- Fix hrrr_climatology to batch by (month, hour) to avoid query timeout
- Fix Repo.query! result pattern (Postgrex.Result, not tuple)
- Backtest reports for all Phase 1-6 features
2026-04-10 11:57:15 -05:00
FluxCD
234519bc66 chore: update prop image to git.mcintire.me/graham/prop:main-1775830416-95d649a [skip ci] 2026-04-10 14:14:18 +00:00
65e3159a85 Pause Oban queues in all mix tasks
Mix tasks that call app.start were also booting Oban's cron scheduler,
causing PropagationGridWorker and other cron jobs to fire during
backfills. Add Oban.pause_all_queues(Oban) immediately after app.start
in every mix task that only needs Repo access.
2026-04-10 09:13:30 -05:00
FluxCD
321300895e chore: update prop image to git.mcintire.me/graham/prop:main-1775829412-c884c0c [skip ci] 2026-04-10 13:58:11 +00:00
a840cb9629 Phase 5: Frontal geometry detection via Thermal Front Parameter
FrontalAnalysis module (Weather.FrontalAnalysis):
- detect_fronts/3 computes the Thermal Front Parameter (TFP) from
  2D grids of surface temperature and pressure using Nx vectorized
  ops. TFP = -nabla|nabla(theta)| . nabla(theta)/|nabla(theta)|.
  Most negative values mark cold fronts.
- central_gradient/1 for 2D finite differences with edge handling
- nearest_front/3 finds closest front point with distance and bearing
- path_front_angle/2 computes angle between a QSO path and the
  front (0 = parallel = good, 90 = crosses = dead)

Backtest feature stubs for distance_to_front and parallel_to_front
(return nil until the pipeline caches per-cell frontal features from
the hourly HRRR grid run). The FrontalAnalysis module itself is
tested and ready for integration.

NEXRAD spike docs also included in this commit.
2026-04-10 08:56:44 -05:00
FluxCD
e69d8e6685 chore: update prop image to git.mcintire.me/graham/prop:main-1775829262-fdaf89d [skip ci] 2026-04-10 13:56:10 +00:00
3ea2548114 Phase 8: 5-minute METAR ingestion pipeline
NCEI ASOS 5-minute data client (Weather.NceiMetarClient):
- fetch/3 pulls per-station monthly .dat files from NCEI C00418
- parse/1 decodes the fixed-width METAR format including precise
  T-group temperatures (T02110094 → 21.1/9.4°C)
- metar_5min_observations table: schema-identical to
  surface_observations, separate table to avoid mixing cadences

Weather.recent_surface_obs/3 prefers 5-min data when available,
falls back to the hourly surface_observations table.

Data URL: https://www.ncei.noaa.gov/data/automated-surface-observing-system-five-minute/access/YYYY/MM/asos-5min-KXXX-YYYYMM.dat
Available back to 1996.
2026-04-10 08:53:54 -05:00
FluxCD
1e17b29c5c chore: update prop image to git.mcintire.me/graham/prop:main-1775828838-09c326e [skip ci] 2026-04-10 13:48:04 +00:00
0f0e5e8d43 Phase 3 spike (parked) + Phase 6: temperature anomaly
Phase 3 NEXRAD spike: IEM n0q composite available at 5-min cadence
back to 2022+. Compression-ratio proxy shows afternoon images have
13-81% more texture than dawn (directionally correct), but the n0q
product thresholds out the faint clear-air returns needed for BL
stability detection. Parked until MRMS or Level III products can be
investigated. See docs/research/nexrad_spike.md.

Phase 6: hrrr_climatology table aggregating surface_temp_c by
(lat, lon, month, hour) from the 42M+ hrrr_profiles grid-point
rows. mix hrrr_climatology builds it via a single SQL GROUP BY +
upsert. Backtest.Features.temperature_anomaly computes current_temp
minus climatological mean — the meteorologist's "temperature
deviation above normal" predictor for summer afternoon enhancement.
2026-04-10 08:47:11 -05:00
FluxCD
d6192535c4 chore: update prop image to git.mcintire.me/graham/prop:main-1775828348-a839b52 [skip ci] 2026-04-10 13:39:59 +00:00
604140220a Phase 7: Regionalized seasonal scoring
Add Propagation.Region module with 8 CONUS climate zones (gulf_coast,
southeast, southern_plains, corn_belt, northeast, desert_southwest,
pacific_northwest, mountain_west) and per-region monthly seasonal
adjustment multipliers.

The scorer's score_season now takes lat/lon and applies a regional
multiplier from Region.seasonal_adjustment on top of the band's
seasonal_base + seasonal_adj. Gulf coast August gets a 1.15x boost
(drier, better for ducting) while Corn Belt August gets a 0.80x
penalty (corn evapotranspiration = miserable dewpoints).

Adjustments are hand-tuned starting points from the meteorologist's
qualitative guidance. Phase 9 recalibration will refine them from
backtest data.
2026-04-10 08:39:01 -05:00
82bf248ab7 Phase 4: Ray-traced duct geometry
Duct module (Propagation.Duct):
- refractivity_profile/1: ITU-R P.453 N at each native level
- m_profile/1: modified refractivity M = N + 157*h(km)
- detect_ducts/1: find contiguous regions where dM/dh < 0, returning
  base/top height, thickness, and M-deficit per duct
- min_trapped_frequency_ghz/1: waveguide approximation (Bean & Dutton)
  for the minimum frequency a duct of given geometry can trap
- analyze/1: full pipeline from native profile to duct list + best
  trapped frequency across all ducts

Derive task updated to also compute ducts JSONB and best_duct_band_ghz
alongside the Phase 2 turbulence fields.

Backtest features: duct_thickness, best_duct_freq, duct_usable_10ghz,
duct_usable_24ghz, duct_usable_47ghz.

Real-data validation: 2022-08-20 12Z TX profile shows 0 ducts (M
increases monotonically) — correct for a well-mixed boundary layer
on a turbulent August afternoon (Ri=0.16).
2026-04-10 08:31:16 -05:00
FluxCD
e2daf5a81d chore: update prop image to git.mcintire.me/graham/prop:main-1775827372-ce1b826 [skip ci] 2026-04-10 13:23:56 +00:00
FluxCD
8afc7b52e3 chore: update prop image to git.mcintire.me/graham/prop:main-1775827290-d0f6cb4 [skip ci] 2026-04-10 13:22:56 +00:00
3d58582754 Phase 2.5: Add turbulence backtest feature wrappers
bulk_richardson, theta_e_jump, and shear_at_top feature functions
pull derived fields from the nearest hrrr_native_profile. Ready for
mix backtest once sufficient data is backfilled.
2026-04-10 08:22:43 -05:00
864a91fc5c Phase 2 tasks 2.1-2.4: BL turbulence feature computations
Inversion detection module (Propagation.Inversion):
- find_inversion_top/1 walks the native profile to locate the first
  temperature inversion (surface-based or elevated)
- bulk_richardson/3 computes the Richardson number across the
  inversion layer (Ri < 0.25 = turbulent, > 1 = laminar/good)
- shear_magnitude/3 computes the wind shear vector magnitude
- potential_temperature/2 for θ = T*(P0/P)^0.286

Theta-e module (Weather.ThetaE):
- Bolton (1980) equivalent potential temperature
- dewpoint_from_spfh/2 via Magnus-Tetens inversion
- theta_e_jump/3 for the thermodynamic decoupling metric

mix hrrr_native_derive_fields populates inversion_top_m,
bulk_richardson, theta_e_jump_k, and shear_at_top_ms on existing
hrrr_native_profiles rows.

First real data: 2022-08-20 12Z TX profile shows inversion at
186 m, Ri = 0.16 (turbulent), θ_e jump = 0.33 K — consistent with
marginal propagation conditions at that hour.
2026-04-10 08:21:23 -05:00
FluxCD
b142dfeefd chore: update prop image to git.mcintire.me/graham/prop:main-1775826822-ec20490 [skip ci] 2026-04-10 13:14:54 +00:00
e7f0f03bf0 Fix wgrib2 -lola binary parsing and add native_surface_refractivity
wgrib2 -lola ... bin writes Fortran unformatted records (4-byte
length header + data + 4-byte length trailer per message).
parse_lola_binary was treating the binary as tightly packed,
causing every message after the first to read from the wrong
offset — values came out as garbage across all grid points.

Fix: account for the 8-byte record overhead per message when
computing the data offset for each message's grid values.

This bug affects both the existing propagation grid extraction
(which may have been producing subtly wrong scores) and the new
native-level extraction (which was producing obviously wrong
values). The fix is a one-line stride change.

Also adds Backtest.Features.native_surface_refractivity for the
Phase 1 sanity check, plus a tighter wgrib2 match pattern that
selects only hybrid-level messages from the native file.
2026-04-10 08:13:33 -05:00