pcdsdevices.areadetector.plugins.ProcessPlugin
- class pcdsdevices.areadetector.plugins.ProcessPlugin(*args, **kwargs)
Ophyd Device Components Attribute
Class
Suffix
Docs
Kind
Notes
configuration_names
ArrayAttributeSignalconfig
Inherited from
ProcessPluginarray_counter (ADComponent)
ArrayCounter[ArrayCounter r/w longout] Counter that increments by 1 each time an NDArray callback is processed
normal
Inherited from
ProcessPluginarray_rate (ADComponent)
EpicsSignalROArrayRate_RBV[ArrayRate_RBV r/o calc] Rate (Hz) at which ArrayCounter is incrementing. Computed in database.
normal
Inherited from
ProcessPluginasyn_io (ADComponent)
EpicsSignalAsynIO[AsynIO N/A asyn] asyn record to control debugging (asynTrace)
normal
Inherited from
ProcessPluginnd_attributes_file (ADComponent)
EpicsSignalNDAttributesFile- [NDAttributesFile r/w waveform]
The name of an XML file defining the PVAttributes and paramAttributes to be added to each NDArray by this plugin. The format of the XML file is described in the documentation for asynNDArrayDriver::readNDAttributesFile().
normal
Inherited from
ProcessPluginpool_alloc_buffers (ADComponent)
EpicsSignalROPoolAllocBuffers[PoolAllocBuffers r/o longin] The number of NDArrays this plugin has currently allocated.
normal
Inherited from
ProcessPluginpool_free_buffers (ADComponent)
EpicsSignalROPoolFreeBuffers[PoolFreeBuffers r/o longin] The number of free NDArrays this plugin has in its NDArrayPool.
normal
Inherited from
ProcessPluginpool_max_buffers (ADComponent)
EpicsSignalROPoolMaxBuffers[PoolMaxBuffers r/o longin] The maximum number of NDArrays this plugin is allowed to allocate.
normal
Inherited from
ProcessPluginpool_max_mem (ADComponent)
EpicsSignalROPoolMaxMem[PoolMaxMem r/o ai] The maximum amount of NDArrayPool memory this plugin is allowed to allocate.
normal
Inherited from
ProcessPluginpool_used_buffers (ADComponent)
EpicsSignalROPoolUsedBuffers- [PoolUsedBuffers N/A calc]
The number of used NDArrays this plugin has in its NDArrayPool. Calculated from PoolAllocBuffers and PoolFreeBuffers.
normal
Inherited from
ProcessPluginpool_used_mem (ADComponent)
EpicsSignalROPoolUsedMem[PoolUsedMem r/o ai] The actual amount of NDArrayPool memory this plugin is currently using.
normal
Inherited from
ProcessPluginport_name (ADComponent)
EpicsSignalROPortName_RBV[PortName_RBV r/o stringin] asyn port name
config
Inherited from
ProcessPluginasyn_pipeline_config
ArrayAttributeSignalconfig
Inherited from
ProcessPluginwidth (ADComponent)
EpicsSignalROArraySize0_RBV[ArraySize0_RBV r/o longin] First dimension of NDArray callback data
normal
Inherited from
ProcessPluginheight (ADComponent)
EpicsSignalROArraySize1_RBV[ArraySize1_RBV r/o longin] Second dimension of NDArray callback data
normal
Inherited from
ProcessPlugindepth (ADComponent)
EpicsSignalROArraySize2_RBV[ArraySize2_RBV r/o longin] Third dimension of NDArray callback data
normal
Inherited from
ProcessPluginarray_size (DDC)
ArraySize(See below)
normal
Inherited from
ProcessPluginbayer_pattern (ADComponent)
EpicsSignalROBayerPattern_RBV[BayerPattern_RBV r/o mbbi] BayerPattern of last NDArray callback data (NDBayerPattern_t).
normal
Inherited from
ProcessPluginblocking_callbacks (ADComponent)
BlockingCallbacks- [BlockingCallbacks r/w bo]
0 = callbacks from the driver do not block; the NDArray data is put on a queue and the callback processes in its own thread.
1 = callbacks from the driver block; the callback processes in the driver callback thread.
config
Inherited from
ProcessPlugincolor_mode (ADComponent)
EpicsSignalROColorMode_RBV[ColorMode_RBV r/o mbbi] Color mode of last NDArray callback data (NDColorMode_t).
normal
Inherited from
ProcessPlugindata_type (ADComponent)
EpicsSignalRODataType_RBV[DataType_RBV r/o mbbi] Data type of last NDArray callback data (NDDataType_t).
normal
Inherited from
ProcessPlugindim0_sa (ADComponent)
EpicsSignalDim0SAnormal
Inherited from
ProcessPlugindim1_sa (ADComponent)
EpicsSignalDim1SAnormal
Inherited from
ProcessPlugindim2_sa (ADComponent)
EpicsSignalDim2SAnormal
Inherited from
ProcessPlugindim_sa (DDC)
DimSa(See below)
normal
Inherited from
ProcessPlugindimensions (ADComponent)
EpicsSignalRODimensions_RBV[Dimensions_RBV r/o waveform] Dimensions in last NDArray callback data
normal
Inherited from
ProcessPlugindropped_arrays (ADComponent)
DroppedArrays- [DroppedArrays r/w longout]
Counter that increments by 1 each time an NDArray callback occurs when NDPluginDriverBlockingCallbacks=0 and the plugin driver queue is full, so the callback cannot be processed.
normal
Inherited from
ProcessPluginenable (ADComponent)
EnableCallbacks- [EnableCallbacks r/w bo]
Enable (1) or disable (0) callbacks from the driver to this plugin. If callbacks are disabled then the plugin will normally be idle and consume no CPU resources.
config
Inherited from
ProcessPluginmin_callback_time (ADComponent)
MinCallbackTime- [MinCallbackTime r/w ao]
The minimum time in seconds between calls to processCallbacks. Any callbacks occuring before this minimum time has elapsed will be ignored. 0 means no minimum time, i.e. process all callbacks.
normal
Inherited from
ProcessPluginnd_array_address (ADComponent)
NDArrayAddress- [NDArrayAddress r/w longout]
asyn port address for NDArray driver that will make callbacks to this plugin. This address can be changed at run time, connecting the plugin to a different address in the NDArray driver.
normal
Inherited from
ProcessPluginnd_array_port (ADComponent)
NDArrayPort- [NDArrayPort r/w stringout]
asyn port name for NDArray driver that will make callbacks to this plugin. This port can be changed at run time, connecting the plugin to a different NDArray driver.
config
Inherited from
ProcessPluginndimensions (ADComponent)
EpicsSignalRONDimensions_RBV[NDimensions_RBV r/o longin] Number of dimensions in last NDArray callback data
normal
Inherited from
ProcessPluginplugin_type (ADComponent)
EpicsSignalROPluginType_RBV[PluginType_RBV r/o stringin] A string describing the plugin type.
config
Inherited from
ProcessPluginqueue_free (ADComponent)
EpicsSignalQueueFree[QueueFree r/o longin] The number of free queue elements.
normal
Inherited from
ProcessPluginqueue_free_low (ADComponent)
EpicsSignalQueueFreeLownormal
Inherited from
ProcessPluginqueue_size (ADComponent)
EpicsSignalQueueSize[QueueSize r/o longin] The total queue size for callbacks when BlockingCallbacks=0.
normal
Inherited from
ProcessPluginqueue_use (ADComponent)
EpicsSignalQueueUse[QueueUse r/o calc] The number of used queue elements.
normal
Inherited from
ProcessPluginqueue_use_high (ADComponent)
EpicsSignalQueueUseHIGHnormal
Inherited from
ProcessPluginqueue_use_hihi (ADComponent)
EpicsSignalQueueUseHIHInormal
Inherited from
ProcessPlugintime_stamp (ADComponent)
EpicsSignalROTimeStamp_RBV[TimeStamp_RBV r/o ai] Time stamp number of last NDArray callback data
normal
Inherited from
ProcessPluginunique_id (ADComponent)
EpicsSignalROUniqueId_RBV[UniqueId_RBV r/o longin] Unique ID number of last NDArray callback data
normal
Inherited from
ProcessPluginauto_offset_scale (ADComponent)
EpicsSignalAutoOffsetScale- [AutoOffsetScale r/w busy]
Processing this record will enable Offset and Scale calculations, and set the Offset=-min(Array) and Scale=MaxScale/(max(Array)-min(Array)), where MaxScale is the maximum value of the output data type. The output array will thus be scaled to completely fill the range of the output data type. Note that the calculation of the offset and scale factors is only done once when this record is processed, and these values are used for subsequent array callbacks, i.e. it does not autoscale on each array callback. Thanks to Tom Cobb for this addition.
config
Inherited from
ProcessPluginauto_reset_filter (ADComponent)
AutoResetFilter- [AutoResetFilter r/w bo]
If enabled then when NumFiltered=NumFilter the filter automatically resets. This can be very useful when using the Average or Sum filter modes. As soon as N sums or averages have been performed the filter resets, so the next sum or average is computed.
config
Inherited from
ProcessPluginaverage_seq (ADComponent)
EpicsSignalAverageSeqconfig
Inherited from
ProcessPlugincopy_to_filter_seq (ADComponent)
EpicsSignalCopyToFilterSeqconfig
Inherited from
ProcessPlugindata_type_out (ADComponent)
DataTypeOut- [DataTypeOut r/w mbbo]
Data type of the output array (NDDataType_t). This can be different from the data type of the NDArray callback data.
config
Inherited from
ProcessPlugindifference_seq (ADComponent)
EpicsSignalDifferenceSeqconfig
Inherited from
ProcessPluginenable_background (ADComponent)
EnableBackground- [EnableBackground r/w bo]
Flag indicating whether the background array acquired with SaveBackground should be subtracted when processing the array. If ValidBackground=0 then no background subtraction is done even if EnableBackground=Enable.
config
Inherited from
ProcessPluginenable_filter (ADComponent)
EnableFilter- [EnableFilter r/w bo]
Flag indicating whether the array should be processed with a recursive filter. The details of the filter operation are explained below.
config
Inherited from
ProcessPluginenable_flat_field (ADComponent)
EnableFlatField- [EnableFlatField r/w bo]
Flag indicating whether the array should be divided by the flat field array (acquired with SaveFlatField) when processing the array. If ValidFlatField=0 then no flat field normalization is done even if EnableBackground=Enable. The processing step consists of:
Array = Array / FlatField * ScaleFlatField
config
Inherited from
ProcessPluginenable_high_clip (ADComponent)
EnableHighClip- [EnableHighClip r/w bo]
Flag to control whether to clip values to the HighClip value for this array (0=Disable, 1=Enable).
config
Inherited from
ProcessPluginenable_low_clip (ADComponent)
EnableLowClip- [EnableLowClip r/w bo]
Flag to control whether to clip values to the LowClip value for this array (0=Disable, 1=Enable).
config
Inherited from
ProcessPluginenable_offset_scale (ADComponent)
EnableOffsetScale- [EnableOffsetScale r/w bo]
Flag indicating whether the array should be multiplied by Scale and then summed with Offset when processing the array. The processing step consists of:
Array = Array * Scale + Offset
config
Inherited from
ProcessPluginfc (DDC)
Fc(See below)
normal
Inherited from
ProcessPluginfoffset (ADComponent)
FOffset[FOffset r/w ao] Filter offset coefficient.
config
Inherited from
ProcessPluginfscale (ADComponent)
FScale[FScale r/w ao] Filter scale coefficient.
config
Inherited from
ProcessPluginfilter_callbacks (ADComponent)
FilterCallbacks- [FilterCallbacks r/w bo]
Choices are “Every array” and “Array N only”. If “Every array” is selected then the plugin does callbacks for every incoming array it receives. If “Array N only” is selected then the plugin only does callbacks when NumFiltered=NumFilter. This can be very useful when using the Sum or Average filter modes. Callbacks are then done only when N sums or averages have been performed. If used with AutoResetFilter then as input arrays arrive the plugin will continually output one summed or averaged array after every N incoming arrays.
config
Inherited from
ProcessPluginfilter_type (ADComponent)
EpicsSignalFilterType[FilterType r/w mbbo] The filter type, chosen from a predefined list, as described below.
config
Inherited from
ProcessPluginfilter_type_seq (ADComponent)
EpicsSignalFilterTypeSeqconfig
Inherited from
ProcessPluginhigh_clip (ADComponent)
HighClip- [HighClip r/w ao]
The maximum allowed value for this array. If EnableHighClip=1, then all values in the array greater than HighClip will be replaced by HighClip.
config
Inherited from
ProcessPluginlow_clip (ADComponent)
LowClip- [LowClip r/w ao]
The minimum allowed value for this array. If EnableLowClip=1, then all values in the array less than LowClip will be replaced by LowClip.
config
Inherited from
ProcessPluginnum_filter (ADComponent)
NumFilter- [NumFilter r/w longout]
The characteristic number of arrays to use when filtering. The value of NumFiltered will increase as each array is processed, until it reaches the value of NumFilter, when it will no longer increase. The value of NumFiltered is used in the filter equations, as explained below.
config
Inherited from
ProcessPluginnum_filter_recip (ADComponent)
EpicsSignalNumFilterRecipconfig
Inherited from
ProcessPluginnum_filtered (ADComponent)
EpicsSignalRONumFiltered_RBV- [NumFiltered_RBV r/o longin]
The number of arrays that have been processed by the filter since the filter was last reset. The value of NumFiltered is incremented as each array is processed, until it reaches the value of NumFilter, when it will cease incrementing. The value of NumFiltered is used in the filter equations, as explained below.
config
Inherited from
ProcessPluginoc (DDC)
Oc(See below)
normal
Inherited from
ProcessPlugino_offset (ADComponent)
OOffset[OOffset r/w ao] Output offset coefficient.
config
Inherited from
ProcessPlugino_scale (ADComponent)
OScale[OScale r/w ao] Output scale coefficient.
config
Inherited from
ProcessPluginoffset (ADComponent)
Offset[Offset r/w ao] The offset to add.
config
Inherited from
ProcessPluginrc (DDC)
Rc(See below)
normal
Inherited from
ProcessPluginroffset (ADComponent)
ROffset[ROffset r/w ao] Reset offset coefficient.
config
Inherited from
ProcessPluginrecursive_ave_diff_seq (ADComponent)
EpicsSignalRecursiveAveDiffSeqconfig
Inherited from
ProcessPluginrecursive_ave_seq (ADComponent)
EpicsSignalRecursiveAveSeqconfig
Inherited from
ProcessPluginreset_filter (ADComponent)
ResetFilter[ResetFilter r/w bo] Command to reset the filter back to its initial state.
config
Inherited from
ProcessPluginsave_background (ADComponent)
SaveBackground- [SaveBackground r/w bo]
Command to use the most recently acquired array as a background. Note that this recently acquired array should have been acquired with EnableBackground=0, or else that array will already have had the background subtracted, which is probably not what was intended!
config
Inherited from
ProcessPluginsave_flat_field (ADComponent)
SaveFlatField- [SaveFlatField r/w bo]
Command to use the most recently acquired array as a flat field. Note that this recently acquired array should have been acquired with EnableFlatField=0, or else that array will already have been flat field normalized, which is probably not what was intended!
config
Inherited from
ProcessPluginscale (ADComponent)
Scale[Scale r/w ao] The scale factor to multiply by.
config
Inherited from
ProcessPluginscale_flat_field (ADComponent)
ScaleFlatField- [ScaleFlatField r/w ao]
The scale factor to multiply by after dividing the array by the flat field array. This scale factor is normally chosen so that the data after scaling fills the dynamic range of the output data type.
config
Inherited from
ProcessPluginsum_seq (ADComponent)
EpicsSignalSumSeqconfig
Inherited from
ProcessPluginvalid_background (ADComponent)
EpicsSignalROValidBackground_RBV- [ValidBackground_RBV r/o bi]
Flag indicating whether there is a valid background array that has been acquired for this array using SaveBackground. This flag will be Invalid (0) if no background has been acquired, or if the size of the array has changed since the background was last acquired.
config
Inherited from
ProcessPluginvalid_flat_field (ADComponent)
EpicsSignalROValidFlatField_RBV- [ValidFlatField_RBV r/o bi]
Flag indicating whether there is a valid flat field array that has been acquired for this array using SaveFlatField. This flag will be Invalid (0) if no flat field has been acquired, or if the size of the array has changed since the flat field was last acquired.
config
Inherited from
ProcessPluginProcessPlugin.array_size (DDC) Dynamic Device Components Attribute
Class
Suffix
Docs
Kind
Notes
depth
EpicsSignalROArraySize2_RBVconfig
Inherited from
ProcessPluginheight
EpicsSignalROArraySize1_RBVconfig
Inherited from
ProcessPluginwidth
EpicsSignalROArraySize0_RBVconfig
Inherited from
ProcessPluginProcessPlugin.dim_sa (DDC) Dynamic Device Components Attribute
Class
Suffix
Docs
Kind
Notes
dim0
EpicsSignalDim0SAconfig
dim1
EpicsSignalDim1SAconfig
dim2
EpicsSignalDim2SAconfig
ProcessPlugin.fc (DDC) Dynamic Device Components Attribute
Class
Suffix
Docs
Kind
Notes
fc1
FC1config
fc2
FC2config
fc3
FC3config
fc4
FC4config
ProcessPlugin.oc (DDC) Dynamic Device Components Attribute
Class
Suffix
Docs
Kind
Notes
oc1
OC1config
oc2
OC2config
oc3
OC3config
oc4
OC4config
ProcessPlugin.rc (DDC) Dynamic Device Components Attribute
Class
Suffix
Docs
Kind
Notes
rc1
RC1config
rc2
RC2config
Methods
- 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
OrderedDictthis method returns must match the keys in theOrderedDictreturn 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_keyschema.
- disable_on_stage()
when the plugin is staged, ensure that it is disabled.
a convenience method for adding
`('enable', 0)to stage_sigs
- enable_on_stage()
when the plugin is staged, ensure that it is enabled.
a convenience method for adding (‘enable’, 1) to stage_sigs
- ensure_blocking()
Ensure that if plugin is enabled after staging, callbacks block.
a convenience method for adding
`('blocking_callbacks', 1)to stage_sigs
- ensure_nonblocking()
Ensure that if plugin is enabled after staging, callbacks don’t block.
a convenience method for adding
`('blocking_callbacks', 0)to stage_sigs
- find_signal(text, use_re=False, case_sensitive=False, match_fcn=None, f=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)
Search through the signal docs on this detector for the string text
- Parameters:
text (str) – Text to find
use_re (bool, optional) – Use regular expressions
case_sensitive (bool, optional) – Case sensitive search
match_fcn (callable, optional) – Function to call when matches are found Defaults to a function that prints matches to f
f (file-like, optional) – File-like object that the default match function prints to (Defaults to sys.stdout)
- 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.
- get_asyn_digraph()
Get the directed graph of the ASYN ports
- Returns:
G (networkx.DiGraph) – Directed graph of pipelines
port_map (dict) – Mapping between port_name and ADBase objects
- get_asyn_port_dictionary()
Return port name : component map
- Returns:
port_map (dict) – Mapping between port_name and ADBase objects
- get_plugin_by_asyn_port(port_name)
Get the plugin which has the given asyn port name
- Parameters:
port_name (str) – The port name to search for
- Returns:
ret (ADBase or None) – Either the requested plugin or None if not found
- missing_plugins()
Find missing ports
- 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
OrderedDictreturned by this method must have identical keys (in the same order) as theOrderedDictreturned 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()
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_attrslist.
- stop(*, success=False)
Stop the Device and all (instantiated) subdevices
- summary()
- trigger() StatusBase
Trigger the device and return status object.
This method is responsible for implementing ‘trigger’ or ‘acquire’ functionality of this device.
If there is an appreciable time between triggering the device and it being able to be read (via the
read()method) then this method is also responsible for arranging that theStatusBaseobject returned by this method is notified when the device is ready to be read.If there is no delay between triggering and being readable, then this method must return a
StatusBaseobject which is already completed.- Returns:
status (StatusBase) –
StatusBaseobject which will be marked as complete when the device is ready to be read.
- validate_asyn_ports()
Validate that all components of pipeline are known
- Raises:
RuntimeError – If there any input ports to known plugins where the source is not known to ophyd
- visualize_asyn_digraph(ax=None, *args, **kwargs)
This generates a figure showing the current asyn port layout.
This method generates a plot showing all of the currently enabled Areadetector plugin asyn ports and their relationships. The current ports and relationships are found using self.get_asyn_digraph.
- Parameters:
ax (matplotlib axes) – if None (default) then a new figure is created otherwise it is plotted on the specified axes.
*args (networkx.draw_networkx args and kwargs.) – For the allowed args and kwargs see the networkx.draw_networkx documentation
**kwargs (networkx.draw_networkx args and kwargs.) –
For the allowed args and kwargs see the networkx.draw_networkx documentation
Attributes
- ad_root
- array_pixels
The total number of pixels, calculated from array_size.
- configuration_attrs
- connected
- hints
- kind
- source_plugin