Skip to contents

Enriches predicted fishing track points with time-based effort, H3 cell assignment, and per-trip total hours (used downstream for the fidelity metric). For each trip the inter-ping time interval (`dt_hours`) is computed from consecutive timestamps and capped at 4 hours to guard against GPS-off gaps inflating effort estimates.

Usage

prepare_tracks_for_effort(df, h3_res)

Arguments

df

Data frame of predicted fishing points with columns `trip`, `timestamp`, `latitude`, `longitude`.

h3_res

Integer (0–15). H3 resolution for cell assignment.

Value

The input data frame with additional columns:

`year`

Integer year extracted from `timestamp`.

`dt_hours`

Interval in hours to the previous ping within the same trip (0 for the first ping; capped at 4).

`h3_index`

H3 cell identifier at resolution `h3_res`.

`trip_total_hours`

Total fishing hours for the trip across all H3 cells (sum of `dt_hours` within the trip). Used to compute the per-cell trip share for the fidelity metric.