id4_common.devices.counters_mixin#
Mixin classes for the detector channel-selection API used by CountersClass.
Module Contents#
- class id4_common.devices.counters_mixin.CountersMixin#
Bases:
abc.ABCAPI contract for detectors used with CountersClass.plotselect().
Concrete implementations must provide plot_options, label_option_map, select_plot, and field_for_label. select_read defaults to a no-op, which is correct for detectors where all channels are always read (eiger, vimba).
For preset_monitor, set the class attribute _preset_monitor_attr to a dotted attribute path string (e.g. “cam.acquire_time”). Devices that cannot use this pattern (e.g. LocalScalerCH which has preset_monitor as an ophyd Component) may override preset_monitor directly in the class body.
- property preset_monitor#
Return the ophyd signal used to control scan count time.
Resolved by walking the dotted path in _preset_monitor_attr. Set that class attribute in subclasses instead of overriding this property.
- property plot_options: list#
- Abstractmethod:
Return human-readable channel labels available for plot selection.
- property label_option_map: dict#
- Abstractmethod:
Return mapping from human-readable label to internal index.
- abstractmethod select_plot(channels: list) None#
Configure Kind.hinted for the given channel labels.
- abstractmethod field_for_label(label: str) str#
Return the ophyd field name for a plot-option label.
- predict_save_path(base_path, name_template, file_number)#
Return (full_path, relative_path) without any EPICS I/O.
Mirrors setup_images + make_write_read_paths for detectors that store their format string as hdf1_name_format or hdf1_file_format. Returns (None, None) when neither attribute is found.
- class id4_common.devices.counters_mixin.ROICountersMixin#
Bases:
CountersMixinShared plot-selection implementation for ROI-based MCA detectors.
Provides concrete implementations of plot_options, select_plot, field_for_label, select_read, and the read_rois getter. Subclasses must still provide:
label_option_map— maps label strings to ROI index integersselect_roi(rois)— device-specific Kind manipulation across all ROIsread_roissetter if per-pixel stats kinds must also be updated
The
_read_roisclass attribute sets the default readable ROI index.