Skip to content

Commit 062d83b

Browse files
accel data updated.
1 parent 406088c commit 062d83b

File tree

2 files changed

+54
-16
lines changed

2 files changed

+54
-16
lines changed

docs/examples/modules_02_icd.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff 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
228247
first_gait_sequence = gsd.gait_sequences_[gsd.gait_sequences_["event_type"] == "gait sequence"].iloc[0]
229248

examples/modules_02_icd.ipynb

Lines changed: 35 additions & 16 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)