# Nahant from one phone video: car speeds, waves and the tide, each checked against an instrument (lane measure:ansel)

Written 2026-10-25 by Claude Code (Ansel `01a16f0a`, lane `measure:ansel`) for BOS-Takeoff-Veillance `8ac6d87f`. It implements ROP bead `01a173e5` §20 (orientation note `2026-10-25/notes/rop-orientation_q4w8n2zt.md`). Stephen asked: *"we can also estimate speed limits, wave speeds and wave frequency, and tide height and match against sealevel meters in the area ... to be clear i mean the nahant area"*. This feeds the flight story for the 2026-10-31 demo to Yossi Matias (Google). All files are new. The ROP product and the nahant cam lane were read only.

## The story in one paragraph

At 11:56 EDT on 24 October 2026, Stephen filmed Nahant Bay in 8K through the window of a departing United jet, 1.8 km away. The 14.7 seconds of video over Lynn Shore Drive and Nahant Circle were turned into a map-accurate movie (0.25 m per pixel). We then used it as a measuring instrument and checked each reading against an independent one:

- **Car speeds.** 22 cars were moving with traffic. Their median was **26.6 mph**, under the 30 mph that applies there. Two cars were 2.5 mph over.
- **Wave period.** The beach webcam's 6-minute record gives **12.0 s** between waves. Two NOAA buoys 26-31 km offshore reported **11-13 s**.
- **Water depth.** The waves' speed gives the depth near the seawall to within a few centimetres of **NOAA's bathymetry**.
- **Sea level.** The video puts it at **1.10 ± 0.17 m above NAVD88**. NOAA's gauges say **1.08 m** (Boston gauge 1.11 m, Lynn prediction plus surge 1.04 m).

The sea that morning stood 0.17 m above the predicted tide.

## Comparisons (lead results)

