nabs.plan_stubs.measure_average

nabs.plan_stubs.measure_average(detectors, num, delay=None, stream=None)[source]

Measure an average over a number of shots from a set of detectors.

Parameters:
  • detectors (list) – List of detectors to read

  • num (int) – Number of shots to average together

  • delay (iterable or scalar, optional) – Time delay between successive readings. See bluesky.plans.count for more details

  • stream (nabs.streams.AverageStream, optional) – If a plan will call measure_average multiple times, a single AverageStream instance can be created and then passed in on each call. This allows other callbacks to subscribe to the averaged data stream. If no AverageStream is provided then one is created for the purpose of this function.

Returns:

averaged_event – A dictionary of all the measurements taken from the list of detectors averaged for num shots. The keys follow the same naming convention as that will appear in the event documents i.e “{name}_{field}”

Return type:

dict

Notes

The returned average dictionary will only contain keys for ‘number’ or ‘array’ fields. Field types that can not be averaged such as ‘string’ will be ignored, do not expect them in the output.