pcdsdevices.areadetector.plugins.ROIPlugin

class pcdsdevices.areadetector.plugins.ROIPlugin(*args, **kwargs)
Ophyd Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

configuration_names

ArrayAttributeSignal

config

Inherited from ROIPlugin

array_counter (ADComponent)

EpicsSignalWithRBV

ArrayCounter

[ArrayCounter r/w longout] Counter that increments by 1 each time an NDArray callback is processed

normal

Inherited from ROIPlugin

array_rate (ADComponent)

EpicsSignalRO

ArrayRate_RBV

[ArrayRate_RBV r/o calc] Rate (Hz) at which ArrayCounter is incrementing. Computed in database.

normal

Inherited from ROIPlugin

asyn_io (ADComponent)

EpicsSignal

AsynIO

[AsynIO N/A asyn] asyn record to control debugging (asynTrace)

normal

Inherited from ROIPlugin

nd_attributes_file (ADComponent)

EpicsSignal

NDAttributesFile

[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 ROIPlugin

pool_alloc_buffers (ADComponent)

EpicsSignalRO

PoolAllocBuffers

[PoolAllocBuffers r/o longin] The number of NDArrays this plugin has currently allocated.

normal

Inherited from ROIPlugin

pool_free_buffers (ADComponent)

EpicsSignalRO

PoolFreeBuffers

[PoolFreeBuffers r/o longin] The number of free NDArrays this plugin has in its NDArrayPool.

normal

Inherited from ROIPlugin

pool_max_buffers (ADComponent)

EpicsSignalRO

PoolMaxBuffers

[PoolMaxBuffers r/o longin] The maximum number of NDArrays this plugin is allowed to allocate.

normal

Inherited from ROIPlugin

pool_max_mem (ADComponent)

EpicsSignalRO

PoolMaxMem

[PoolMaxMem r/o ai] The maximum amount of NDArrayPool memory this plugin is allowed to allocate.

normal

Inherited from ROIPlugin

pool_used_buffers (ADComponent)

EpicsSignalRO

PoolUsedBuffers

[PoolUsedBuffers N/A calc]

The number of used NDArrays this plugin has in its NDArrayPool. Calculated from PoolAllocBuffers and PoolFreeBuffers.

normal

Inherited from ROIPlugin

pool_used_mem (ADComponent)

EpicsSignalRO

PoolUsedMem

[PoolUsedMem r/o ai] The actual amount of NDArrayPool memory this plugin is currently using.

normal

Inherited from ROIPlugin

port_name (ADComponent)

EpicsSignalRO

PortName_RBV

[PortName_RBV r/o stringin] asyn port name

config

Inherited from ROIPlugin

asyn_pipeline_config

ArrayAttributeSignal

config

Inherited from ROIPlugin

width (ADComponent)

EpicsSignalRO

ArraySize0_RBV

[ArraySize0_RBV r/o longin] First dimension of NDArray callback data

normal

Inherited from ROIPlugin

height (ADComponent)

EpicsSignalRO

ArraySize1_RBV

[ArraySize1_RBV r/o longin] Second dimension of NDArray callback data

normal

Inherited from ROIPlugin

depth (ADComponent)

EpicsSignalRO

ArraySize2_RBV

[ArraySize2_RBV r/o longin] Third dimension of NDArray callback data

normal

Inherited from ROIPlugin

array_size (DDC)

ArraySize

(See below)

normal

Inherited from ROIPlugin

bayer_pattern (ADComponent)

EpicsSignalRO

BayerPattern_RBV

[BayerPattern_RBV r/o mbbi] BayerPattern of last NDArray callback data (NDBayerPattern_t).

normal

Inherited from ROIPlugin

blocking_callbacks (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

color_mode (ADComponent)

EpicsSignalRO

ColorMode_RBV

[ColorMode_RBV r/o mbbi] Color mode of last NDArray callback data (NDColorMode_t).

normal

Inherited from ROIPlugin

data_type (ADComponent)

EpicsSignalRO

DataType_RBV

[DataType_RBV r/o mbbi] Data type of last NDArray callback data (NDDataType_t).

normal

Inherited from ROIPlugin

dim0_sa (ADComponent)

EpicsSignal

Dim0SA

normal

Inherited from ROIPlugin

dim1_sa (ADComponent)

EpicsSignal

Dim1SA

normal

Inherited from ROIPlugin

dim2_sa (ADComponent)

EpicsSignal

Dim2SA

normal

Inherited from ROIPlugin

dim_sa (DDC)

DimSa

(See below)

normal

Inherited from ROIPlugin

dimensions (ADComponent)

EpicsSignalRO

Dimensions_RBV

[Dimensions_RBV r/o waveform] Dimensions in last NDArray callback data

normal

Inherited from ROIPlugin

dropped_arrays (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

enable (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

min_callback_time (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

nd_array_address (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

nd_array_port (ADComponent)

EpicsSignalWithRBV

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 ROIPlugin

ndimensions (ADComponent)

EpicsSignalRO

NDimensions_RBV

[NDimensions_RBV r/o longin] Number of dimensions in last NDArray callback data

normal

Inherited from ROIPlugin

plugin_type (ADComponent)

EpicsSignalRO

PluginType_RBV

[PluginType_RBV r/o stringin] A string describing the plugin type.

config

Inherited from ROIPlugin

queue_free (ADComponent)

EpicsSignal

QueueFree

[QueueFree r/o longin] The number of free queue elements.

normal

Inherited from ROIPlugin

queue_free_low (ADComponent)

EpicsSignal

QueueFreeLow

normal

Inherited from ROIPlugin

queue_size (ADComponent)

EpicsSignal

QueueSize

[QueueSize r/o longin] The total queue size for callbacks when BlockingCallbacks=0.

normal

Inherited from ROIPlugin

queue_use (ADComponent)

EpicsSignal

QueueUse

[QueueUse r/o calc] The number of used queue elements.

normal

Inherited from ROIPlugin

queue_use_high (ADComponent)

EpicsSignal

QueueUseHIGH

normal

Inherited from ROIPlugin

queue_use_hihi (ADComponent)

EpicsSignal

QueueUseHIHI

normal

Inherited from ROIPlugin

time_stamp (ADComponent)

EpicsSignalRO

TimeStamp_RBV

[TimeStamp_RBV r/o ai] Time stamp number of last NDArray callback data

normal

Inherited from ROIPlugin

unique_id (ADComponent)

EpicsSignalRO

UniqueId_RBV

[UniqueId_RBV r/o longin] Unique ID number of last NDArray callback data

normal

Inherited from ROIPlugin

auto_size (DDC)

AutoSize

(See below)

normal

Inherited from ROIPlugin

bin_ (DDC)

Bin

(See below)

normal

Inherited from ROIPlugin

data_type_out (ADComponent)

EpicsSignalWithRBV

DataTypeOut

config

Inherited from ROIPlugin

enable_scale (ADComponent)

EpicsSignalWithRBV

EnableScale

[EnableScale r/w bo]

Enable dividing by the Scale value. (0=Disable, 1=Enable). This is very useful when binning or when converting from a higher precision data type to a lower precision data type. For example when binning 2x2, then Scale=4 (dividing by 4) will prevent integer overflow. Similarly, when converting from 16-bit to 8-bit integers one might scale by 256, or perhaps a smaller number if the 16-bit data does not use the full 16-bit range.

config

Inherited from ROIPlugin

roi_enable (DDC)

RoiEnable

(See below)

normal

Inherited from ROIPlugin

max_xy (DDC)

MaxXy

(See below)

normal

Inherited from ROIPlugin

max_size (DDC)

MaxSize

(See below)

normal

Inherited from ROIPlugin

min_xyz (DDC)

MinXyz

(See below)

normal

Inherited from ROIPlugin

name_ (ADComponent)

EpicsSignalWithRBV

Name

ROI name

config

Inherited from ROIPlugin

reverse (DDC)

Reverse

(See below)

normal

Inherited from ROIPlugin

scale (ADComponent)

EpicsSignalWithRBV

Scale

[Scale r/w ao] The scale value to divide by if EnableScale is enabled.

normal

Inherited from ROIPlugin

set_xhopr (ADComponent)

EpicsSignal

SetXHOPR

normal

Inherited from ROIPlugin

set_yhopr (ADComponent)

EpicsSignal

SetYHOPR

normal

Inherited from ROIPlugin

size (DDC)

Size

(See below)

normal

Inherited from ROIPlugin

ROIPlugin.array_size (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

z

EpicsSignalRO

ArraySizeZ_RBV

config

y

EpicsSignalRO

ArraySizeY_RBV

config

x

EpicsSignalRO

ArraySizeX_RBV

config

ROIPlugin.dim_sa (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

dim0

EpicsSignal

Dim0SA

config

dim1

EpicsSignal

Dim1SA

config

dim2

EpicsSignal

Dim2SA

config

ROIPlugin.auto_size (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalWithRBV

AutoSizeX

config

y

EpicsSignalWithRBV

AutoSizeY

config

z

EpicsSignalWithRBV

AutoSizeZ

config

ROIPlugin.bin_ (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalWithRBV

BinX

config

y

EpicsSignalWithRBV

BinY

config

z

EpicsSignalWithRBV

BinZ

config

ROIPlugin.roi_enable (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalWithRBV

EnableX

config

y

EpicsSignalWithRBV

EnableY

config

z

EpicsSignalWithRBV

EnableZ

config

ROIPlugin.max_xy (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignal

MaxX

config

y

EpicsSignal

MaxY

config

ROIPlugin.max_size (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalRO

MaxSizeX_RBV

config

y

EpicsSignalRO

MaxSizeY_RBV

config

z

EpicsSignalRO

MaxSizeZ_RBV

config

ROIPlugin.min_xyz (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

min_x

EpicsSignalWithRBV

MinX

normal

min_y

EpicsSignalWithRBV

MinY

normal

min_z

EpicsSignalWithRBV

MinZ

normal

ROIPlugin.reverse (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalWithRBV

ReverseX

config

y

EpicsSignalWithRBV

ReverseY

config

z

EpicsSignalWithRBV

ReverseZ

config

ROIPlugin.size (DDC) Dynamic Device Components

Attribute

Class

Suffix

Docs

Kind

Notes

x

EpicsSignalWithRBV

SizeX

normal

y

EpicsSignalWithRBV

SizeY

normal

z

EpicsSignalWithRBV

SizeZ

normal

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 OrderedDict this method returns must match the keys in the OrderedDict return by read().

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.

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 OrderedDict returned by this method must have identical keys (in the same order) as the OrderedDict returned by describe().

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_attrs list.

set(region)

This functions allows for the ROI regions to be set.

This function takes in an ROI_number, and a dictionary of tuples and sets the ROI region.

Parameters:

region (dictionary.) – A dictionary defining the region to be set, which has the structure: {'x': [min, size], 'y': [min, size], 'z': [min, size]}. Any of the keywords can be omitted, and they will be ignored.

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 the StatusBase object 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 StatusBase object which is already completed.

Returns:

status (StatusBase) – StatusBase object 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
subscriptions: ClassVar[FrozenSet[str]] = frozenset({'acq_done'})