lair.transects.transect_matrix#

lair.transects.transect_matrix(transit, point, obs, time, n_transits, n_points, max_dwell_s=None)[source]#

Average samples onto a [transit, point] matrix.

transit comes from split_transits() and point from snap_to_route() (-1 in either skips the sample); obs and time are per sample. With max_dwell_s, samples at a point taken more than that long after the transit first reached the point are dropped, so a platform sitting at a stop contributes a pass, not a long time-average, to that point.

Returns (obs, time, n): the mean observation, the mean POSIX time and the number of samples per cell, NaN where a transit has no sample at a point.

Parameters:
Return type:

tuple[ndarray, ndarray, ndarray]