prop/lib/microwaveprop/weather
Graham McIntire e5528d0135
NarrClient.extract_profile_from_file/3 + fetch_profile_at/2
extract_profile_from_file shells out to cdo:

    cdo -outputtab,name,lev,value -remapnn,lon=X_lat=Y <merged.grb>

parses the text output (varNNN ↔ NCEP GRIB1 param number lookup),
maps surface records to era5_profiles fields, builds the pressure
profile from each (TMP, HGT, SPFH) triple, and merges in the derived
fields from SoundingParams.derive/1. Returns the same attrs shape as
Era5BatchClient.build_profile_attrs/5 so the existing
bulk_insert_profiles path can ingest NARR rows unchanged.

fetch_profile_at picks records from a fetched inventory, byte-range
fetches each one into a per-record temp file, runs cdo -merge to build
a composite, calls extract_profile_from_file, and cleans up via
try/after.

Drive-by fix: ThetaE.dewpoint_from_spfh/2 returns Kelvin (its existing
test asserts that explicitly). Era5BatchClient was passing that
Kelvin value straight into "dwpc" (Celsius), which would then crash
SoundingParams.compute_refractivity_profile when it called Buck's
saturation-vapor-pressure equation with t=294 instead of t=21. The
bug never surfaced because era5_profiles is empty in production —
no ERA5 backfill has ever succeeded. Fixed in both era5_batch_client
and the new narr_client by subtracting 273.15 in the wrapper. Both
wrappers now have a comment pointing at the K→C conversion.

Test fixture test/fixtures/narr/narr_dfw_2010-06-15_12z.grb is the
spike-captured composite (1.1 MB — Lambert conformal projection
isn't sellonlatbox-subsettable so we can't shrink it further).
2026-04-15 18:54:02 -05:00
..
grib2 Speed up ERA5 batch pipeline: parallel CDS + stream downloads + hot index 2026-04-13 16:00:19 -05:00
era5_batch_client.ex NarrClient.extract_profile_from_file/3 + fetch_profile_at/2 2026-04-15 18:54:02 -05:00
era5_cds_job.ex Split ERA5 backfill into submit/poll workers with persistent CDS state 2026-04-13 16:26:26 -05:00
era5_client.ex Extend skew-T plot to cover the full troposphere 2026-04-14 17:25:58 -05:00
era5_profile.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
frontal_analysis.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
grid_cache.ex Fix /weather 500 on cold cache, untrack k8s secret 2026-04-12 13:56:59 -05:00
hrrr_client.ex Split HRRR pressure levels for grid hot path vs per-contact profiles 2026-04-15 08:19:33 -05:00
hrrr_climatology.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -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_profile.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
iem_client.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
iemre_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
metar_5min_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
mrms_cache.ex Add MRMS rain mosaic, fix beacons crash, fix UTC clock flash 2026-04-12 14:49:20 -05:00
mrms_client.ex Add MRMS rain mosaic, fix beacons crash, fix UTC clock flash 2026-04-12 14:49:20 -05:00
narr_client.ex NarrClient.extract_profile_from_file/3 + fetch_profile_at/2 2026-04-15 18:54:02 -05:00
ncei_metar_client.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
nexrad_cache.ex Add more caching to make the map feel instant 2026-04-12 12:26:25 -05:00
nexrad_client.ex Nudge HRRR scores with live ASOS obs between runs 2026-04-12 14:27:27 -05:00
nexrad_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
rtma_client.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
rtma_observation.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00
solar_client.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -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 credo warnings: struct specs, length/1, and test patterns 2026-04-12 10:26:53 -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
uwyo_sounding_client.ex Ingest Canadian radiosondes via UWYO + plans for RDPS/HRDPS 2026-04-13 09:14:34 -05:00
weather_layers.ex Add dialyzer specs and types across the codebase 2026-04-12 08:55:04 -05:00