soft-matter / trackpy

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

Add 2 particle correlation function #393

Open Resonanz opened 8 years ago

Resonanz commented 8 years ago

Hey there Nathan, Daniel suggested I ask you..... do you have any code written for trackpy that would do 2 particle correlations? TIA.

nkeim commented 8 years ago

Hi! That's funny, I would have sent you to @danielballan with that question. I don't know of any "stable" code of this kind, and danielballan/mr is the only unstable code I know of.

There is a validated 2-particle code in Matlab by the Kilfoil group. That could also serve as a starting point.

danielballan commented 8 years ago

Ha. For some reason I thought you had an unstable version of that floating around as well. If we add this, it's an ideal target for numba.

Resonanz commented 8 years ago

Thanks. I see the Kilfoil group has some nice Matlab and Python code available for tracking... seems pretty comprehensive. I might look at converting their Matlab code for 2-particle correlations into Python in a few months if I get the chance... could you guys assist in any way? I see the comment about using numba... could you elaborate Daniel? Thanks.

danielballan commented 8 years ago

You should also look at the Crocker-Grier implementation in IDL, upon which I think that Kilfoil code is based. (If I'm thinking of the right codebase, it looks like they just edited the IDL code directly until it was valid Matlab code.)

I would happily review and provide guidance if you want to work on that.

Once the code is far enough along that it gives correct answers, we might look at using numba to make it run faster. Two-point is an expensive algorithm -- typical experiments can take days to run. In Python, part of the slowness comes from explicit for loops. Numba can make these fast.

Resonanz commented 8 years ago

Thanks, super helpful ! Not sure if the 2P work is available in IDL. Kilfoil certainly have it in Matlab.

danielballan commented 8 years ago

This is the IDL code I'm thinking of: http://www.physics.emory.edu/faculty/weeks//idl/msd2pnt.html

Resonanz commented 8 years ago

Thanks Daniel. I have read the a paper. Seems like a nice piece of work. Trackpy would benefit from having 2P !!! Looking into it...

caspervdw commented 7 years ago

@Resonanz any news of the 2P correlation in python?

Resonanz commented 7 years ago

No, sorry, I have been unable to get back onto particle tracking. Time is the enemy :-)

caspervdw commented 7 years ago

@Resonanz ok I will leave this issue open until someone implements two particle correlations in trackpy.