-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathc3d_marker_check.py
44 lines (28 loc) · 973 Bytes
/
c3d_marker_check.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import os
from pathlib import Path
from textwrap import fill
from typing import NamedTuple
import ezc3d
import functools
class Context(NamedTuple):
py_file: str
fun_name: str
anyfun_full_name: str
anyfunex_file: str
anyfunex_line: str
call_location_file:str
def check_c3d_file(context: Context, c3d_file: str):
""" Check if fpath is a writeable file """
report_str = (
"This is an example of analyzing a c3d file.\n" +
"If nothing is returned from python the warning will not be triggered.\n"
)
if not os.path.isfile(c3d_file):
return f"{c3d_file} is not a file\n\n"
c3d = ezc3d.c3d(c3d_file)
points_used = c3d['parameters']['POINT']['USED']['value'][0]; # Print the number of points used
point_data = c3d['data']['points']
report_str += f"Number of Points in c3d file: {points_used}\n"
return report_str
if __name__ == "__main__":
check_c3d_file("test.c3d")