soft-matter / trackpy

Python particle tracking toolkit
http://soft-matter.github.io/trackpy
Other
445 stars 131 forks source link

How to use build-in predictors? #612

Closed KalterHund closed 4 years ago

KalterHund commented 4 years ago

Are there any docs on how to use build-in predictors like NearestVelocityPredict? Tried the following but it doesn't seem to work, since there are still situations where the velocity of a track is ignored and another nearby particle is taken instead, resulting in a new trajectory. I further investigated the code and it seems like the NearestVelocityPredict.observe, which is building up the velocity field, is never called.

pred = trackpy.predict.NearestVelocityPredict()
linked_data_frame = trackpy.link(data_frame, 45, pos_columns=['X','Y'], t_column = 'Slice', memory=3, adaptive_step=0.95, predictor=pred.predict)
nkeim commented 4 years ago

Hi! You should look at the prediction tutorial in the documentation. If you have suggestions about that documentation, please create an issue and/or pull request!

The observe method is called from within trackpy.link() and similar functions.

nkeim commented 4 years ago

Sorry, I just saw that the equations in that tutorial are not displaying correctly. If that bothers you, you can view the original Jupyter notebook in the repository at https://github.com/soft-matter/trackpy-examples