Reference#

Device Classes#

class SECoPDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: ophyd_async.core.StandardReadable

hinted_signals: list[str] = []#
mandatory_parameters: list[str] = []#
set_module(module_name: str)#
async connect(mock: bool | ophyd_async.core.LazyMock = False, timeout: float = DEFAULT_TIMEOUT, force_reconnect: bool = False)#
class SECoPNodeDevice(sec_node_uri: str = '', name: str = '', loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.base.SECoPDevice

hinted_signals: list[str] = []#
async connect(mock=False, timeout=DEFAULT_TIMEOUT, force_reconnect=False)#
descriptiveDataChange(module, description)#
nodeStateChange(online, state)#

called when the state of the connection changes

‘online’ is True when connected or reconnecting, False when disconnected or connecting ‘state’ is the connection state as a string

async class_from_instance(path_to_module: str | None = None)#

Generate an annotated device class for this SEC node and write it to its own file, named after the generated node class, inside path_to_module (default: ./secop_ophyd_devs/). Any existing file of that name is overwritten.

class SECoPCommunicatorDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.base.SECoPDevice

hinted_signals: list[str] = []#
class SECoPReadableDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.base.SECoPDevice, bluesky.protocols.Triggerable, bluesky.protocols.Subscribable

Standard readable SECoP device, corresponding to a SECoP module with the interface class “Readable”

Initialization

Initializes the SECoPReadableDevice

Parameters:
  • secclient (AsyncSecopClient) – SECoP client providing communication to the SEC Node

  • module_name (str) – Name of the SEC Node module that is represented by this device

hinted_signals: list[str] = ['value']#
mandatory_parameters: list[str] = ['value', 'status']#
async wait_for_idle()#

asynchronously waits until module is IDLE again. this is helpful, for running commands that are not done immediately

observe_status_change(monitored_status_code: int)#

Plan stub: block until the module’s status code differs from monitored_status_code.

trigger() → ophyd_async.core.AsyncStatus#
subscribe_reading(function: ophyd_async.core._utils.Callback[dict[str, bluesky.protocols.Reading]]) → None#

Subscribe to updates in the reading. Only supported for an atomic (non-composite) ‘value’ parameter.

subscribe = None#
clear_sub(function: ophyd_async.core._utils.Callback) → None#

Remove a subscription.

class SECoPAcquisitionDevice(*args, **kwargs)#

Bases: secop_ophyd.devices.acquisition.control._AcquisitionControl[secop_ophyd.devices.acquisition.channel.AcquisitionGoal | None], secop_ophyd.devices.acquisition.channel.SECoPAcquisitionChannelDevice

SECoP device for a module with the interface class “Acquisition”: a data acquisition with a single channel, in one module. The legacy interface class “Triggerable” maps here too.

It runs like a SECoPAcquisitionControllerDevice whose only channel is the module itself: trigger() runs one cycle, and read() then gives ‘value’ (and the result of ‘get_data’). prepare() takes an AcquisitionGoal (or None), and collect_pages() hands over one stream, named after the device.

Initialization

class SECoPAcquisitionControllerDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.acquisition.control._AcquisitionControl[collections.abc.Mapping[str, secop_ophyd.devices.acquisition.channel.AcquisitionGoal]| None], secop_ophyd.devices.base.SECoPDevice

SECoP device for a module with the interface class “AcquisitionController”: the control of a data acquisition whose measured quantities are separate “AcquisitionChannel” modules.

The channels listed in the module property ‘acquisition_channels’ are child devices of the controller, named by their role there (control.t for the role “t”), and are no module devices of the node. channels maps each role to its channel device.

trigger() runs one cycle, and read() then gives the result of every channel. prepare() takes the goals of the channels by role ({"t": AcquisitionGoal(goal=10, enable=True)}) or None, and collect_pages() hands over one stream per channel, named after the channel. See _AcquisitionControl for the details of a cycle.

Initialization

hinted_signals: list[str] = []#
mandatory_parameters: list[str] = ['status']#
wait_for_idle = None#
property channels: dict[str, secop_ophyd.devices.acquisition.channel.SECoPAcquisitionChannelDevice]#

The channel devices by role.

class SECoPAcquisitionChannelDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.readable.SECoPReadableDevice

SECoP device for a module with the interface class “AcquisitionChannel”: one measured quantity of a data acquisition, whose cycles its SECoPAcquisitionControllerDevice runs. A channel listed by a controller is a child device of that controller, named by its role.

read() gives its ‘value’, and the result of ‘get_data’ if the module has that command. While its controller flies, the channel buffers every update of ‘value’ (unless it has ‘get_data’), for the controller’s collect_pages().

SECoPAcquisitionDevice is a controller and a channel in one module.

Initialization

Initializes the SECoPReadableDevice

Parameters:
  • secclient (AsyncSecopClient) – SECoP client providing communication to the SEC Node

  • module_name (str) – Name of the SEC Node module that is represented by this device

hinted_signals: list[str] = ['value']#
async read() → dict[str, bluesky.protocols.Reading]#

The readings of the module, and the result of ‘get_data’ if the module has that command.

async describe() → dict[str, bluesky.protocols.DataKey]#
class AcquisitionGoal#

When an acquisition channel ends a cycle: the value given to SECoPAcquisitionDevice.prepare.

Parameters:
  • goal – written to the ‘goal’ parameter: the cycle ends when ‘value’ reaches it. None leaves ‘goal’ unchanged.

  • enable – written to the ‘goal_enable’ parameter: whether the goal ends the cycle at all. None leaves ‘goal_enable’ unchanged. A module with a ‘goal’ but no ‘goal_enable’ always has its goal active.

goal: Any = None#
enable: bool | None = None#
class SECoPWritableDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.writable.SECoPWritableBase, bluesky.protocols.Locatable[secop_ophyd.devices.writable.T], bluesky.protocols.Checkable[secop_ophyd.devices.writable.T], typing.Generic[secop_ophyd.devices.writable.T]

Settable SECoP device, corresponding to a SECoP module with the interface class “Writable”: a module with a ‘target’ but without a ‘stop’ command.

set() writes ‘target’ and waits until the module is not BUSY. For a module whose value follows the target at once that is immediately; a Writable that needs time to reach its target reports BUSY meanwhile. The module must report BUSY by the time it answers the target write, or set() ends at once: SECoP has no other sign that a move has started. locate() returns the setpoint (‘target’) and readback (‘value’).

‘target’ and ‘value’ may be of any SECoP datatype. For a struct or tuple, the position is one value in set() and locate(), but several data keys in read() and describe(), because an event can only hold scalars and arrays:

  • set() takes the whole target: a dict for a struct, a tuple for a tuple. locate() returns setpoint and readback in the same form.

  • read() has one key per member, from the read-only Signals target_<member> and value_<member> (_0, _1, … for a tuple). locate()["readback"]["x"] is the value of value_x.

set() is the only way to change a struct/tuple target: there is no writable ‘target’ Signal for it. An atomic ‘target’ is also a SignalRW, whose set() only writes the parameter, without waiting.

The type parameter is the type of the target, e.g. float, or a TypedDict in a generated device class.

Initialization

Initializes the SECoPReadableDevice

Parameters:
  • secclient (AsyncSecopClient) – SECoP client providing communication to the SEC Node

  • module_name (str) – Name of the SEC Node module that is represented by this device

async check_value(value: secop_ophyd.devices.writable.T) → None#

Check that value is a valid target, without moving. In mock mode there is no node description to check against, so every value passes.

async set(value: secop_ophyd.devices.writable.T, timeout: float | None = None) → None#

Set the target and wait until the module is not BUSY.

async locate() → bluesky.protocols.Location[secop_ophyd.devices.writable.T]#

Return the current setpoint (‘target’) and readback (‘value’).

class SECoPMoveableDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.drivable.SECoPDrivableBase, ophyd_async.core.StandardMovable[ophyd_async.core.SignalDatatypeT]

Standard movable SECoP device, corresponding to a SECoP module with the interface class “Drivable” whose ‘target’ and ‘value’ are atomic (scalar or array). A Drivable with a struct/tuple ‘target’ or ‘value’ is a SECoPCompositeMoveableDevice.

Initialization

Initialize SECoPMovableDevice

Parameters:
  • secclient (AsyncSecopClient) – SECoP client providing communication to the SEC Node

  • module_name (str) – ame of the SEC Node module that is represented by this device

movable_logic() → ophyd_async.core.MovableLogic#
set_name(name: str, *, child_name_separator: str | None = None) → None#
class SECoPCompositeMoveableDevice(sri: str = '', name: str = '', connector: secop_ophyd.devices.connector.SECoPDeviceConnector | None = None, loglevel=logging.INFO, logdir: str | None = None)#

Bases: secop_ophyd.devices.drivable.SECoPDrivableBase, secop_ophyd.devices.writable.SECoPWritableDevice[secop_ophyd.devices.writable.T], bluesky.protocols.Stoppable

Movable SECoP device, corresponding to a SECoP module with the interface class “Drivable” whose ‘target’ and/or ‘value’ is a struct or tuple.

Behaves like SECoPWritableDevice for a struct/tuple, and can be stopped: set() takes the whole target as a dict or tuple and is the only way to change it, locate() returns setpoint and readback in the same form, and read() has one data key per member. A move reports no progress updates.

Initialization

Initializes the SECoPReadableDevice

Parameters:
  • secclient (AsyncSecopClient) – SECoP client providing communication to the SEC Node

  • module_name (str) – Name of the SEC Node module that is represented by this device

async set(value: secop_ophyd.devices.writable.T, timeout: float | None = None) → None#

Move to the given target and wait until the module has left BUSY.

async stop(success: bool = False) → None#

Stop the module and end a running set(): successfully if success, else with a RuntimeError.