backend¶
Implements all the reading and translation of facility specific data streams into a unified format that can be used by the analysis package.
-
class
backend.Worker(config_file, port)[source]¶ Bases:
objectCoordinates data reading, translation and analysis.
This is the main class of the backend of Hummingbird. It uses a light source dependent translator to read and translate the data into a common format. It then runs whatever analysis algorithms are specified in the user provided configuration file.
- Args:
- config_file (str): The configuration file to load.
-
conf= None¶
-
event_loop()[source]¶ The event loop.
While
state['running']is True, it will get events from the translator and process them as fast as possible.
-
state= None¶
-
class
backend.EventTranslator(event, source_translator)[source]¶ Bases:
objectProvides the interface between the analysis code and the various translators.
The evt argument of onEvent(), which must be defined in every configuration file is actually an EventTranslator.
-
class
backend.Record(name, data, unit=None)[source]¶ Bases:
objectGeneric storage class for a name/data pair extracted from an event
-
backend.add_record(values, group, name, data, unit=None)[source]¶ Convenience function to add a new Record to an existing Records dictionary.
backend.lcls¶
Translates between LCLS events and Hummingbird ones
-
class
backend.lcls.EPICSdict(epics)[source]¶ Bases:
objectProvides a dict-like interface to EPICS parameters.
Translated all the parameters is too slow too slow. Instead parameters are only translated as they are needed, when they are accessed, using this class.