trackpy.motion.msd#
- trackpy.motion.msd(traj, mpp, fps, max_lagtime=100, detail=False, pos_columns=None)#
Compute the mean displacement and mean squared displacement of one trajectory over a range of time intervals.
- Parameters:
- trajDataFrame with one trajectory, including columns frame, x, and y
- mppmicrons per pixel
- fpsframes per second
- max_lagtimeintervals of frames out to which MSD is computed
Default: 100
- detailSee below. Default False.
- Returns:
- DataFrame([<x>, <y>, <x^2>, <y^2>, msd], index=t)
If detail is True, the DataFrame also contains a column N, the estimated number of statistically independent measurements that comprise the result at each lagtime. Where gaps make the MSD undefined, N is set to 0. All N values are then rescaled to make the total unchanged, so that the particle will be weighted correctly in an ensemble calculation.
Notes
Input units are pixels and frames. Output units are microns and seconds. Outputs NaN for lag times that could not be measured, due to gaps.