nilspodlib.calibration_utils.find_calibrations_for_sensor#

nilspodlib.calibration_utils.find_calibrations_for_sensor(sensor_id: str, folder: Optional[path_t] = None, recursive: bool = True, filter_cal_type: Optional[str] = None, custom_validator: Optional[Callable[[CalibrationInfo], bool]] = None, ignore_file_not_found: Optional[bool] = 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

The for 4 letter/digit identifier of a sensor_type, as obtained from nilspodlib.header.Header.sensor_id

folder

Basepath of the folder to search. If None, tries to find a default calibration

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 could cause performance issues with many calibration files. If None, all found files will be returned. For possible values, see the imucal library.

custom_validator

A custom function that will be called with the CalibrationInfo object of each potential match. This needs to 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 nilspodlib.calibration_utils.find_calibrations_for_sensor#

Performing a Ferraris Calibration with a Nilspod

Performing a Ferraris Calibration with a Nilspod

Performing a Ferraris Calibration with a Nilspod