Tracking

Simple particle tracker based on liner programming.

Note

This module is used by StitchingWobbly to trace wobbly stacks.

match(positions_pre, positions_post, new_trajectory_cost=None, cutoff=None)[source]

Matches two set of positions.

Arguments

positions_prearray

The initial particle positions.

positions_postarray

The final particle positions.

new_trajectory_costfloat or None

The cost for a new trajectory, if None, maximal distance+1

cutofffloat or None:

The maximal distance allowed to connect particles.

Returns

matchdict

The optimal association as a dictionary {index_pre : index_post}.

optimal_association_matrix(cost)[source]

Optimizes the association matrix A given the cost matrix cost.

Arguments

costarray

The cost matrix, the last row and colum represent csot for particle creation/destruction.

Returns

associationarray

The optimal association matrix.

Note

It is assumed that creation/deletion of objects are the last row and column in cost.

References

A shortest augmenting path algorithm for dense and sparse linear assignment problems Jonker, R, Volgenant, A, Computing 1987

track_positions(positions, new_trajectory_cost=None, cutoff=None)[source]

Track positions of multiple particles.

Arguments

positionssarray

The particle positions as a list.

new_trajectory_costfloat or None

The cost for a new trajectory, if None, maximal distance+1

cutofffloat or None:

The maximal distance allowed to connect particles.

Returns

trajectorieslist

The trajectories as a list of list of (time,particle) tuples.

References

A shortest augmenting path algorithm for dense and sparse linear assignment problems Jonker, R, Volgenant, A, Computing 1987