# Reference for flowtracks.pairs¶

Pair particles to closest tracers.

flowtracks.pairs.particle_pairs(primary_trajects, secondary_trajects, trajids, time_points)[source]

For each of a set of select particles in the primary trajectories, find the closest particle in the secondary set.

Arguments

• primary_trajects: a list of Trajectory objects, some of which contain the source points.
• secondary_trajects: a list of Trajectory objects, in which to look for the pair points.
• trajid, time_points: each an n-length array for n pairs to produce, holding correspondingly the trajectory id and index into the trajectory of the points in the primary set to which a pair is sought.

Returns

• pair_trid, pair_time: coordinates of the found pairs, element i describes the pair of particle i in (trajid, time_points). Format is the same as that of trajid, time_points. For particles without a match, returns -1 as the pair_time value.