Loads calibration data from a file and applies it to the eye tracker.
This method allows reusing a previously saved calibration, which can save significant time for participants, especially in multi-session studies. The calibration data must be a binary file generated by a Tobii eye tracker, typically via the save_calibration() method. This operation is only available when connected to a physical eye tracker.
The path to the calibration data file (e.g., “subject_01_calib.dat”). If use_gui is True, this path is used as the default suggestion in the file dialog. If use_gui is False, this parameter is required.
Returns True if the calibration was successfully loaded and applied, and False otherwise (e.g., user cancelled the dialog, file not found, or data was invalid).
# ETracker.load_calibration { #DeToX.ETracker.load_calibration }```pythonETracker.load_calibration(filename=None, use_gui=False)```Loads calibration data from a file and applies it to the eye tracker.This method allows reusing a previously saved calibration, which can savesignificant time for participants, especially in multi-session studies.The calibration data must be a binary file generated by a Tobii eye tracker,typically via the `save_calibration()` method. This operation is onlyavailable when connected to a physical eye tracker.## Parameters {.doc-section .doc-section-parameters}| Name | Type | Description | Default ||----------|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------|| filename | [str](`str`) | The path to the calibration data file (e.g., "subject_01_calib.dat"). If `use_gui` is `True`, this path is used as the default suggestion in the file dialog. If `use_gui` is `False`, this parameter is required. | `None` || use_gui | [bool](`bool`) | If `True`, a graphical file-open dialog is displayed for the user to select the calibration file. Defaults to `False`. | `False` |## Returns {.doc-section .doc-section-returns}| Name | Type | Description ||--------|----------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|| | [bool](`bool`) | Returns `True` if the calibration was successfully loaded and applied, and `False` otherwise (e.g., user cancelled the dialog, file not found, or data was invalid). |## Raises {.doc-section .doc-section-raises}| Name | Type | Description ||--------|--------------------------------|-------------------------------------------------------------------|| | [RuntimeError](`RuntimeError`) | If the method is called while the ETracker is in simulation mode. || | [ValueError](`ValueError`) | If `use_gui` is `False` and `filename` is not provided. |## Examples {.doc-section .doc-section-examples}```python# Load calibration from specific filesuccess = ET_controller.load_calibration('subject_01_calib.dat')if success: ET_controller.start_recording('subject_01_data.h5')# Use GUI to select filesuccess = ET_controller.load_calibration(use_gui=True)# Multi-session workflow# Session 1: Calibrate and saveET_controller.calibrate(5)ET_controller.save_calibration('participant_123.dat')ET_controller.start_recording('session_1.h5')# ... run experiment ...ET_controller.stop_recording()# Session 2: Load previous calibrationET_controller.load_calibration('participant_123.dat')ET_controller.start_recording('session_2.h5')# ... run experiment ...ET_controller.stop_recording()```