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 hummingbird.backend.Worker(config_file, port)[source]¶
Bases:
object
Coordinates 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 hummingbird.backend.EventTranslator(event, source_translator)[source]¶
Bases:
object
Provides 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 hummingbird.backend.Record(name, data, unit=None, group=None)[source]¶
Bases:
object
Generic storage class for a name/data pair extracted from an event
Accept both values and functions for data. In the latter case the first time data is accessed evaluate the function and return its result.
- property data¶
- hummingbird.backend.add_record(values, group, name, data, unit=None)[source]¶
Convenience function to add a new Record to an existing Records dictionary.
hummingbird.backend.lcls¶
Translates between LCLS events and Hummingbird ones
- class hummingbird.backend.lcls.EPICSdict(epics)[source]¶
Bases:
object
Provides 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.
- class hummingbird.backend.lcls.LCLSTranslator(state)[source]¶
Bases:
object
Translate between LCLS events and Hummingbird ones
- event_id(evt)[source]¶
Returns an id which should be unique for each shot and increase monotonically
hummingbird.backend.euxfel¶
Online backend for reading EuXFEL events via the Karabo-bridge.
- class hummingbird.backend.euxfel.EUxfelTrainTranslator(state)[source]¶
Bases:
EUxfelTranslator
Translate between EUxfel train events and Hummingbird ones
hummingbird.backend.flash¶
Creates Hummingbird events for testing purposes