stoner_measurement.plugins.state_scan.network_analyser.NetworkAnalyserPointScanPlugin

class stoner_measurement.plugins.state_scan.network_analyser.NetworkAnalyserPointScanPlugin(parent=None)[source]

Bases: StateScanPlugin

Scan frequency or source power point-by-point and publish S-parameters.

Use this state-scan plugin when sequence steps must run at every network- analyser state. At each generated point it sets the selected frequency and power, performs a short two-reading CW acquisition, averages each complex S-parameter, and publishes the requested scalar representations. Nested steps run after this point measurement and may consume its outputs or make measurements with other instruments, such as a lock-in amplifier.

The Scan tab supplies the frequency or power points using the normal state-scan generators, including ramps, lists, and expression-based generators. The Settings tab selects the Agilent E5062A or N5222A, GPIB resource, channel, scan variable, complementary fixed setting, IF bandwidth, averaging, correction state, timeout, S-parameters, and output representation.

The complementary fixed setting accepts either a number or a sequence expression and is evaluated again at every scan point. An inner frequency scan can therefore use the source power from an outer loop, or an inner power scan can use an outer-loop frequency. IF bandwidth and timeout also accept expressions; bandwidth is evaluated during configuration, while timeout is evaluated for each point acquisition.

Published scalar outputs comprise the scanned state, point index, complementary fixed value, and each selected S-parameter. S-parameters may be represented as log magnitude in dB, linear magnitude, phase in degrees, real part, or imaginary part. When data collection is enabled, these outputs and outputs from nested steps can be selected on the Data tab. Apply error correction uses the channel’s existing calibration and does not perform a calibration.

On an N5222A, External TTL RF gating connects the rear-panel RFPulseModIn signal to the selected source modulator. This is digital carrier on/off gating, not analogue amplitude modulation. The gate remains enabled while the scan and its nested steps execute and is disabled during disconnect. The E5062A has no documented equivalent RF-gate input, so this control is unavailable for that model.

Variables:
  • scan_generator (BaseScanGenerator) – Generator providing frequency values in hertz or source-power values in dBm.

  • _scan_variable (NetworkAnalyserSweepVariable) – Quantity controlled by the scan generator.

  • _selected_parameters (tuple[str, ...]) – S-parameters published after each point acquisition.

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

network_analyser_point_scan.collect_data = True
network_analyser_point_scan.data.df.head()
configure() → None[source]

Configure a short CW acquisition and the selected measurement slots.

connect() → None[source]

Open the selected analyser and verify its exact model.

declared_outputs() → PluginOutputs[source]

Declare configured outputs and their physical units together.

disconnect() → None[source]

Disable any gate enabled by this plugin, then close the analyser.

property fixed_state_name: str
property fixed_units: str
get_s_parameter(parameter: str) → float | None[source]

Return the most recently acquired formatted S-parameter value.

get_state() → float[source]

Return the current measured value of the controlled quantity.

Returns:

Present value in the units of units.

Return type:

(float)

is_at_target() → bool[source]

Return True when the hardware has settled at the commanded target.

Returns:

True if settled; False while ramping or settling.

Return type:

(bool)

property name: str

Unique human-readable name for this plugin.

set_scan_generator_class(cls: type[BaseScanGenerator]) → None[source]

Replace the active scan generator with a new instance of cls.

If the current generator is already an instance of cls this method does nothing. Otherwise a new instance is created, assigned to scan_generator, and scan_generator_changed is emitted.

Parameters:

cls (type[BaseScanGenerator]) – The scan generator class to instantiate.

Examples

>>> from qtpy.QtWidgets import QApplication
>>> _ = QApplication.instance() or QApplication([])
>>> from stoner_measurement.plugins.state_scan import CounterPlugin
>>> plugin = CounterPlugin()
>>> from stoner_measurement.scan import SteppedScanGenerator
>>> plugin.set_scan_generator_class(SteppedScanGenerator)
>>> isinstance(plugin.scan_generator, SteppedScanGenerator)
True
set_state(value: float) → None[source]

Program one state point, evaluate the fixed expression, and acquire.

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, Any][source]

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

Extends to_json() with a "scan_generator" key.

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_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
property units: str

Physical unit of the controlled or swept quantity.

Returns:

E.g. "T", "K", "s".

Return type:

(str)