File tree Expand file tree Collapse file tree 2 files changed +54
-16
lines changed Expand file tree Collapse file tree 2 files changed +54
-16
lines changed Original file line number Diff line number Diff line change @@ -224,6 +224,25 @@ The gait onset is represented with the vertical green line and the grey area rep
224224
225225
226226``` python
227+ # Load lower back acceleration data
228+ acceleration_data = recording.data[tracking_sys][
229+ [" pelvis_ACCEL_x" , " pelvis_ACCEL_y" , " pelvis_ACCEL_z" ]
230+ ]
231+
232+ # Get the corresponding unit of the acceleration data
233+ accel_unit = recording.channels[tracking_sys][
234+ recording.channels[tracking_sys][" name" ].str.contains(" ACCEL" , case = False )
235+ ][" units" ].iloc[0 ]
236+
237+ # Check unit of acceleration data
238+ if accel_unit in [" m/s^2" ]:
239+ pass # No conversion needed
240+ elif accel_unit in [" g" , " G" ]:
241+ # Convert acceleration data from "g" to "m/s^2"
242+ acceleration_data *= 9.81
243+ # Update unit of acceleration
244+ accel_unit = [" m/s^2" ]
245+
227246# Access the first detected gait sequence
228247first_gait_sequence = gsd.gait_sequences_[gsd.gait_sequences_[" event_type" ] == " gait sequence" ].iloc[0 ]
229248
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments