pcdsdevices.sequencer.EventSequencer
- class pcdsdevices.sequencer.EventSequencer(prefix, *, name=None, monitor_attrs=None, **kwargs)
Event Sequencer.
The LCLS Event Sequencer implemented as an Flyer; i.e. it has the methods
kickoff()
,complete()
andcollect()
. This allows the EventSequencer to be used succinctly with thefly_during_wrapper
and associated preprocessor.- Parameters:
Examples
Run the EventSequencer throughout my scan: >>> fly_during_wrapper(scan([det], motor, …), [sequencer])
Run the EventSequencer at each step in my scan after completing the motor move and detector reading: >>> scan([sequencer], motor, ….)
Note
It is ambiguous what the correct behavior for the EventSequencer is when we pause and resume during a scan. The current implementation will stop the EventSequencer and restart the sequence from the beginning. This may impact applications which depend on a long single looped sequence running through out the scan.
Attribute
Class
Suffix
Docs
Kind
Notes
play_control
EpicsSignal
:PLYCTL
omitted
sequence_length
EpicsSignal
:LEN
config
current_step
EpicsSignal
:CURSTP
normal
play_count
EpicsSignal
:PLYCNT
normal
total_play_count
EpicsSignalRO
:TPLCNT
normal
play_status
EpicsSignalRO
:PLSTAT
normal
play_mode
EpicsSignal
:PLYMOD
config
sync_marker
EpicsSignal
:SYNCMARKER
config
next_sync
EpicsSignal
:SYNCNEXTTICK
config
pulse_req
EpicsSignal
:BEAMPULSEREQ
config
rep_count
EpicsSignal
:REPCNT
config
sequence_owner
EpicsSignalRO
:HUTCH_NAME
omitted
sequence
config
Methods
- collect()
Retrieve all collected data
- collect_tables() Iterable[Any]
Retrieve data from flyer as tables
PROPOSED
- Yields:
time (Iterable[Float])
data (dict)
timestamps (dict)
- complete()
Complete the EventSequencer’s current sequence.
The result of this method varies on the mode that the EventSequencer is configured. If the EventSequencer is either set to ‘Run Once’ or ‘Run N Times’ this method allows the current sequence to complete and returns a status object that indicates a successful completion. However, this mode of operation does not make sense if the EventSequencer is in ‘Run Forever’ mode. In this case, the EventSequencer is stopped immediately and a completed status object is returned.
- Returns:
status (DeviceStatus or SubscriptionStatus) – Status indicating completion of sequence.
Notes
If you want to stop the sequence from running regardless of configuration use the
stop()
command.
- configure(d: Dict[str, Any]) Tuple[Dict[str, Any], Dict[str, Any]]
Configure the device for something during a run
This default implementation allows the user to change any of the
configuration_attrs
. Subclasses might override this to perform additional input validation, cleanup, etc.- Parameters:
d (dict) – The configuration dictionary. To specify the order that the changes should be made, use an OrderedDict.
- Returns:
(old, new) tuple of dictionaries
Where old and new are pre- and post-configure configuration states.
- describe() OrderedDictType[str, Dict[str, Any]]
Provide schema and meta-data for
read()
.This keys in the
OrderedDict
this method returns must match the keys in theOrderedDict
return byread()
.This provides schema related information, (ex shape, dtype), the source (ex PV name), and if available, units, limits, precision etc.
- Returns:
data_keys (OrderedDict) – The keys must be strings and the values must be dict-like with the
event_model.event_descriptor.data_key
schema.
- describe_collect()
Description of monitored attributes retrieved by collect
- get(**kwargs)
Get the value of all components in the device
Keyword arguments are passed onto each signal.get(). Components beginning with an underscore will not be included.
- kickoff()
Start the EventSequencer.
- Returns:
status (~ophyd.status.SubscriptionStatus) – Status indicating whether or not the EventSequencer has started.
- post_elog_status()
Post device status to the primary elog, if possible.
- read() OrderedDictType[str, Dict[str, Any]]
Read data from the device.
This method is expected to be as instantaneous as possible, with any substantial acquisition time taken care of in
trigger()
.The
OrderedDict
returned by this method must have identical keys (in the same order) as theOrderedDict
returned bydescribe()
.By convention, the first key in the return is the ‘primary’ key and maybe used by heuristics in
bluesky
.The values in the ordered dictionary must be dict (-likes) with the keys
{'value', 'timestamp'}
. The'value'
may have any type, the timestamp must be a float UNIX epoch timestamp in UTC.- Returns:
data (OrderedDict) – The keys must be strings and the values must be dict-like with the keys
{'value', 'timestamp'}
- read_configuration() OrderedDictType[str, Dict[str, Any]]
Dictionary mapping names to value dicts with keys: value, timestamp
To control which fields are included, change the Component kinds on the device, or modify the
configuration_attrs
list.
- screen()
Open a screen for controlling the device.
Default behavior is the typhos screen, but this method can be overridden for more specialized screens.
- start()
Start the EventSequencer.
- summary()
- trigger()
Trigger the EventSequencer.
This method reconfigures the EventSequencer to take a new reading. This means:
Stopping the EventSequencer if it is already running
Restarting the EventSequencer
The returned status object will indicate different behavior based on the configuration of the EventSequencer itself. If set to ‘Run Forever’, the status object merely indicates that we have succesfully started our sequence. Otherwise, the status object will be completed when the sequence we have set it to play is complete.
Attributes
- configuration_attrs
- connected
- hints
- kind