prop/lib/microwaveprop/weather/grib2
Graham McIntire 8637253fda Batch ERA5 fetches by month and 2° tile
Per-point ERA5 fetches were tragically slow because every point-hour
triggered its own asynchronous CDS job (submit → poll → assemble →
download). For backfill this meant thousands of independent jobs
queued against Copernicus. The new path groups requests by calendar
month and a 2° × 2° lat/lon tile so one CDS cycle populates ~60k
profiles at once, and Oban uniqueness on (year, month, tile_lat,
tile_lon) collapses every duplicate enqueue.

- Era5BatchClient builds the monthly CDS requests, extracts every
  (lat, lon, hour) from the GRIB2 blob with wgrib2, derives
  refractivity params, and bulk-inserts in 2k-row chunks with
  on_conflict: :nothing. fetch_month_into_db/1 short-circuits when
  the month-tile already has any cached profile.
- Era5MonthBatchWorker runs the batch on the :era5 queue with a
  generous backoff (10m → 1d) and the uniqueness key above.
- Era5FetchWorker is now a thin router: cache hit → :ok, cache miss
  → enqueue the month-batch for the point's tile-month and return.
  No more per-point CDS calls.
- Wgrib2 grows extract_grid_messages/3 which preserves per-message
  datetimes by parsing `d=YYYYMMDDHH[MMSS]` from the inventory, so a
  single GRIB2 file carrying a whole month decodes correctly.
- The era5_backfill mix task enqueues month-tile batches directly.
2026-04-09 13:01:49 -05:00
..
complex_packing.ex Add batch GRIB2 extraction for multi-point grid queries 2026-03-30 16:50:03 -05:00
extractor.ex Use wgrib2 for HRRR grid extraction (7s vs 80+ minutes) 2026-03-31 08:33:29 -05:00
lambert_conformal.ex Replace wgrib2 with pure Elixir GRIB2 decoder for HRRR pipeline 2026-03-29 18:43:43 -05:00
section.ex Add HRRR batch fetch client with multi-point grid extraction 2026-03-30 17:08:21 -05:00
simple_packing.ex Add batch GRIB2 extraction for multi-point grid queries 2026-03-30 16:50:03 -05:00
wgrib2.ex Batch ERA5 fetches by month and 2° tile 2026-04-09 13:01:49 -05:00