soft-matter / trackpy

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

Error in walkthrough guide during particle filtering #775

Open imruffin opened 2 months ago

imruffin commented 2 months ago

Cell 23 in the walkthrough removes individual timesteps that are not compliant, but it needs to remove the entire bad particle trajectory: t2 = t1[((t1['mass'] > 50) & (t1['size'] < 2.6) & (t1['ecc'] < 0.3))] should be something like: t1_means = t1.groupby('particle').mean() good_particles = t1_means[(t1_means['mass'] > 50) & (t1_means['size'] < 2.6) & (t1_means['ecc']<0.3)] # particle id is index of good_particles t2 = t1[t1['particle'].isin(good_particles.index)]