prop/lib/microwaveprop/weather
Graham McIntire a14f14485e
perf(weather): serve /weather from chunked scalar artifacts
Move the /weather render path off raw HRRR profile decoding + per-cell
SoundingParams + WeatherLayers derivation. The dominant cost was
re-deriving the same scalar fields on every viewport pan and timeline
scrub.

Server side:

- New Microwaveprop.Weather.ScalarFile persists pre-derived scalar
  rows on NFS, bucketed into 5°×5° chunk files under
  <base>/weather_scalars/<iso>/<lat_band>_<lon_band>.etf.gz. Viewport
  reads only decode the chunks that overlap the requested bounds;
  point-detail clicks read exactly one chunk.
- weather_grid_at/2 and weather_point_detail/3 prefer ScalarFile;
  ProfilesFile is now the cold-start fallback only.
- warm_grid_cache_and_broadcast/1 and warm_grid_cache_from_latest_profile/0
  also persist the scalar artifact, and the cold-derive path kicks
  off a per-valid_time-locked async materialization so the next
  reader gets the cheap path.
- NotifyListener.handle_propagation_ready/1 fires
  Weather.materialize_scalar_file/1 in a detached Task on the Rust
  pipeline's NOTIFY propagation_ready, so steady-state forecast hours
  arrive with their scalar artifact already on disk.
- available_weather_valid_times/0 unions ScalarFile + ProfilesFile so
  the timeline survives an aggressive retention sweep on either side.

Browser side (finding #8):

- Mount the legend Leaflet control once and patch its inner content
  on layer changes instead of remove + re-add on every renderLayer.
- renderTimeline now keys off the rendered button set: selection-only
  updates take an applyTimelineSelection patch path that restyles
  existing buttons in place. Full innerHTML rebuild only fires when
  timelineData itself changes.

Also fixes a credo nesting-depth flag in tile_renderer.ex by extracting
interpolate_pair/2 from the inner anonymous function.
2026-04-28 17:15:36 -05:00
..
grib2 fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
frontal_analysis.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
gefs_client.ex fix: log every silent error path so failures surface in k8s logs 2026-04-27 14:31:30 -05:00
gefs_profile.ex feat(gefs): scaffold extended-horizon forecast ingestion 2026-04-18 14:28:44 -05:00
grid_cache.ex feat(observability): emit telemetry for NotifyListener warm + GridCache hit/miss 2026-04-21 13:30:26 -05:00
hrrr_client.ex fix: log swallowed async task exits in GEFS scoring and HRRR range fetch 2026-04-27 14:22:10 -05:00
hrrr_climatology.ex fix(logging): suppress /metrics logs and harden scorer hot path 2026-04-21 10:44:25 -05:00
hrrr_native_client.ex Fix credo warnings: struct specs, length/1, and test patterns 2026-04-12 10:26:53 -05:00
hrrr_native_profile.ex Extend skew-T plot to cover the full troposphere 2026-04-14 17:25:58 -05:00
hrrr_point_enqueuer.ex feat: harden /map analysis breakdown + move Plausible to root layout 2026-04-21 15:56:30 -05:00
hrrr_profile.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
hrrr_profile_lookup.ex fix(skewt): only fall back to profiles with all 13 pressure levels 2026-04-25 14:19:56 -05:00
iem_client.ex fix(path): handle ProfilesFile cell shape correctly + log async exits 2026-04-25 15:57:20 -05:00
iem_rate_limiter.ex perf(weather): adaptive IemRateLimiter + rebatch mix task 2026-04-24 12:57:25 -05:00
iemre_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
map_layers.ex perf(weather): serve /weather from chunked scalar artifacts 2026-04-28 17:15:36 -05:00
metar_5min_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
narr_client.ex fix(dialyzer): actually fix LiveTable warnings instead of hiding them 2026-04-21 12:58:10 -05:00
narr_profile.ex Rename ERA5 → NARR across the codebase 2026-04-16 09:22:23 -05:00
ncei_metar_client.ex feat(telemetry): broaden Instrument span coverage 2026-04-18 17:25:33 -05:00
nexrad_cache.ex fix(dialyzer): clear 125+ warnings under strict flags 2026-04-21 10:30:06 -05:00
nexrad_client.ex test: expand coverage and refactor to idiomatic style 2026-04-23 13:28:42 -05:00
nexrad_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
rebatch_asos.ex perf(weather): asos_day — one job per unique (station, UTC date) 2026-04-24 13:19:20 -05:00
rtma_client.ex fix(path): handle ProfilesFile cell shape correctly + log async exits 2026-04-25 15:57:20 -05:00
rtma_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
scalar_file.ex perf(weather): serve /weather from chunked scalar artifacts 2026-04-28 17:15:36 -05:00
skewt_params.ex feat(skewt): add wet-bulb / virtual-T traces and right-edge level rail 2026-04-25 14:24:28 -05:00
solar_client.ex feat(telemetry): broaden Instrument span coverage 2026-04-18 17:25:33 -05:00
solar_index.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
sounding.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
sounding_params.ex fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
station.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
surface_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
theta_e.ex Guard against zero specific humidity in theta-e computation 2026-04-11 12:52:32 -05:00
tile_renderer.ex perf(weather): serve /weather from chunked scalar artifacts 2026-04-28 17:15:36 -05:00
uwyo_sounding_client.ex feat(telemetry): wide instrumentation + bump hrrr to 2 per pod 2026-04-18 16:33:34 -05:00
weather_layers.ex refactor: deduplicate helpers and simplify Scorer 2026-04-28 14:14:34 -05:00