ETracker.save_calibration
ETracker.save_calibration(
filename=None,
use_gui=False,
screen=-1,
alwaysOnTop=True,
)Save the current calibration data to a file.
Retrieves the active calibration data from the connected Tobii eye tracker and saves it as a binary file. This can be reloaded later with load_calibration() to avoid re-calibrating the same participant.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| filename | str | None | Desired output path. If None and use_gui is False, a timestamped default name is used (e.g., ‘YYYY-mm-dd_HH-MM-SS_calibration.dat’). If provided without an extension, ‘.dat’ is appended. If an extension is already present, it is left unchanged. |
None |
| use_gui | bool | If True, opens a file-save dialog (Psychopy) where the user chooses the path. The suggested name respects the logic above. Default False. | False |
| screen | int | Screen number where the GUI dialog is displayed. Only used when use_gui=True. If -1 (default), the dialog appears on the primary screen. Use 0, 1, 2, etc. to specify other monitors. Ignored when use_gui=False. |
-1 |
| alwaysOnTop | bool | Whether the GUI dialog stays on top of other windows. Only used when use_gui=True. Default is True to prevent the dialog from being hidden behind experiment windows. Ignored when use_gui=False. |
True |
Returns
| Name | Type | Description |
|---|---|---|
| bool | True if saved successfully; False if cancelled, no data available, in simulation mode, or on error. |
Details
- In simulation mode, saving is skipped and a warning is issued.
- If
use_guiis True and the dialog is cancelled, returns False.
Examples
Save with default timestamped name
ET_controller.save_calibration()Save with specified filename
ET_controller.save_calibration('subject_01_calib.dat')Use GUI to choose save location
ET_controller.save_calibration(use_gui=True)GUI on secondary monitor
ET_controller.save_calibration(use_gui=True, screen=1, alwaysOnTop=False)