Add a GFS storm-potential (surface CAPE) overlay#13
Merged
Conversation
A new default-off layer shading where the atmosphere is primed for
thunderstorms, alongside the live NWS alerts. Surface CAPE (J/kg) is
decoded from the same GFS GRIB2 source as temperature/wind/precip and
shipped as a grayscale equirectangular texture (0..5000 J/kg) that the
web colormaps on the GPU and scrubs on the shared forecast timeline.
- ingest: generic fetch_scalar_tex helper (shared by refc + cape) writes
capetex/{snapshot}/{hour}.png + capetex/latest.json; CapeTexIndex
contract type; CAPE bounds in gfs.rs; cape/all job dispatch.
- web: CapeRasterLayer (mirrors RefcRasterLayer) + cape layer with a CAPE
colormap and opacity control; useCapeTex feed.
- cdk: cape schedule (6 h) + capetex/ lifecycle (2-day expiry).
- deploy: prime cape after stack deploy so the feed never 404s.
- docs: README + on-map attribution cover storm potential / GFS CAPE.
Also fix the equirect raster UBO binding: luma derives the bound block
name as `${module.name}Uniforms`, so a 'raster' module name with a
refcUniforms/capeUniforms block silently never binds (uniforms read 0 →
everything discards → blank). Name the modules 'refc'/'cape' to match.
This also repairs the precip GFS-forecast raster, which had the same
latent mismatch (live radar was unaffected).
b5dd0d5 to
ed792f1
Compare
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A new storm potential layer (default-off) shading where the atmosphere is primed for thunderstorms — GFS surface CAPE (J/kg) — alongside the live NWS alerts, which stay the authoritative "now" hazard layer.
CAPE is decoded from the same NOAA GFS GRIB2 source as temperature/wind/precip (no new external source) and shipped as a grayscale equirectangular texture over 0…5000 J/kg that the web denormalizes and colormaps on the GPU, faded out below ~250 J/kg. It rides the shared forecast-hour timeline, so one scrub moves the grid, cities, wind, precipitation, and storm potential together.
fetch_scalar_texhelper now shared byrefc+cape;capewritescapetex/{snapshot}/{hour}.png(immutable) +capetex/latest.json(CapeTexIndex). CAPE bounds live ingfs.rs;cape/alladded to job dispatch.CapeRasterLayer(mirrorsRefcRasterLayer) + acapelayer with a CAPE colormap and opacity control;useCapeTexfeed; registered in the layer list.capeschedule (6 h, one per GFS cycle) +capetex/lifecycle (2-day expiry).capeaftercdk deployso a brand-new feed never 404s.Also fixes a latent prod bug (precip GFS-forecast raster)
While verifying, the CAPE raster rendered blank — traced to luma deriving the bound UBO block name as
`${module.name}Uniforms`(shadertools/getShaderModuleUniformBlockName). The equirect raster layers used module name'raster'withrefcUniforms/capeUniformsblocks, so the UBO never bound — uniforms read 0, every fragment discards, blank. Wind happened to be correct ('raster'+rasterUniforms). Renaming the modules to'refc'/'cape'(matching their blocks) fixes CAPE and the precipitation GFS-forecast raster, which had the same mismatch — live radar was unaffected, so it slipped through.Verification
just weather local capeproduced 57 valid forecast steps (CAPE values: ~16.5% of the globe > 250 J/kg, max 5000).Uniforms not foundwarnings.tsc,biome, web build, CDKtsc,cargo fmt --check,clippy -D warnings, and the specta type drift-check all pass.Docs & attribution
web/src/App.tsx) now reads "Temps, wind, precip & storm forecast: NOAA GFS".