pcdsdevices.areadetector.plugins.Overlay
- class pcdsdevices.areadetector.plugins.Overlay(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, **kwargs)
Attribute
Class
Suffix
Docs
Kind
Notes
configuration_names
ArrayAttributeSignal
config
Inherited from
Overlay
blue (ADComponent)
Blue
[Blue r/w longout] The blue value to use when drawing the overlay. This is only used for color images.
normal
Inherited from
Overlay
draw_mode (ADComponent)
DrawMode
- [DrawMode r/w mbbo]
The operation to use when drawing this overlay. Choices are:
0=”Set” 1=”XOR”
In Set mode the Red, Green, and Blue values (Green for mono images) are written directly into the pixel values. In XOR mode the value in the pixel is XOR’ed with the Red, Green, and Blue values. XOR operation typically results in an overlay that has better visibility no matter what the values of the surrounding pixels, while Set mode with Green=255, for example, will show up well on dark areas of the image, but will be hard to see in bright areas of the image. Note that XOR is not supported for NDFloat32 or NDFloat64 data types directly, but they are cast to int if XOR is selected for arrays with those data types.
normal
Inherited from
Overlay
green (ADComponent)
Green
- [Green r/w longout]
The green value to use when drawing the overlay. This is the value that is used for monochrome images as well.
normal
Inherited from
Overlay
max_size_x (ADComponent)
EpicsSignal
MaxSizeX
normal
Inherited from
Overlay
max_size_y (ADComponent)
EpicsSignal
MaxSizeY
normal
Inherited from
Overlay
overlay_portname (ADComponent)
Name
[Name r/w stringout] Name for this overlay.
normal
Inherited from
Overlay
position_x (ADComponent)
PositionX
[PositionX r/w longout] The X position of this overlay.
normal
Inherited from
Overlay
position_y (ADComponent)
PositionY
[PositionY r/w longout] The Y position of this overlay.
normal
Inherited from
Overlay
position_xlink (ADComponent)
EpicsSignal
PositionXLink
- [PositionXLink r/w longout]
Link to fetch the desired X position of this overlay. The .DOL field of this record can be set to another record which will then change PositionX whenever the other record updates. The link must have the “CP” attribute, so that this record processes whenever the record it is linked to changes. For example, the link could be set to “13PS1:Stats1:CentroidX_RBV CP NMS” to fetch its position from the X centroid calculated by an NDPluginStats plugin, or to “13PS1:ROI1:MinX_RBV CP MS” to fetch its position from the X position of an ROI. If this link field is blank or points to a non-existent record then the X position of the overlay can be manually controlled. Note that this linking is done entirely in the EPICS database, and not in the plugin code.
normal
Inherited from
Overlay
position_ylink (ADComponent)
EpicsSignal
PositionYLink
- [PositionYLink r/w longout]
Link to fetch the desired Y position of this overlay. See the notes for PositionXLink above.
normal
Inherited from
Overlay
red (ADComponent)
Red
[Red r/w longout] The red value to use when drawing the overlay. This is only used for color images.
normal
Inherited from
Overlay
set_xhopr (ADComponent)
EpicsSignal
SetXHOPR
normal
Inherited from
Overlay
set_yhopr (ADComponent)
EpicsSignal
SetYHOPR
normal
Inherited from
Overlay
shape (ADComponent)
Shape
- [Shape r/w mbbo]
The shape of this overlay. Choices are:
0=”Cross” 1=”Rectangle” 2=”Text”
Other shapes may be added in the future. The PositionX and PositionY position of a cross defines the location of the center of the cross. The SizeX and SizeY of a cross is the size on either side of the center, i.e. the total width = 2*OverlaySizeX. This is done so when HOPR for the SizeX and SizeY records is set to the total image size, the cross can be the total size of the image no matter where it is positioned. The PositionX and PositionY of a rectangle defines the lower left corner of the rectangle. SizeX and SizeY of a rectangle define total width and height. These definitions are consistent with the way ROIs are defined in the NDPluginROI plugin. The XPosition and YPosition of the text overlay defines the lower left corner of the text. The SizeX and SizeY are ignored for the text overlay, the size is defined by the text string and the font.
normal
Inherited from
Overlay
size_x (ADComponent)
SizeX
[SizeX r/w longout] The X size of this overlay.
normal
Inherited from
Overlay
size_y (ADComponent)
SizeY
[SizeY r/w longout] The Y size of this overlay.
normal
Inherited from
Overlay
size_xlink (ADComponent)
EpicsSignal
SizeXLink
- [SizeXLink r/w longout]
Link to fetch the desired X size of this overlay. See the notes for PositionXLink above.
normal
Inherited from
Overlay
size_ylink (ADComponent)
EpicsSignal
SizeYLink
- [SizeYLink r/w longout]
Link to fetch the desired Y size of this overlay. See the notes for PositionXLink above.
normal
Inherited from
Overlay
use (ADComponent)
Use
[Use r/w bo] Flag indicating whether to use (enable) this overlay. 0=No, 1=Yes.
normal
Inherited from
Overlay
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 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.
- 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 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.
- 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 theStatusBase
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
- configuration_attrs
- connected
- hints
- kind