Tracking Algorithms (pept.tracking)¶
Tracer location, identification and tracking algorithms.
The pept.tracking subpackage hosts different tracking algorithms, working with both the base classes, as well as with generic NumPy arrays.
All algorithms here are either pept.base.Filter or pept.base.Reducer
subclasses, implementing the .fit and .fit_sample methods; here is an
example using PEPT-ML:
>>> from pept.tracking import *
>>>
>>> cutpoints = Cutpoints(0.5).fit(lines)
>>> clustered = HDBSCAN(0.15).fit(cutpoints)
>>> centres = (SplitLabels() + Centroids() + Stack()).fit(clustered)
Once the processing steps have been tuned (see the Tutorials), you can chain all filters into a pept.Pipeline for efficient, parallel execution:
>>> pipeline = (
>>> Cutpoints(0.5) +
>>> HDBSCAN(0.15) +
>>> SplitLabels() + Centroids() + Stack()
>>> )
>>> centres = pipeline.fit(lines)
If you would like to implement a PEPT algorithm, all you need to do is to
subclass a pept.base.Filter and define the method .fit_sample(sample) -
and you get parallel execution and pipeline chaining for free!
>>> import pept
>>>
>>> class NewAlgorithm(pept.base.LineDataFilter):
>>> def __init__(self, setting1, setting2 = None):
>>> self.setting1 = setting1
>>> self.setting2 = setting2
>>>
>>> def fit_sample(self, sample: pept.LineData):
>>> processed_points = ...
>>> return pept.PointData(processed_points)
General-Purpose Transformers¶
|
Stack iterables - for example a |
|
Split a sample of data into unique |
|
Stack all samples and split them into a list according to a named / numeric column index. |
|
Compute the geometric centroids of a list of samples of points. |
|
Compute the minimum distance point of some |
|
Select only data satisfying multiple conditions, given as a string, a function or list thereof; e.g. |
|
Remove columns (either column names or indices) from pept.LineData or pept.PointData. |
Space Transformers¶
|
Asynchronously voxelize samples of lines from a pept.LineData. |
|
Interpolate between data points at a fixed sampling rate; useful for Eulerian fields computation. |
Tracer Locating Algorithms¶
|
The Birmingham Method is an efficient, analytical technique for tracking tracers using the LoRs from PEPT data. |
|
Transform LoRs (a pept.LineData instance) into cutpoints (a pept.PointData instance) for clustering, in parallel. |
|
Transform LoRs (a pept.LineData instance) into minpoints (a pept.PointData instance) for clustering, in parallel. |
|
Use HDBSCAN to cluster some |
|
FPI is a modern voxel-based tracer-location algorithm that can reliably work with unknown numbers of tracers in fast and noisy environments. |
Trajectory Separation Algorithms¶
|
Segregate the intertwined points from multiple trajectories into individual paths. |
Post Processing Algorithms¶
|
Append the dimension-wise or absolute velocity to samples of points using a 2D fitted polynomial in a rolling window mode. |