-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathstart_nanocet.py
35 lines (30 loc) · 1.27 KB
/
start_nanocet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import logging
from time import sleep
from pynta.model.experiment.nanoparticle_tracking.np_tracking import NPTracking
from pynta.util.log import get_logger
logger = get_logger() # 'nanoparticle_tracking.model.experiment.nanoparticle_tracking.saver'
logger.setLevel(logging.DEBUG)
ch = logging.StreamHandler()
ch.setLevel(logging.DEBUG)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
logger.addHandler(ch)
if __name__ == '__main__':
with NPTracking('config/nanocet.yml') as exp:
sleep(1)
# exp.connect(calculate_positions_image, 'free_run', exp.publisher_queue, **exp.config['tracking']['locate'])
# exp.connect(add_to_save_queue, 'free_run', exp.saver_queue)
# exp.connect(add_linking_queue, 'trackpy_locations', exp.locations_queue)
# exp.connect(add_links_to_queue, 'particle_links', exp.tracks_queue)
exp.initialize_camera()
# exp.link_particles()
exp.save_stream()
sleep(1)
exp.start_free_run()
logger.info('Going to sleep for 5 seconds')
sleep(5)
logger.info('Keep acquiring set to false')
exp.keep_acquiring = False
logger.info('Sleeping for 2 seconds')
sleep(2)
# exp.plot_histogram()