Motor devices

ControllableMotor

Type: Motor

class sophys.common.devices.motor.ControllableMotor(*args, **kwargs)[source]

Bases: EpicsMotor

Custom EpicsMotor that enables control before a plan and disables it after.

VirtualControllableMotor

Type: Motor

sophys.common.devices.motor.VirtualControllableMotor(prefix, components, name, **kwargs)[source]

Custom EpicsMotor that enables control of a list of motors before a plan and disables them after.

This is useful for virtual motors that depends on the control state of several real motors in order to work properly.

This is primarily intended for cases in which we have a virtual motor (e.g. a slit, composed of two motors in a direction), and to move that virtual motor, you first have to enable movement of every single real motor it is composed of.

Usage example - A vertical slit gap

real_motors = {
    "top": "SWC:MOTOR:m2",
    "bottom": "SWC:MOTOR:m3",
}
v_gap = VirtualControllableMotor("SWC:MOTOR:m1", real_motors, "vertical_gap")
Parameters:
  • prefix (str) – The prefix of the virtual motor.

  • components (dict of (string, string)) – The real motors that constitute this virtual device, in the form (name, prefix).

  • name (str) – Name of the created virtual motor.

MotorGroup

Type: Motor

sophys.common.devices.motor.MotorGroup(prefix, motors_suffixes, name, **kwargs)[source]

Function to instantiate several motor devices.

Usage example

real_motors = {
    "x": "SWC:MOTOR:m1",
    "y": "SWC:MOTOR:m2",
    "z": "SWC:MOTOR:m3"
}
motors_suffixes = {
    "x": "m1",
    "y": "m2",
    "z": "m3",
    "kin_x": ("CS1:m1", real_motors),
    "kin_y": ("CS1:m2", real_motors),
    "kin_z": ("CS1:m3", real_motors)
}

motor_group = MotorGroup(
    prefix="SWC:MOTOR:", motors_suffixes=motors_suffixes, name="motor_group")
Parameters:
  • prefix (str) – The prefix of the motor group.

  • motors_suffixes (dict of (string, string)) – The real motors that constitute this motor group, in the form of .

  • name (str) – Name of the created motor group.

Slits

Type: Motor

sophys.common.devices.slit.HorizontalSlit(prefix: str, left: str, right: str, gap: str | None = None, offset: str | None = None, **kwargs) Device[source]

Create a slit device that can only be moved horizontally.

sophys.common.devices.slit.KinematicSlit(prefix: str, v_gap: str, v_offset: str, h_gap: str, h_offset: str, top: str | None = None, bottom: str | None = None, left: str | None = None, right: str | None = None, **kwargs) Device[source]

Create a slit device that can be moved with a gap or an offset horizontally and vertically, using them as real motors, while the individual directions are virtual motors.

sophys.common.devices.slit.Slit(prefix: str, top: str, bottom: str, left: str, right: str, v_gap: str | None = None, v_offset: str | None = None, h_gap: str | None = None, h_offset: str | None = None, has_kinematic: bool = True, **kwargs) Device[source]

Create a slit device that can be moved vertically and horizontally.

sophys.common.devices.slit.VerticalSlit(prefix: str, top: str, bottom: str, gap: str | None = None, offset: str | None = None, **kwargs) Device[source]

Create a slit device that can only be moved vertically.