stoner_measurement.plugins.command.set_diffractometer.SetDiffractometerCommand

class stoner_measurement.plugins.command.set_diffractometer.SetDiffractometerCommand(parent=None)[source]

Bases: SetEngineStateCommand

Set an X-ray diffractometer angle during a sequence.

Use this command for a single theta/omega, coupled theta-2theta, or detector/2theta move. The Axes control selects the motion relationship; the Setpoint expression is an expression-capable SI spin box in degrees. Motion uses the speed and coupled datum offset already configured in the X-ray engine. The preferred instrument is reconnected automatically when required. The inherited Wait expression controls whether the command waits for completion. With False, the move runs in the background and outputs describe the latest known position with At Target false while motion is pending. Eventual failures are reported by the engine and retained in operation; waiting commands propagate failures to the sequence.

Final theta, 2-theta, detector counts, and at-target state are published as scalar outputs.

Variables:
  • axes (XrayMotionMode) – Motion relationship; defaults to COUPLED.

  • setpoint_expr (str) – Target angle expression in degrees; coupled motion uses detector 2-theta.

  • wait_expr (str) – Whether to wait for the target; defaults to “True”.

  • operation (XrayOperation | None) – Read-only ticket for the latest background move. Once done is set, result() returns the completed state or raises its error.

  • instance_name (str) – Inherited Python identifier for this instance in the Script tab and QtConsole.

  • comment (str) – Inherited optional note displayed beside this step.

  • sequence_engine (SequenceEngine | None) – Inherited owning engine and its live namespace; None while detached.

Keyword Parameters:

parent (QObject | None) – Optional Qt parent object.

Examples

With an instance named set_diffractometer in the sequence, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:

from stoner_measurement.xray_control import XrayMotionMode
set_diffractometer.axes = XrayMotionMode.COUPLED
set_diffractometer.setpoint_expr = "scan_centre + 2.5"
property controller_features: frozenset[str]

Return controller feature flags required by this plugin.

execute() → None[source]

Start a tracked move and preserve failure/cancellation on waiting runs.

property name: str

Unique human-readable name for this plugin.

property operation

Latest background ticket; inspect done and call result() after completion.

property output_names: tuple[str, ...]

Names of scalar values captured from the final engine snapshot.

setpoint_suffix = '°'