stoner_measurement.plugins.state_sweep.magnet_controller.MagnetControllerSweepPlugin

class stoner_measurement.plugins.state_sweep.magnet_controller.MagnetControllerSweepPlugin(parent=None)[source]

Bases: MagnetControllerPluginMixin, StateSweepPlugin

Sweep the magnetic field continuously while collecting data in motion.

Use this plugin when you want the magnet field to ramp continuously and your measurement sub-sequence to run repeatedly while the field is changing. This is useful for field sweeps where the exact timing within the ramp matters, or where stopping to stabilise at many discrete points would be too slow.

Sweep selects the trajectory, segment targets, rates, measurement flags and timeout factor. Settings selects reported magnet readbacks; sweep motion rates come from generator segments. Data selects collected values and column roles. Shared-engine status supplies field and stability readbacks; a reported quench stops execution.

Rates for multi-segment ramp sweeps are interpreted in T/min and the default timeout factor for this plugin is 2.0. Together, those define the default wall-clock timeout used for estimated sweep durations.

Variables:
  • sweep_timeout_factor (float) – Multiplier applied to the estimated sweep duration when computing the allowed wall-clock runtime.

  • default_sweep_timeout_factor (float) – Default timeout multiplier for magnet sweeps. This plugin uses 2.0.

  • sweep_rate_time_scale_seconds (float) – Time-scale factor used to interpret sweep rates. This plugin uses 60.0 so that configured ramp rates are treated as T/min.

  • sweep_generator (BaseSweepGenerator) – Active sweep generator instance controlling the field trajectory.

  • value (float) – Most recently sampled control value, in tesla.

  • ix (int) – Index of the most recently yielded sweep point.

  • ramp_rate (float | str) – Ramp rate in tesla per minute or runtime expression.

  • use_plugin_ramp_rate (bool) – Use the plugin rate for applicable moves.

  • report_outputs (list[str] | None) – Selected controller readbacks; None selects all.

  • 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.

  • 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 magnet_controller_sweep, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:

magnet_controller_sweep.sweep_timeout_factor = 3.0
magnet_controller_sweep.collect_data = True
magnet_controller_sweep.data.df.head()
configure() → None

Configure the instrument (NOP default).

connect() → None

Open instrument connections (NOP default).

disconnect() → None

Leave the shared engine running.

property limits: tuple[float, float]

Return symmetric limits with uncertainty for live field readings.

The driver continues to enforce the exact configured limit for target commands. The sweep loop, however, checks measured values and must allow small regulation, calibration, and rounding differences at the boundary.

property name: str

Unique human-readable name for this plugin.

property state_name: str

Human-readable name for the swept state.

to_json() → dict[str, object][source]

Serialise this plugin’s configuration, including the sweep generator.

Extends to_json() with "sweep_generator" and "sweep_timeout_factor" keys.

Returns:

JSON-serialisable dictionary with all plugin keys.

Return type:

(dict[str, Any])

Examples

>>> from qtpy.QtWidgets import QApplication
>>> _ = QApplication.instance() or QApplication([])
>>> from stoner_measurement.plugins.state_sweep import SweepTimePlugin
>>> d = SweepTimePlugin().to_json()
>>> d["type"]
'state_sweep'
>>> "sweep_generator" in d
True
>>> d["sweep_timeout_factor"]
2.0
property units: str

Physical units for the swept state.