lair.transects.split_transits#
- lair.transects.split_transits(time, s, max_gap_s=600.0, reversal_m=500.0, min_span_m=1000.0)[source]#
Cut a platform’s along-route coordinate into one-way transits.
sis the along-route position of each sample (metres; NaN where the sample is not on this route) andtimeis sorted. A transit endsat a time gap longer than
max_gap_s(overnight, or the record stops), orat a reversal of the direction of travel: a turning point of
swith prominence of at leastreversal_m(scipy.signal.find_peaksonsand on-s). GPS jitter and short shunts stay inside a transit; a turnaround at a terminus does not. A dwell at the terminus is cut at its middle, between the arriving and the departing transit (trim it withmax_dwell_sintransect_matrix()).
Transits covering less than
min_span_mof route are discarded.Returns
(transit, table):transitis the transit index per sample (-1 for samples not in a kept transit) andtablehas one row per transit, indexed by that number:direction(+1 with increasings, -1 against it),t_start,t_end(POSIX s),s_min,s_maxandnsamples.