Repository navigation
solve errors in acceleration computation and adjust user guide #588
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
7239b6f
7db436c
1e19032
b6f3d09
7587a81
ced1d54
de57a97
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1002,8 +1002,8 @@ def _compute_movement_acceleration_exclude_border( | |
| ) -> pd.DataFrame: | ||
| """Compute the individual movement in the time interval frame_step. | ||
|
|
||
| The movement is computed for the interval [frame - frame_step: frame + | ||
| frame_step], if one of the boundaries is not contained in the trajectory | ||
| The movement is computed for the interval [frame - 2 * frame_step: frame + | ||
| 2 * frame_step], if one of the boundaries is not contained in the trajectory | ||
| frame these points will not be considered. | ||
|
|
||
| Args: | ||
|
|
@@ -1022,16 +1022,16 @@ def _compute_movement_acceleration_exclude_border( | |
| """ | ||
| df_movement = traj_data.data.copy(deep=True) | ||
|
|
||
| df_movement[START_POSITION_COL] = df_movement.groupby(by=ID_COL).point.shift(2 * frame_step) | ||
| df_movement["start_frame"] = df_movement.groupby(by=ID_COL).frame.shift(2 * frame_step) | ||
| df_movement[START_POSITION_COL] = df_movement.groupby(by=ID_COL).point.shift(-2 * frame_step) | ||
| df_movement["start_frame"] = df_movement.groupby(by=ID_COL).frame.shift(-2 * frame_step) | ||
|
|
||
| df_movement[MID_POSITION_COL] = df_movement.groupby(by=ID_COL).point.shift(frame_step) | ||
| df_movement["mid_frame"] = df_movement.groupby(by=ID_COL).frame.shift(frame_step) | ||
| df_movement[MID_POSITION_COL] = df_movement.point | ||
| df_movement["mid_frame"] = df_movement.frame | ||
|
|
||
| df_movement[END_POSITION_COL] = df_movement.point | ||
| df_movement["end_frame"] = df_movement.frame | ||
| df_movement[END_POSITION_COL] = df_movement.groupby(by=ID_COL).point.shift(2 * frame_step) | ||
| df_movement["end_frame"] = df_movement.groupby(by=ID_COL).frame.shift(2 * frame_step) | ||
|
|
||
| df_movement[WINDOW_SIZE_COL] = df_movement.end_frame - df_movement.mid_frame | ||
| df_movement[WINDOW_SIZE_COL] = df_movement.end_frame - df_movement.start_frame | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is where window_size becomes −4n.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, this is natural because we use the speed difference (each speed calculated using delta_t=2n/fps) between two time points which are delta_t=2n/fps apart as explained in the doctoring/user guide: |
||
| return df_movement[ | ||
| [ | ||
| ID_COL, | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
start and end are swapped. Start uses
shift(-2n), which is the future, and end usesshift(2n), which is the past. Purely semantics, otherwise here and the speed movement calculation use different notations for start and end