Conversation
It was negated in original neaps implementation, and that was preserved when adopting the IHO implementation.
What the commit changesTwo coupled modifications to the tide prediction algorithm:
Mathematical analysis of correctnessThe two changes interact. For any constituent with species number d₁ and seventh XDO digit D₇:
The net change is
The 21 affected constituents include: S1, M3, S3, MS1, MP1, M1C, SK1, SP1, MO1, MQ1, MPS2, MSP2, 2MS3, MS3, 3MS5, 2MS5, MSK5, M7, MA9, NK1, Sta. Most are minor, but M3 (third harmonic of M2) can be significant at some stations. Which convention is correct?This is the crux. Two internally-consistent conventions exist:
The argument for the new code is that the IHO XDO system should uniformly apply offset-by-5 to all of D₂–D₇, and T should be from lower transit (midnight). The argument for the old code is that it produces better predictions against NOAA data. Benchmark impact (3,368 NOAA stations, 3-day window)
Per-station breakdown: 2,109 stations degraded, 453 improved, 805 unchanged. 590 stations had MAE increase >1 cm, vs only 2 improved >1 cm. InterpretationThe The old code's convention — even though it appears inconsistent (negating D₇ while not negating D₂–D₆) — aligns more closely with how NOAA computes its published harmonic constants and predictions. NOAA uses Schureman-convention harmonics where T is measured from noon. The published phase values (κ) in the harmonic constants are referenced to this convention. Changing the V₀ computation convention without also adjusting the published phase values creates a systematic error. Key concern: the tolerance wideningThe test at packages/neaps/test/index.test.ts:222 widened the NOAA matching tolerance from 5 minutes to 8 minutes. Combined with the benchmark results showing p95 timing going from 6.3 to 8.6 minutes, this is masking a real accuracy regression. RecommendationThe change should not be merged as-is. While the commit's reasoning about IHO convention consistency is plausible, the empirical evidence is clear: it makes predictions measurably worse against NOAA ground truth across 3,368 stations. The old "inconsistent" convention was actually correct for use with NOAA-published harmonic constants, because those constants were fitted using the Schureman convention (T from noon, negated D₇). If you want to adopt the IHO convention in the future, the harmonic phase values (κ) from station data would need to be adjusted by 180° for the 21 affected constituents to compensate — otherwise you're mixing conventions. |
Extracting this commit from #238 to review and discuss separately.
The 7th doodson number was negated in original neaps implementation to be consistent with the Schureman/NOAA equations, and that was preserved when adopting the IHO constituent definitions in #208. The problem with this change is that it actually makes the NOAA benchmarks worse. 😭
To quote Claude from Why the IHO List Has Duplicate Constituent Definitions:
I'm finally starting to understand why xtide embeds pre-computed equilibrium args and node factors in the TCD.