prop/test/microwaveprop/weather
Graham McIntire a4cd7632eb
feat(skewt): hover crosshair + DB fallback for missing on-disk profiles
Two follow-ups to the earlier /skewt work:

1. Interactive crosshair (matches the SPC-viewer feel from the
   reference screenshot). Mousing over the diagram now drops a
   horizontal pressure cursor with a top-left readout box showing the
   pressure at the cursor's altitude (mb), the height in m and ft,
   and the linearly interpolated temperature and dewpoint at that
   level. Two coloured dots track the T and Td traces along the
   cursor so the user can read the spread visually.

   Mechanics: SkewtSvg.geometry/0 exposes the plot geometry (left,
   right, top, bottom, p_bottom, p_top, t_min, t_max, skew) as JSON;
   SkewtSvg emits an initially-hidden <g class="skewt-cursor"> layer.
   A new Skewt hook in assets/js/app.ts inverts pressure_y to recover
   pressure from the cursor's viewBox-Y, walks the (descending-pres-
   sorted) profile to interp T/Td/height, and updates the elements.
   The hook also handles mouseleave to hide the cursor and uses the
   SVG's screen-CTM so the math stays correct under any container
   aspect-ratio resize.

2. DB fallback for `available_valid_times`/`load_profile`. When the
   on-disk `ProfilesFile` has nothing for the location-and-window
   (true on dev, transient on prod between chain runs), SkewtLive
   now falls back to `HrrrProfileLookup.{list_valid_times_near,
   read_point_near}/3` against the `hrrr_profiles` Postgres table.
   The lookup uses the same ±0.07° spatial tolerance and the
   `(lat, lon, valid_time)` unique index that `Weather.find_nearest_
   hrrr/3` already relies on, so the queries are index-only.

   Returned shape matches `ProfilesFile.read_point/3` so SkewtLive
   reads from either source transparently. NaiveDateTime → UTC
   normalisation is centralised in `ensure_utc/1` so the LiveView
   sees `%DateTime{time_zone: "Etc/UTC"}` regardless of which side
   produced the value.

Tests: 6/6 new HrrrProfileLookupTest cases (list/limit/tolerance,
read nearest cell, nil for far cells, picks closest among matches),
3/3 SkewtLiveTest still green, 2,894 total Elixir tests + 221
properties green via mix test (one pre-existing flaky test in
admin/contact_edit_live re-runs clean). mix credo --strict clean.
mix assets.build clean.
2026-04-25 13:17:58 -05:00
..
grib2 fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
frontal_analysis_test.exs Fix credo warnings: struct specs, length/1, and test patterns 2026-04-12 10:26:53 -05:00
gefs_client_test.exs test: coverage round 1 (80.45% → 82.05%) + 12 new property tests 2026-04-24 10:15:37 -05:00
gefs_profile_test.exs feat(gefs): scaffold extended-horizon forecast ingestion 2026-04-18 14:28:44 -05:00
grid_cache_test.exs feat(observability): emit telemetry for NotifyListener warm + GridCache hit/miss 2026-04-21 13:30:26 -05:00
grid_snap_property_test.exs fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
hrrr_client_test.exs fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
hrrr_native_client_test.exs test: coverage round 4 (84.39% → 84.44%) + 6 new property tests 2026-04-24 10:32:05 -05:00
hrrr_native_profile_test.exs Extend skew-T plot to cover the full troposphere 2026-04-14 17:25:58 -05:00
hrrr_profile_lookup_test.exs feat(skewt): hover crosshair + DB fallback for missing on-disk profiles 2026-04-25 13:17:58 -05:00
hrrr_profile_test.exs Partition hrrr_profiles by valid_time for query performance 2026-04-01 11:03:33 -05:00
iem_client_test.exs perf(weather): batch ASOS fetches into one multi-station request 2026-04-24 12:44:22 -05:00
iem_rate_limiter_test.exs perf(weather): adaptive IemRateLimiter + rebatch mix task 2026-04-24 12:57:25 -05:00
iemre_observation_test.exs Add IEM precipitation data to QSO weather pipeline 2026-03-30 13:18:11 -05:00
narr_client_test.exs fix(narr): handle cdo 2.5.1 mixed name/code output 2026-04-16 15:14:51 -05:00
ncei_metar_client_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
nexrad_cache_test.exs perf(nexrad): route fetch_decoded_frame through NexradCache 2026-04-19 09:05:55 -05:00
nexrad_client_test.exs test: coverage round 4 (84.39% → 84.44%) + 6 new property tests 2026-04-24 10:32:05 -05:00
nexrad_observation_test.exs Phase 9.3, 9.4, and Phase 3 NEXRAD pipeline 2026-04-10 12:48:36 -05:00
rtma_client_test.exs test: coverage round 3 (83.96% → 84.39%) + 10 new property tests 2026-04-24 10:15:37 -05:00
solar_client_test.exs test: cover Format.number/bytes, Instrument.span, SolarClient edges 2026-04-23 14:09:13 -05:00
sounding_params_property_test.exs test: coverage round 2 (82.05% → 83.96%) + 23 new property tests 2026-04-24 10:15:37 -05:00
sounding_params_test.exs fix: April 2026 codebase review — address 13 bugs across propagation chain 2026-04-25 10:52:51 -05:00
sounding_test.exs Add weather data schema, context, sounding params, and IEM ingestion 2026-03-28 15:57:19 -05:00
station_test.exs Add weather data schema, context, sounding params, and IEM ingestion 2026-03-28 15:57:19 -05:00
surface_observation_test.exs Add IEM precipitation data to QSO weather pipeline 2026-03-30 13:18:11 -05:00
theta_e_test.exs Phase 2 tasks 2.1-2.4: BL turbulence feature computations 2026-04-10 08:21:23 -05:00
uwyo_sounding_client_test.exs test: broaden coverage across parsers, schemas, and pure helpers 2026-04-23 13:56:29 -05:00
weather_layers_test.exs feat(weather): add 700 mb T/Td and mid-layer lapse rate for cap diagnostics 2026-04-24 19:27:23 -05:00