load_mobilised_matlab_format#

mobgap.data.load_mobilised_matlab_format(
path: PathLike,
*,
raw_data_sensor: Literal['SU', 'INDIP', 'INDIP2'] | None = 'SU',
reference_system: Literal['INDIP', 'Stereophoto'] | None = None,
sensor_positions: Sequence[str] = ('LowerBack',),
sensor_types: Sequence[Literal['acc', 'gyr', 'mag', 'bar']] = ('acc', 'gyr'),
missing_sensor_error_type: Literal['raise', 'warn', 'ignore'] = 'raise',
) dict[tuple[str, ...], MobilisedTestData][source]#

Load a single data.mat file formatted according to the Mobilise-D guidelines.

Parameters:
path

Path to the data.mat file.

raw_data_sensor

Which sensor to load the raw data for. One of “SU”, “INDIP”, “INDIP2”. SU is usually the “normal” lower back sensor. INDIP and INDIP2 are only available under special circumstances for the Mobilise-D TVS data.

reference_system

When specified, reference gait parameters are loaded using the specified reference system.

sensor_positions

Which sensor positions to load the raw data for. For “SU”, only “LowerBack” is available, but for other sensors, more positions might be available. If a sensor position is not available, an error is raised.

sensor_types

Which sensor types to load the raw data for. This can be used to reduce the amount of data loaded, if only e.g. acc and gyr data is required. Some sensors might only have a subset of the available sensor types. If a sensor type is not available, it is ignored.

missing_sensor_error_type

Whether to throw an error (“raise”), a warning (“warn”) or ignore (“ignore”) when a sensor is missing.

Returns:
data_per_test

A dictionary mapping the test names to the loaded data. The name of each test is a tuple of strings, where each string is a level of the test name hierarchy (e.g. (“TimeMeasure1”, “Test1”, “Trial1”)). The number of levels can vary between datasets. The data is returned as a MobilisedTestData named-tuple, which contains the raw data, (optional) reference parameters and metadata.

Notes

This data loader does not cover the entire Mobilise-D data format spec. We focus on the loading of the raw single-sensor data and the reference parameters. Further, we don’t support data files with sensors with different sampling rates or data files that don’t specify a start time per trial (but only a start time per test).

Examples using mobgap.data.load_mobilised_matlab_format#

Loading example data

Loading example data