-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrunCosmo.py
More file actions
executable file
·47 lines (36 loc) · 1.53 KB
/
Copy pathrunCosmo.py
File metadata and controls
executable file
·47 lines (36 loc) · 1.53 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# script runCosmo.py
"""
**runCosmo** run Data Aquisition with Picoscpe
(modified version of runDAQ from picoDAQ project)
Relies on python drivers by Colin O'Flynn and Mark Harfouche,
see https://github.com/colinoflynn/pico-python
and on package *picodaqa*,
see https://github.com/GuenterQuast/picoDAQ
- initialisation of picoScope device vial class picoConfig
- creates a BufferMan instance
- graphics implemented with matplotlib
tested with PS2000a, PS3000a and PS4000
- set up PicoScope channel ranges and trigger
- PicoScope configuration from yaml file
- acquire data (implemented as subprocess)
- manage event data and distribute to obligatory and random consumers
- analyse data: trigger validation, search for coincidences and double-pulses
- live plot of data rates, storage of filtered data (raw data and oscilloscope
pictures, double-pulse features)
This code simply calls the executable part of module picocosmo.runCosmoDAQ
"""
from picocosmo.runCosmoDAQ import *
import sys
import subprocess
if __name__ == "__main__": # - - - - - - - - - - - - - - - - - - - -
if len(sys.argv) != 2:
print("\n!!! runCosmo.py usage:\n" + 10 * ' ' + "runCosmo.py <config>.daq\n")
exit()
arg = sys.argv[1]
rc = subprocess.run(args=[sys.executable, '-m', 'picocosmo.runCosmoDAQ', arg])
if rc == 0:
print("*==* normal end")
else:
_ = input(f"!!! subprocess crashed rc={rc} !!!\n" + " type <ret> to end --> ")