Note
Click here
to download the full example code
Temporal parameters calculation
This example illustrates how temporal parameters can be calculated for each stride by
the TemporalParameterCalculation.
Getting stride list
For this we need stride event list that can be obtained from event detection method.
Creating TemporalParameterCalculation object
We need this object for calculating the temporal parameters.
Temporal parameters are calculated based on ic and tc events
Inspecting the results
The main output is the parameters_, which contains the temporal parameters for each stride in format of data frame
in case of single sensor or dictionary of data frames for multiple sensors.
As our passed stride_list here consists of two sensors, the output will be a dictionary.
|
stride_time |
swing_time |
stance_time |
| s_id |
|
|
|
| 0 |
1.069336 |
0.346680 |
0.722656 |
| 1 |
1.074219 |
0.361328 |
0.712891 |
| 2 |
1.069336 |
0.351562 |
0.717773 |
| 3 |
1.069336 |
0.351562 |
0.717773 |
| 4 |
1.049805 |
0.351562 |
0.698242 |
| 5 |
1.049805 |
0.351562 |
0.698242 |
| 6 |
1.049805 |
0.351562 |
0.698242 |
| 7 |
1.069336 |
0.361328 |
0.708008 |
| 8 |
1.079102 |
0.346680 |
0.732422 |
| 9 |
1.079102 |
0.356445 |
0.722656 |
| 10 |
1.103516 |
0.351562 |
0.751953 |
| 11 |
1.098633 |
0.361328 |
0.737305 |
| 12 |
1.152344 |
0.371094 |
0.781250 |
| 13 |
2.275391 |
1.499023 |
0.776367 |
| 14 |
1.162109 |
0.380859 |
0.781250 |
| 15 |
1.098633 |
0.356445 |
0.742188 |
| 16 |
1.069336 |
0.356445 |
0.712891 |
| 17 |
1.083984 |
0.361328 |
0.722656 |
| 18 |
1.059570 |
0.351562 |
0.708008 |
| 19 |
1.079102 |
0.351562 |
0.727539 |
| 20 |
1.088867 |
0.351562 |
0.737305 |
| 21 |
1.088867 |
0.346680 |
0.742188 |
| 22 |
1.103516 |
0.361328 |
0.742188 |
| 23 |
1.108398 |
0.380859 |
0.727539 |
| 24 |
1.108398 |
0.356445 |
0.751953 |
| 25 |
1.123047 |
0.371094 |
0.751953 |
| 26 |
1.127930 |
0.361328 |
0.766602 |
| 27 |
1.132812 |
0.371094 |
0.761719 |
parameters_pretty_ is another version of parameters_ but using human readable column names that indicate units.
p.parameters_pretty_["left_sensor"]
|
stride time [s] |
swing time [s] |
stance time [s] |
| stride id |
|
|
|
| 0 |
1.069336 |
0.346680 |
0.722656 |
| 1 |
1.074219 |
0.361328 |
0.712891 |
| 2 |
1.069336 |
0.351562 |
0.717773 |
| 3 |
1.069336 |
0.351562 |
0.717773 |
| 4 |
1.049805 |
0.351562 |
0.698242 |
| 5 |
1.049805 |
0.351562 |
0.698242 |
| 6 |
1.049805 |
0.351562 |
0.698242 |
| 7 |
1.069336 |
0.361328 |
0.708008 |
| 8 |
1.079102 |
0.346680 |
0.732422 |
| 9 |
1.079102 |
0.356445 |
0.722656 |
| 10 |
1.103516 |
0.351562 |
0.751953 |
| 11 |
1.098633 |
0.361328 |
0.737305 |
| 12 |
1.152344 |
0.371094 |
0.781250 |
| 13 |
2.275391 |
1.499023 |
0.776367 |
| 14 |
1.162109 |
0.380859 |
0.781250 |
| 15 |
1.098633 |
0.356445 |
0.742188 |
| 16 |
1.069336 |
0.356445 |
0.712891 |
| 17 |
1.083984 |
0.361328 |
0.722656 |
| 18 |
1.059570 |
0.351562 |
0.708008 |
| 19 |
1.079102 |
0.351562 |
0.727539 |
| 20 |
1.088867 |
0.351562 |
0.737305 |
| 21 |
1.088867 |
0.346680 |
0.742188 |
| 22 |
1.103516 |
0.361328 |
0.742188 |
| 23 |
1.108398 |
0.380859 |
0.727539 |
| 24 |
1.108398 |
0.356445 |
0.751953 |
| 25 |
1.123047 |
0.371094 |
0.751953 |
| 26 |
1.127930 |
0.361328 |
0.766602 |
| 27 |
1.132812 |
0.371094 |
0.761719 |
Total running time of the script: ( 0 minutes 0.637 seconds)
Estimated memory usage: 9 MB
Gallery generated by Sphinx-Gallery