imucal.management.find_calibration_info_for_sensor#

imucal.management.find_calibration_info_for_sensor(sensor_id: str, folder: path_t, recursive: bool = True, filter_cal_type: str | None = None, custom_validator: Callable[[CalibrationInfo], bool] | None = None, ignore_file_not_found: bool | None = False) List[Path][source]#

Find possible calibration files based on the filename.

As this only checks the filenames, this might return false positives depending on your folder structure and naming.

Parameters:
sensor_id

A unique id to identify the calibrated sensor

folder

Basepath of the folder to search.

recursive

If the folder should be searched recursive or not.

filter_cal_type

Whether only files obtain with a certain calibration type should be found. This will look for the CalType inside the json file and hence cause performance problems. If None, all found files (over all potential subfolders) will be returned.

custom_validator

A custom function that will be called with the CalibrationInfo object of each potential match. This needs load the json file of each match and could cause performance issues with many calibration files.

ignore_file_not_found

If True this function will not raise an error, but rather return an empty list, if no calibration files were found for the specific sensor_type.

Returns:
list_of_cals

List of paths pointing to available calibration objects.

Examples using imucal.management.find_calibration_info_for_sensor#

Annotate a session and perform a Ferraris Calibration

Annotate a session and perform a Ferraris Calibration