examples/a2/reuse_calibration.py

examples/a2/reuse_calibration.py#

 1# Copyright (c) Acconeer AB, 2025-2026
 2# All rights reserved
 3
 4from acconeer.exptool import a2
 5
 6
 7"""
 8First session - Setup session without calibration
 9                Sensor will calibrate during setup
10"""
11
12with a2.Client.open() as client:
13    client.setup_session(a2.SessionConfig.default())
14
15    calibration = client.calibration
16
17    """
18    client.calibrations_provided will be equal to False since calibration was not provided
19    """
20    print(
21        f"Setup without provided calibration ==> calibration_provided = {client.calibration_provided}"
22    )
23
24    client.start_session()
25
26    result = client.get_next()
27    print("client tick:", result.tick)
28
29    client.stop_session()
30
31
32"""
33Second session - Setup session with calibration
34                 Sensor will reuse calibration and not calibrate during setup
35"""
36
37with a2.Client.open() as client:
38    client.setup_session(a2.SessionConfig.default(), calibration=calibration)
39
40    """
41    client.calibrations_provided will be equal to True since calibration was provided
42    """
43    print(
44        f"Setup with provided calibration ==> calibration_provided = {client.calibration_provided}"
45    )
46
47    client.start_session()
48
49    result = client.get_next()
50    print("client tick:", result.tick)
51
52    client.stop_session()

View this example on GitHub: acconeer/acconeer-python-exploration