This package contains a toy data acquisition consisting of a few classes simulating motors, sensors (diodes and cameras) and scanning.
from toydaq import Motor, Diode
mot = Motor("MY-MOTOR", units="mm")
dio = Diode("MY-DIODE")
There are three options for performing a scan:
- Callback
def cb_print():
print(mot, dio)
scan(mot, 0, 10, 1, cb=cb_print)
- Thread
from time import sleep
st = scan_thread(mot, 0, 10, 1)
while st.is_alive():
print(mot, dio)
sleep(0.1)
- Iterator
for pos in scan_iter(mot, 0, 10, 1):
print(pos, mot, dio)
Dependencies:
numpy
tqdm
The examples also use matplotlib
.