mdx.mtmc.core.calibration module

class Calibrator(config: AppConfig | None)

Bases: object

Module to calibrate sensors

Parameters:

config (Optional[AppConfig]) – configuration for the app

calibrator = Calibrator(config)
calibrate(calibration_path: str) Dict[str, SensorStateObject]

Calibrates sensors

Parameters:

calibration_path (str) – path to the calibration file in JSON format

Returns:

map from sensor IDs to sensor state objects

Return type:

Dict[str,SensorStateObject]

sensor_state_objects = calibrator.calibrate(calibration_path)
convert_sensor_to_sensor_state_object(sensor: Sensor) SensorStateObject

Converts a sensor to a sensor state object

Parameters:

sensor (Sensor) – sensor object

Returns:

converted sensor state object

Return type:

SensorStateObject

sensor_state_object = calibrator.convert_sensor_to_sensor_state_object(sensor)
load_calibration_file(calibration_path: str) List[Sensor]

Loads from a calibration file in JSON format

Parameters:

calibration_path (str) – path to the calibration file in JSON format

Returns:

list of sensors

Return type:

List[Sensor]

sensors = calibrator.load_calibration_file(calibration_path)
load_sensors(calibration_info: Dict[str, Any]) List[Sensor]

Loads sensors

Parameters:

calibration_info (Dict[str,Any]) – calibration information in JSON format

Returns:

list of sensors

Return type:

List[Sensor]

sensors = calibrator.load_sensors(calibration_info)