| Quantity | From the flight video / webcam | Independent sensor | Agree? |
|---|---|---|---|
| Speed of moving traffic, Lynn Shore Dr + Nahant Circle | median **26.6 mph (42.8 km/h)**, 85th percentile 29.3 mph, n = 22 moving (27 tracked); per-car ±0.2-1.5 mph (median ±0.38) | Limit **30 mph**: OSM has no `maxspeed` on Lynn Shore Drive or the circle, so this is the MA statutory default for a thickly settled district (MGL c.90 §17). No posted value was found online; Lynn's 25 mph opt-in (c.90 §17C) was not found. | Traffic flows under the limit. 2 of 22 are >2σ over: v05 **32.5 ± 0.3** (Lynn Shore Dr) and v12 **32.6 ± 0.3** (circle). None is more than 5 mph over. |
| Lynnway (1 car) | 25.0 ± 0.2 mph | 35 mph posted, per the [CTPS 2016 study](https://www.ctps.org/data/calendar/htmls/2016/MPO_0623_Lynnway_Study.html) (OSM untagged) | under |
| Nahant Road (1 car, turning) | 15.0 ± 0.3 mph | OSM `maxspeed=25 mph` | under |
| Peak wave period | webcam (370 s, ~30 waves): **12.0 ± 0.4 s** (three image bands 11.9 / 12.1 / 12.2). 8K f-k (14.7 s, only ~1.1 periods): **13.3 ± 1.5 s** | NDBC **44013** (Boston, 26.5 km): DPD 11-12 s, swell period 11.4-12.1 s, Hs 1.5 m, APD 6.9-7.1 s, MWD 74-80°. NDBC **44029** (A01 Mass Bay, 31 km): DPD 12-13 s, Hs 1.5-1.6 m. | yes. The mean periods agree too (webcam Tm01 7.7-8.2 s vs buoy APD 6.9-7.1 s). |
| Wave direction near shore | from **114 ± 5°** (f-k), nearly shore-normal (118°) | 44013 MWD 74-80° (ENE swell), 41° off normal. Snell refraction to ~4 m/s here predicts ~108°. | yes, after refraction |
| Wave speed / wavelength | phase speed median **3.4 m/s** (2.2 m/s at the wall to 5 m/s at 75 m); dominant wavelength 47.5 m | n/a (input to depth) | |
| Depth from waves, 0-45 m from the wall | breaking-bore inversion minus **NOAA NCEI CUDEM** 1/9" (2021, NAVD88): **median −0.02 m**. Linear theory reads 0.33 m deeper (MAD 0.28 m). | CUDEM depth 0.4-1.2 m below the level | yes (bore). Linear theory is biased deep, as expected in a surf zone. |
| Depth, 60-80 m from the wall | waves 1.4-2.2 m | CUDEM flat at 1.2 m | **no, by 0.3-0.9 m** (finding, see below) |
| Water level at 15:56:47Z | **1.10 ± 0.17 m NAVD88** (CUDEM bed + depth from wave speed) | Boston 8443970 observed **1.11 m NAVD88 = 2.79 m MLLW** (preliminary), predicted 0.95 m, so surge **+0.17 m**. Lynn Harbor 8443187 (0.6 km, prediction-only) + Boston surge: **1.04 m**. NOAA best 1.08 ± 0.09 m. | yes, within 0.02 m |
| Waterline on the beach | none: the sea covered the whole beach up to the seawall along all 750 m | requires level + wave setup ≥ wall-foot sand: 1.19 m (CUDEM) / 1.32 m (Google 3D Tiles). Estimated setup 0.21 m (Stockdon 2006). | consistent (only a bound) |

## Figures (public, served from the laptop)

Base: https://stephenguerin.live/agents/8ac6d87f-3192-4fdb-a260-583dbee74291/artifacts/rop/lynn-shore-nahant-circle/measurements/

- `figures/vehicle-tracks-circle.png`, `figures/vehicle-tracks-east.png`: tracks over the ortho frame f356, labelled with id and mph.
- `figures/vehicle-speed-histogram.png`: 2 mph bins, moving vs slow, limit lines. `figures/vehicle-speeds-vs-limit.png`: each car ±1σ against its road's limit.
- `figures/timestack-T1/T3/T5/T7.png`: distance from the seawall vs time, with crest paths integrated from the measured c(s). T3 is the clearest.
- `figures/youtube-timestack.png`: one webcam column over 6 minutes; every bright diagonal is a breaking wave. It reads well in a story.
- `figures/wave-spectrum-youtube.png` (buoy bands shaded) and `figures/wave-period-comparison.png` (buoys vs webcam vs 8K).
- `figures/wave-depth-profiles.png`: wave-derived depth (linear, bore) vs CUDEM. `figures/wall-foot-profiles.png`: Google 3D Tiles beach vs CUDEM vs the NOAA level.
- `figures/tide-comparison.png`: NOAA curves 13-19Z with the video's estimate and the seawall bounds.

Data: `measurements.json` (the summary above, machine-readable), `vehicles.json` (per-car speed, σ budget, track, limit source), `waves-8k.json` (f-k peaks, transect profiles, depth bins), `waves-youtube.json`, `tide.json`. Raw source responses are in `sources/` (CO-OPS datagetter + mdapi, NDBC realtime2 `.txt`/`.spec`, NDBC active stations, Overpass, NCEI CUDEM getSamples, NGS GEOID18, GeographicLib GeoidEval). Two files hold the API's error replies, kept as evidence: `ngs_ncat_itrf2014_to_nad83.json` (NCAT does not accept ITRF) and `coops_8443187_lynn_predictions_NAVD.json` (Lynn has no NAVD88 tie).

## Method, briefly

Inputs: ROP v0.1.0 tiles (440 locked COGs, poses `calibration-8k/poses_115634_b8k3t5.json`). The radial-distortion recalibration `poses_115634_q4v9m2.json` appeared during this work. It was **not** used: the tiles were not re-rendered.

- **Vehicles** (`tools/vehicles.mjs`, `vehicles-report.mjs`).
  1. Background is the temporal median of the stack. A pixel is foreground when it differs from the median by ≥ 24 grey levels, inside an OSM road buffer.
  2. **Finding:** occlusion slivers of light poles and trees sweep across the road as the view changes, and the first pass tracked them as 7-10 mph "cars". Pixels within 1 m of no-data are now ignored. The no-data test is RGB ≤ 12, because the COG's JPEG blurs NoData-0 black into values of 1-12.
  3. A constant-velocity tracker builds tracklets, linked across gaps of up to 2.5 s. Speed is the length of the 0.5 s locally smoothed path divided by its duration.
  4. σ combines: centroid noise; the lock (√2 × 0.26 m p50 / duration); a **local lock check**, the measured apparent motion of static ground in 32 m windows at each track's two ends (ZNCC vs the median, 0.0-0.5 mph); and 0.5% scale. Timing is uniform at 0.0333 s (pose rows) and negligible.
  5. Main roads only. Residential matches were building smear.
- **Waves, 8K** (`tools/waves-fk.mjs`, `waves-transects.mjs`). The 14.7 s window holds **about one wave period**, which is too short for a classic spectrum. So:
  1. **f-k:** a tapered 2D FFT of (frame − median) gives the dominant wavevector. The phase of that Fourier component through time gives ω, so T and c = ω/k.
  2. **Timestacks** along 7 shore-normal transects: lagged correlation over a 6 m baseline gives c(s).
  3. Depth comes from c² = (g/k)·tanh(kh), with T = 12.0 s from the webcam (buoy range 11-13 s as a systematic). The surf-zone version uses a saturated bore, c² = g·h·(1 + γ/2) with γ = 0.78. γ is the textbook value, not fitted. Varying it over 0.6-1.0 moves the level by ±0.07 m.
- **Waves, webcam** (`tools/waves-yt.mjs`). Image space only, since a period needs no georeferencing.
  1. ffmpeg decodes at 10 fps, 640×360, into a grey band of the sea.
  2. Per pixel: detrend, then a Welch spectrum (205 s Hann segments, 50% overlap) plus a full-record periodogram.
  3. Spectra are averaged over three row bands, outer to inner surf.
  4. The nahant:ansel pose (`cam-yt-KziwCV7db9s/pose_kz7w.json`) and clock (latency 0.57 ± 0.22 s) appeared late and were not needed.
- **Tide** (`tools/tide.mjs`). CO-OPS 6-min preliminary data and predictions are interpolated to 15:56:47Z. Lynn predictions on MSL are moved to NAVD88 with Boston's MSL − NAVD88 offset (−0.092 m). CUDEM is sampled through the NCEI ImageServer `getSamples`, raster locked to `ncei19_n42x50_w071x00_2021v1`.

**Software: JavaScript only** (Node + sharp + ffmpeg, with an in-house radix-2 FFT in `tools/fft.mjs`). No Python was needed. The figures are SVG rendered to PNG by sharp, and each `.svg` is kept beside its PNG.

Reproduce, from `artifacts/rop/lynn-shore-nahant-circle/measurements/tools/`:

```
node --max-old-space-size=8000 stack.mjs
node --max-old-space-size=8000 vehicles.mjs
node --max-old-space-size=4000 vehicles-report.mjs
node --max-old-space-size=8000 waves-fk.mjs
ffmpeg -i ../../../../webcams/youtube/KziwCV7db9s_window.mp4 -vf "fps=10,scale=640:360,crop=640:100:0:228,format=gray" -f rawvideo C:/Users/steph/Documents/sites/_scratch/rop-bos/measure/yt/yt_gray_640x100_10fps.raw
node waves-yt.mjs
node --max-old-space-size=6000 waves-transects.mjs
node tide.mjs
node summary.mjs
```

Scratch (about 1 GB grey stack + median) is in `C:/Users/steph/Documents/sites/_scratch/rop-bos/measure/`, outside the bead.

## Findings for us (disagreements and caveats)

1. **Vertical datum (affects every height in the ROP).** `surface/dsm.json` says "true EGM96 MSL = h_calib − 6.9 m (geoid −28.6)". At Nahant, EGM96 is −28.18 m and EGM2008 is −28.10 m (GeographicLib), so that MSL is 0.4 m low here. For NAVD88 (the datum of the tide gauges and CUDEM): H = h_calib − 35.5 + 1.19 (ITRF2014 → NAD83(2011) Helmert, NGS parameters at this point) + 27.28 (GEOID18, NGS API) = **h_calib − 7.03 m**. See `tools/consts.mjs`. The nahant lane's `nahant-lib_kz7w.mjs` also uses −28.6. Worth a look by the owners.
2. **The waterline cannot measure the tide here.** At this tide (2.79 m MLLW, 1 h 40 min after the 14:17Z high water, falling 0.46 m/h) the sea is at the seawall everywhere. The Google 3D Tiles and true-ortho show a 40-60 m dry summer beach at a lower tide. The eastern revetment is a vertical step in a 2 m mesh. So the waterline only gives a lower bound. The water level came instead from **waves + bathymetry**, which was the stronger route anyway.
3. **Google beach vs CUDEM.** The Google beach surface sits 0.1-0.3 m above CUDEM 0-30 m from the wall (`figures/wall-foot-profiles.png`). Causes could be seasonal sand (a summer berm vs 2021 lidar) or the mesh's 2 m geometric error.
4. **Outer surf depth disagrees** (60-80 m: waves 1.4-2.2 m, CUDEM flat 1.2 m). Suspects: CUDEM interpolating across a lidar gap (the flat 1.2 m is suspicious), a shifted bar, wave nonlinearity, and the one-period record. A repeat with the longer, fused webcam record or a second 8K pass would separate these.
5. **8K period** is 13.3 s against 12.0 s from the webcam and buoys. With ~1 period in the record, the f-k frequency carries ±1.5 s. A secondary f-k peak at 7.2-7.5 s, travelling at the primary's speed, looks like the **bound second harmonic** of the 12-14 s swell (wavelength 26-29 m vs 24 m expected). Typical shallow-water nonlinearity.
6. **Speed limits are inferred, not observed.** Nobody has verified the 30 mph on Lynn Shore Drive or the circle on the ground. A street-view sign check would turn "statutory default" into "posted". Cars visible for only 1-9 s give spot speeds, and a car lost for > 2.5 s can appear twice in sequence. Traffic on the eastern half was light in this window.
7. **Not done.** (a) A georeferenced waterline from the webcam (its bottom-left corner shows wet sand and walkers). It needs the cam's eye height verified, because a 1 m height error is about 0.25 m in level. (b) Whitecap/wind direction. 44013 wind was W 2 m/s, nearly calm, with no whitecaps to measure.

## Sources

- NOAA CO-OPS API: `https://api.tidesandcurrents.noaa.gov/api/prod/datagetter` (8443970 water_level, predictions; 8443187 predictions) and mdapi datums/stations.
- NDBC: `https://www.ndbc.noaa.gov/data/realtime2/44013.txt`, `.spec`, `44029.txt` (the 44029 `.spec` returned 404), `activestations.xml`.
- OSM via Overpass (`overpass.private.coffee`; overpass-api.de returned 406), OSM base 2026-06-01.
- NOAA NCEI CUDEM: `https://gis.ngdc.noaa.gov/arcgis/rest/services/DEM_mosaics/DEM_all/ImageServer/getSamples`.
- NGS GEOID18 API `https://geodesy.noaa.gov/api/geoid/ght`; GeographicLib GeoidEval.
- Limits context: [CTPS Lynnway study 2016](https://www.ctps.org/data/calendar/htmls/2016/MPO_0623_Lynnway_Study.html), [MGL c.90 §17C](https://malegislature.gov/Laws/GeneralLaws/PartI/TitleXIV/Chapter90/Section17C), [Lynn Shore Drive (Wikipedia)](https://en.wikipedia.org/wiki/Lynn_Shore_Drive).
