pcdsdevices.areadetector.detectors.PCDSAreaDetector
- class pcdsdevices.areadetector.detectors.PCDSAreaDetector(prefix='', *, name, kind=None, read_attrs=None, configuration_attrs=None, parent=None, **kwargs)
Standard area detector including all (*) standard PCDS plugins.
- Notable plugins:
IMAGE2: reduced rate image, used for camera viewer Stats2: reduced rate stats
- (*) Currently excludes all PVAccess plugins:
IMAGE1:Pva IMAGE2:Pva: THUMBNAIL:Pva
Default port chains
The default configuration of ports is as follows:
CAM -> CC1 CAM -> CC2 CAM -> HDF51 CAM -> IMAGE1:CC CAM -> IMAGE1:Proc CAM -> IMAGE1:ROI CAM -> IMAGE2:CC CAM -> IMAGE2:Over CAM -> IMAGE2:Proc CAM -> IMAGE2:ROI -> IMAGE2 CAM -> JPEG1 CAM -> NetCDF1 CAM -> Over1 CAM -> Proc1 CAM -> ROI1 -> IMAGE1 CAM -> ROI1 -> Stats1 CAM -> ROI2 CAM -> ROI3 CAM -> ROI4 CAM -> Stats2 CAM -> Stats3 CAM -> Stats4 CAM -> Stats5 CAM -> THUMBNAIL:CC CAM -> THUMBNAIL:Over CAM -> THUMBNAIL:Proc CAM -> THUMBNAIL:ROI -> THUMBNAIL CAM -> TIFF1 CAM -> Trans1
Notes
Subclasses should replace
cam
with that of the respective detector, such asPilatusDetectorCam
for the Pilatus detector. Attribute
Class
Suffix
Docs
Kind
Notes
configuration_names
ArrayAttributeSignal
config
Inherited from
PCDSAreaDetectorEmbedded
cam (ADComponent)
normal
Inherited from
PCDSAreaDetectorEmbedded
image2
IMAGE2:
Image plugin used for the camera viewer
normal
Inherited from
PCDSAreaDetectorEmbedded
stats2
Stats2:
Stats plugin used for alignments
normal
Inherited from
PCDSAreaDetectorEmbedded
hdf51
HDF51:
normal
Inherited from
PCDSAreaDetectorEmbedded
image1
IMAGE1:
normal
image1_roi
IMAGE1:ROI:
normal
image1_cc
IMAGE1:CC:
normal
image1_proc
IMAGE1:Proc:
normal
image1_over
IMAGE1:Over:
normal
image2_roi
IMAGE2:ROI:
normal
image2_cc
IMAGE2:CC:
normal
image2_proc
IMAGE2:Proc:
normal
image2_over
IMAGE2:Over:
normal
thumbnail
THUMBNAIL:
normal
thumbnail_roi
THUMBNAIL:ROI:
normal
thumbnail_cc
THUMBNAIL:CC:
normal
thumbnail_proc
THUMBNAIL:Proc:
normal
thumbnail_over
THUMBNAIL:Over:
normal
cc1
CC1:
normal
cc2
CC2:
normal
jpeg1
JPEG1:
normal
netcdf1
NetCDF1:
normal
nexus1
Nexus1:
normal
over1
Over1:
normal
proc1
Proc1:
normal
roi1
ROI1:
normal
roi2
ROI2:
normal
roi3
ROI3:
normal
roi4
ROI4:
normal
stats1
Stats1:
normal
stats3
Stats3:
normal
stats4
Stats4:
normal
stats5
Stats5:
normal
tiff1
TIFF1:
normal
trans1
Trans1:
normal
Methods
- collect_asset_docs()
- 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.
- dispatch(key, timestamp)
Notify plugins of acquisition being complete.
When a new acquisition is started, this method is called with a key which is a label like ‘light’, ‘dark’, or ‘gain8’.
It in turn calls
generate_datum
on all of the plugins that have that method.File plugins are identified by searching for a
generate_datum()
method that must have the signaturedef generate_datum(key: str, timestamp: float, datum_kwargs: dict): ...
- 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)
- generate_datum(key, timestamp, datum_kwargs=None)
Notify plugins of acquisition being complete.
When a new acquisition is started, this method is called with a key which is a label like ‘light’, ‘dark’, or ‘gain8’.
It in turn calls
generate_datum
on all of the plugins that have that method.File plugins are identified by searching for a
generate_datum()
method that must have the signaturedef generate_datum(key: str, timestamp: float, datum_kwargs: dict): ...
- 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_full_area_detector()
- 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
- get_plugin_graph_edges(*, use_names=True, include_cam=False)
Get a list of (source, destination) ports for all plugin chains.
- Parameters:
use_names (bool, optional) – By default, the ophyd names for each plugin are used. Set this to False to instead get the AreaDetector port names.
include_cam (bool, optional) – Include plugins with ‘CAM’ as the source. As it is easy to assume that a camera without an explicit source is CAM, by default this method does not include it in the list.
- make_data_key()
- 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.
- screen(main: bool = False) None
Open camViewer screen for camera.
- Parameters:
main (bool, optional) – Set to True to bring up ‘main’ edm config screen. Defaults to False, which opens python viewer.
- 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