R/leafletで波浪モデルの風向風速を可視化


GEFS (Global Ensemble Forecast System)よりGEFS-waveデータをダウンロード、UGRD (Wind U component (m/s)) & VGRD (Wind V component (m/s))をwgrib2でダンプ、jsonにgrib2jsonで変換。

wget -r https://nomads.ncep.noaa.gov/pub/data/nccf/com/gens/prod/gefs.20210401/06/wave/gridded/gefs.wave.t06z.c00.global.0p25.f003.grib2
wgrib2 gefs.wave.t06z.c00.global.0p25.f003.grib2 -match "GRD:" -grib tmp.grib2
grib2json --names --data --o tmp.json tmp.grib2

leafletで可視化。

library(leaflet)
library(leaflet.extras2)

content <- "tmp.json"
leaflet() %>%
  addTiles() %>%
  setView(lng = 135, lat = 35, zoom = 4) %>%
  addVelocity(content = content)