Skip to content

Add regional radar providers: IPMA (Portugal) and NOAA NEXRAD (CONUS + Puerto Rico) - #6

Open
fakehec wants to merge 2 commits into
OpenFairWind:mainfrom
fakehec:providers-ipma-noaa
Open

fakehec wants to merge 2 commits into
OpenFairWind:mainfrom
fakehec:providers-ipma-noaa

Conversation

@fakehec

@fakehec fakehec commented Sep 14, 2026

Copy link
Copy Markdown

Summary

Three display-tier radar providers on the existing weather-radar provider contract, extending regional coverage beyond the shipped DWD / DPC / RainViewer set. Auto-discovered via providers/*.js; each is keyless, live-only and display tier only (no downloadRaw/cellsFromRaw).

Independent of the AEMET provider PR (#2) — these rely only on the in-tree provider contract/registry, so they can land on their own.

id Coverage Source Shape
ipma Portugal IPMA imgs-radar.json → palette PNG composite decode + georef (like AEMET)
noaa US (CONUS) Iowa Env. Mesonet nexrad-n0q XYZ XYZ passthrough (like RainViewer)
noaa-pr Puerto Rico / USVI Iowa Env. Mesonet nexrad-n0q WMS WMS GetMap (bbox3857)

Notes

  • IPMA — two-step keyless feed (transf/radar/imgs-radar.json newest-first → .../radar/por/<path> palette PNG, 1500×2331, 5-min cadence). lib/ipma-raster.js decodes the palette PNG with Node's built-in zlib (no image-codec dependency), renders the native reflectivity ramp, and reprojects an equirectangular EPSG:4326 fit [-9.6, 36.8, -6.0, 42.2] to tiles. The georef bounds are an initial fit — refine against the IPMA GeoServer WMS bbox if a maintainer has it handy.
  • noaa — the NWS NEXRAD CONUS mosaic is already web-mercator {z}/{x}/{y} at IEM, so this is a thin passthrough.
  • noaa-pr — the CONUS XYZ mosaic doesn't reach the Caribbean, so PR/USVI is drawn from the same IEM nexrad-n0q layer via WMS GetMap using the request's bbox3857 (the contract explicitly allows WMS adapters).

Testing

node --test units for each (IPMA: palette-PNG un-filtering across all five filter types, georef round-trip, tile render/transparency; NOAA: URL templating with stubbed fetch, cadence, coordinate/validation; NOAA-PR: WMS GetMap query assembly, bbox validation). All added to the lint script. Also verified against the live feeds (composites decode with real echoes; tiles render over Portugal, CONUS and Puerto Rico respectively).

Not included: a Météo France provider — its radar is behind the token-gated API Paquet Radar (15-minute composite packets, Lambert grid), which is materially more work; left for a follow-up.

…+ Puerto Rico)

Three display-tier radar providers on the existing weather-radar provider
contract (auto-discovered via providers/*.js), extending coverage beyond the
shipped DWD/DPC/RainViewer set. Independent of the AEMET PR (OpenFairWind#2); they rely only
on the in-tree provider contract/registry.

- ipma — IPMA national radar composite (Portugal). Two-step keyless feed
  (transf/radar/imgs-radar.json -> palette PNG); palette PNG decoded with Node's
  built-in zlib (no image-codec dependency), georeferenced as equirectangular
  EPSG:4326 and reprojected to tiles. lib/ipma-raster.js is a pure, unit-tested
  decode/reproject core.
- noaa — NOAA NEXRAD CONUS mosaic. XYZ passthrough to the Iowa Environmental
  Mesonet nexrad-n0q web-mercator tile cache (keyless), like RainViewer.
- noaa-pr — NOAA NEXRAD Puerto Rico / USVI. WMS GetMap adapter over the same IEM
  nexrad-n0q layer (the CONUS XYZ mosaic does not reach the Caribbean).

All keyless, live-only, display tier only (no downloadRaw/cellsFromRaw). Each
ships unit tests (node --test) and is added to the lint script. Verified against
the live feeds.
renderTile sampled the echo grid with nearest-neighbour rounding, so at
display zoom each source cell rendered as a hard block with jagged edges.
Replace it with a bilinear warp that averages colour only over valid
(opaque) source neighbours — transparent no-echo pixels never bleed into
the colour — and drives the alpha from the covered fraction of the 2x2
footprint, so echo edges feather out instead of blocking.

Adds a regression test asserting the render produces partial-alpha edge
pixels (which nearest-neighbour cannot).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ET9sdhUU4uyew792nfV2Sa
@fakehec

fakehec commented Sep 22, 2026

Copy link
Copy Markdown
Author

Pushed a follow-up commit that improves the IPMA tile rendering the same way as the AEMET provider: renderTile warped the echo grid with nearest-neighbour rounding (hard, aliased blocks at display zoom). It now uses a coverage-weighted bilinear warp — colour is averaged only over valid (opaque) source neighbours (transparent no-echo pixels never bleed in) and the covered fraction of the 2×2 footprint drives the alpha, so echo edges feather out instead of blocking.

Added a regression test asserting the render produces partial-alpha edge pixels (which nearest-neighbour cannot).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant