A static webpage that visualizes wave forecast data from the NOAA Nearshore Wave Prediction System (NWPS) for the purpose of planning scuba diving trips in the Monterey Bay area.
This is a rewrite of an older version of the project.
Disclaimer: 🤖 This project was heavily vibe-coded with Claude 🤖
- Interactive map with a wave-height heatmap overlay. Use the time slider and play button to animate through forecast time steps.
- Left-click any ocean point to display time-series charts for that location: wave height, wave period, wave direction, water level / tide.
- Compare two dive sites: right-click any ocean point to drop a gold comparison marker; its data is overlaid on every chart alongside the blue (primary) series
- Dive-site shortcuts: two dropdowns at the bottom of the sidebar list common Monterey Bay dive sites — pick one in the blue (primary) dropdown or the gold (comparison) dropdown to jump the corresponding marker there.
- Switch forecast runs: a dropdown in the selector row lists the available forecast runs — pick an earlier run to view a previous forecast.
- Buoy measurements: the same dropdowns also list nearby NDBC buoys — pick one to overlay the buoy's actual observed wave height, period, and direction on the charts.
- Keyboard shortcuts:
Spacetoggles play/pause and←/→step the time slider one frame at a time.
The page can be embedded via <iframe>. A minimal example:
<iframe src="https://kevinddchen.github.io/wavey2/" loading="lazy"></iframe>Use the URL parameters above to deep-link to a specific location. For example, to open with the marker on Lovers Point:
<iframe src="https://kevinddchen.github.io/wavey2/?lat=36.6249&lon=-121.9135" loading="lazy"></iframe>The current marker positions are encoded in the URL so you can bookmark or share a link to a specific view:
| Parameter | Description |
|---|---|
lat |
Latitude of the blue (primary) marker |
lon |
Longitude of the blue (primary) marker |
cmpLat |
Latitude of the gold (comparison) marker |
cmpLon |
Longitude of the gold (comparison) marker |
zoom |
Initial map zoom level (integer, 0–18) |
forecast |
Id of the forecast run to show (e.g. 20260528_1200) |
t |
Initial time-slider index (integer) |
play |
Autostart the time animation on load |
units |
Display units — ft (default) or m |
charts |
Comma-separated whitelist from height,period,dir,tide |
hideMap |
Hide the map panel |
hideSidebar |
Hide the sidebar |
hideHeader |
Hide the sidebar header / title block |
hideSelectors |
Hide the forecast + dive-site selector row |
hideTimeControl |
Hide the time slider / play button / legend bar |
hideFooter |
Hide the "View on GitHub" footer link |
disablePrefetch |
Don't background-download other forecasts (saves bandwidth) |
The NOAA Nearshore Wave Prediction System (NWPS) is a NOAA service that produces wave forecasts for U.S. coastal areas. A live NOAA visualization of wave heights for Monterey Bay is available here.
Real-time wave measurements are taken from NOAA National Data Buoy Center (NDBC).
uv venv
uv sync --no-devfetch.sh runs the whole pipeline below — download forecasts, convert them, download buoy
observations, and build the manifest:
./fetch.shAfter fetching, skip ahead to Run web server. The individual steps below are documented for reference, or if you want to run them manually.
# the single most recent run:
uv run scripts/download_grib.py
# or every run still on the server:
uv run scripts/download_grib.py -afor f in gribs/*.grib2; do
uv run scripts/grib2bin.py "$f"
doneThis creates one file per run named data/waves_<run_id>.bin.gz (the <run_id>,
e.g. 20260528_1200, is parsed from the input filename).
uv run scripts/download_buoy.py -b 46236 # writes data/buoy_46236_<YYYYMMDD_HHMM>.jsonAfter generating the wave files and any buoy files, build data/index.json (the
manifest the website reads to discover both):
uv run scripts/build_index.py # scans data/ for waves_*.bin.gz and buoy_*.jsonuv run python -m http.server 8000 & open http://localhost:8000A plain file server is required because the page uses fetch() to load data/index.json and the data/* data files, which browsers block over file:// URLs.
- Push this repository to GitHub.
- Go to Settings → Pages and set the source to GitHub Actions.
- The site will be available at
https://<username>.github.io/<repo>/.
The .github/workflows/deploy.yml workflow handles the build and deploy. It runs automatically four times a day to refresh the forecast data, and can also be triggered manually from the Actions tab.
uv venv
uv sync
npm installuv run mypy .
uv run ruff check
uv run ruff format --checknpm run eslint
npm run prettier