rewrite.lib.daq package¶
Submodules¶
rewrite.lib.daq.Connection module¶
-
class
rewrite.lib.daq.Connection.DAQConnection(in_queue, out_queue, logger=None)[source]¶ Bases:
objectDAQ Connection class.
Raises SystemError if serial connection cannot be established.
Parameters: - logger (logging.Logger) – logger object
- in_queue – input queue
- out_queue – output queue
Raises: SystemError
rewrite.lib.daq.DAQServer module¶
-
class
rewrite.lib.daq.DAQServer.DAQServer[source]¶ Bases:
object-
do(msg)[source]¶ Send a command to the DAQ card and remove repeated responses from the outqueue if data taking is turned off. Otherwise just send the command to the card.
-
get_scalars(msg=None)[source]¶ If running=True, read out scalars from the counterqueue. Otherwise, read scalars from given message. Returns the scalar values.
-
get_temp_and_pressure()[source]¶ Read out temperature and pressure data. Pressure data in unit counts and mBar. If no measurement is running returns temperature, pressure, pressure_mbar
-
measure_pulses(meastime=None)[source]¶ Measure pulses (rising and falling edge times) of trigger events. Using PulseExtractor from muonic. :param meastime: Total measurement time in minutes. Default is None.
-
process_incoming()[source]¶ Sort messages received from the DAQ card and store them in separate queues.
-
read_scalars()[source]¶ Read the scalars of all channels. If no measurement is running, returns scalar values: ch0, ch1, ch2, ch3, trigger
-
set_threashold(th_0=300, th_1=300, th_2=300, th_3=300)[source]¶ Set the threasholds for the channels of the DAQ card. Default value for all channels is 300.
-
setup_channel(ch0=False, ch1=False, ch2=False, ch3=False, coincidence='single')[source]¶ Enable/Disable channels of the DAQ card and set coincidence settings.
-
rewrite.lib.daq.Exceptions module¶
Utility classes and functions needed by DAQ related modules
rewrite.lib.daq.Provider module¶
-
class
rewrite.lib.daq.Provider.DAQProvider(logger=None)[source]¶ Bases:
objectClass providing the public API and helpers for the communication with the DAQ card
-
LINE_PATTERN= re.compile("^[a-zA-Z0-9+-.,:()=$/#?!%_@*|~' ]*[\n\r]*$")¶
-
get(*args)[source]¶ Get data from the DAQ card.
Raises DAQIOError if the queue is empty.
Parameters: args (list) – queue arguments Returns: str or None – next item from the queue Raises: DAQIOError
-