stoner_measurement.plugins.state_scan.motor_controller.MotorControllerScanPlugin¶
- class stoner_measurement.plugins.state_scan.motor_controller.MotorControllerScanPlugin(parent=None)[source]¶
Bases:
MotorControllerPluginMixin,StateScanPluginMove a motor through discrete absolute angles and run nested steps.
Use this state-scan plugin when the motor must reach and settle at each angular set-point before the measurement sequence continues. It is suited to step-and-measure rotation experiments where data taken while the stage is moving would be invalid. Use
MotorControllerSweepPlugininstead for measurements made continuously during motion, orSetPositionCommandfor a single move without a scan loop.The Scan tab defines absolute target angles in degrees using the normal state-scan generators. It can start from the currently measured angle, and nested sequence steps run once the shared motor-controller engine reports that each target has been reached. The plugin polls the engine while settling and raises a state error if a point does not settle within the state-scan timeout.
The Settings tab controls velocity in degrees per second, acceleration in degrees per second squared, and whether each absolute move follows the clockwise, counter-clockwise, or shortest route. Velocity and acceleration accept sequence expressions and are evaluated during configuration and again when a move is requested. Reported outputs selects measured Angle, Target Angle, and Angular Rate values for the sequence catalogue. The Data tab can collect these values together with outputs from nested measurement plugins.
The plugin uses the application’s preferred motor controller and connects it through the shared
MotorControllerEnginewhen necessary. Finishing the scan leaves that shared engine connected; it does not home the motor or issue an additional move on disconnect.- Variables:
scan_generator (BaseScanGenerator) – Generator supplying absolute target angles in degrees.
velocity (float | str) – Move velocity or sequence expression in degrees per second.
acceleration (float | str) – Move acceleration or sequence expression in degrees per second squared.
direction (MotorMoveDirection) – Direction policy used for each absolute move.
report_outputs (list[str] | None) – Optional selection of motor readbacks exposed to the sequence value catalogue;
Noneselects all available readbacks.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.
value (float) – Inherited current sequence control value.
ix (int) – Inherited zero-based iteration index.
meas_flag (bool) – Inherited flag indicating a measurement point.
collect_data (bool) – Inherited switch enabling collection of selected sequence outputs.
data (TraceData) – Inherited accumulated table; inspect data.df after collection.
- Keyword Parameters:
parent (QObject | None) – Optional Qt parent object.
Examples
With a sequence instance named
motor_controller_scan, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:motor_controller_scan.velocity = 5.0 motor_controller_scan.collect_data = True motor_controller_scan.data.df.head()
- property state_name: str¶
Human-readable name of the controlled or swept physical quantity.
- Returns:
E.g.
"Magnetic Field","Temperature","Time".- Return type:
(str)
- to_json() dict[str, object][source]¶
Serialise this plugin’s configuration, including the scan generator.
Extends
to_json()with a"scan_generator"key.Examples
>>> from qtpy.QtWidgets import QApplication >>> _ = QApplication.instance() or QApplication([]) >>> from stoner_measurement.plugins.state_scan import CounterPlugin >>> plugin = CounterPlugin() >>> d = plugin.to_json() >>> d["type"] 'state_scan' >>> "scan_generator" in d True >>> d["collect_data"] False >>> d["clear_on_start"] True