databroker.Header.config_data¶
- Header.config_data(device_name)[source]¶
Extract device configuration data from Event Descriptors.
This refers to the data obtained from
device.read_configuration()
.See example below. The result is structed as a […deep breath…] dictionary of lists of dictionaries because:
The device might have been read in multiple event streams (‘primary’, ‘baseline’, etc.). Each stream name is a key in the outer dictionary.
The configuration is typically read once per event stream, but in general may be read multiple times if the configuration is changed mid-stream. Thus, a list is needed.
Each device typically produces multiple configuration fields (‘exposure_time’, ‘period’, etc.). These are the keys of the inner dictionary.
- Parameters
- device_namestring
device name (originally obtained from the
name
attribute of some readable Device)
- Returns
- resultdict
mapping each stream name (such as ‘primary’ or ‘baseline’) to a list of data dictionaries
Examples
Get the device configuration recorded for the device named ‘eiger’.
>>> h.config_data('eiger') {'primary': [{'exposure_time': 1.0}]}
Assign the exposure time to a variable.
>>> exp_time = h.config_data('eiger')['primary'][0]['exposure_time']
How did we know that
'eiger'
was a valid argument? We can query for the complete list of device names:>>> h.devices() {'eiger', 'cs700'}