trackpy.static.cluster¶
- trackpy.static.cluster(f, separation, pos_columns=None, t_column='frame')¶
Cluster features from one or several frames.
A cluster is defined as the largest group of features of which each feature has at least one feature closer than
separation
.- Parameters:
- f: DataFrame
pandas DataFrame containing pos_columns and t_column
- separation: number or tuple
Separation distance below which particles are considered inside cluster
- pos_columns: list of strings, optional
Column names that contain the position coordinates. Defaults to [‘y’, ‘x’] (or [‘z’, ‘y’, ‘x’] if ‘z’ exists)
- t_column: string
Column name containing the frame number (Default: ‘frame’)
- Returns:
- Copy of
f
with added “cluster” and “cluster_size” column
- Copy of