|
9 | 9 |
|
10 | 10 | def import_axivity(file_path: str, tracked_point: str) -> tuple[pd.DataFrame, pd.DataFrame]: |
11 | 11 | """ |
12 | | - Imports Axivity data from the specified file path and |
13 | | - return the data and channel formatted to be used in a KielMATRecording object. |
| 12 | + Imports and processes data from an Axivity device file. |
14 | 13 |
|
15 | 14 | Args: |
16 | | - file_path (str or Path): The path to the Axivity data file. |
17 | | - tracked_point (str): The name of the tracked point. |
| 15 | + file_path (str): Path to the Axivity data file. |
| 16 | + tracked_point (str): Label for the tracked body point (e.g., 'wrist'). |
18 | 17 |
|
19 | 18 | Returns: |
20 | | - dict, dict: The loaded data and channels as dictionaries. |
| 19 | + tuple[pd.DataFrame, pd.DataFrame]: A tuple containing: |
| 20 | + - data (pd.DataFrame): Processed accelerometer data with time information. |
| 21 | + - channels (pd.DataFrame): Channel information DataFrame with metadata such as |
| 22 | + component, type, units, and sampling frequency. |
21 | 23 |
|
22 | | - Examples: |
23 | | - >>> file_path = "/path/to/axivity_data.cwa" |
24 | | - >>> tracked_point = "lowerBack" |
25 | | - >>> data, channels = import_axivity(file_path, tracked_point) |
| 24 | + Raises: |
| 25 | + ValueError: If no tracked point is provided. |
26 | 26 | """ |
27 | | - |
28 | 27 | # return an error if no tracked point is provided |
29 | 28 | if not tracked_point: |
30 | 29 | raise ValueError("Please provide a tracked point.") |
@@ -73,20 +72,21 @@ def import_mobilityLab( |
73 | 72 | tracked_points: str | list[str], |
74 | 73 | ) -> tuple[pd.DataFrame, pd.DataFrame]: |
75 | 74 | """ |
76 | | - Imports data from an APDM Mobility Lab system from the specified file path. |
| 75 | + Imports and processes data from an APDM Mobility Lab system file. |
77 | 76 |
|
78 | 77 | Args: |
79 | | - file_name (str or Path): The absolute or relative path to the data file. |
80 | | - tracked_points (str or list of str]): |
81 | | - Defines for which tracked points data are to be returned. |
| 78 | + file_name (str | Path): Path to the Mobility Lab HDF5 file. |
| 79 | + tracked_points (str | list[str]): Name or list of names for tracked body points to import. |
82 | 80 |
|
83 | 81 | Returns: |
84 | | - dict, dict: The loaded data and channels as dictionaries. |
85 | | -
|
86 | | - Examples: |
87 | | - >>> file_path = "/path/to/sensor_data.h5" |
88 | | - >>> tracked_points = "Lumbar" |
89 | | - >>> recording = import_mobilityLab(file_path, tracked_points) |
| 82 | + tuple[pd.DataFrame, pd.DataFrame]: A tuple containing: |
| 83 | + - data (pd.DataFrame): DataFrame with combined accelerometer, gyroscope, |
| 84 | + and magnetometer data for each tracked point. |
| 85 | + - channels (pd.DataFrame): DataFrame containing metadata, including sensor name, |
| 86 | + component, type, units, and sampling frequency. |
| 87 | +
|
| 88 | + Raises: |
| 89 | + ValueError: If any specified tracked point does not exist in the file's monitor labels. |
90 | 90 | """ |
91 | 91 | # Convert file_name to a Path object if it is a string |
92 | 92 | if isinstance(file_name, str): |
|
0 commit comments