Fits tidal harmonic constituents from observed tide data. Produces a JSON model file for use with generate_location.py.
Place your tide data in the data/ folder. The scripts expect:
CSV files with columns:
datetime,height_m
2019-01-01 00:00:00,2.45
2019-01-01 00:01:00,2.46
...
CSV file with columns:
datetime,height_m,type
2019-01-01 06:23:00,4.82,HW
2019-01-01 12:45:00,0.58,LW
...
Fits 31 harmonic constituents with nodal corrections to minute data.
cd scripts/harmonic_fitting
python3 fit_nodal_fast.pyOutput: margate_nodal_fast.json
Fits empirical time correction (nodal cycle + seasonal) using HWLW data.
python3 fit_time_correction.py [--dataset pla_2019_2022|pla_2019_2026|pla_all]Output: margate_time_correction.json
After fitting, generate firmware config:
cd scripts
python3 generate_location.py \
--json harmonic_fitting/margate_nodal_fast.json \
--name "Your Location" \
--lat 51.38 --lon 1.39 \
--tz UKdata/margate/ contains:
- Minute data 2019-2026 (Port of London Authority)
- HWLW predictions 2010-2040