stoner_measurement.plugins.command.network_analyser_set.NetworkAnalyserSetCommand

class stoner_measurement.plugins.command.network_analyser_set.NetworkAnalyserSetCommand(parent=None)[source]

Bases: CommandPlugin

Perform one CW network-analyser set-and-measure operation.

Use this command when a sequence needs one network-analyser reading rather than an analyser-controlled trace or a point-by-point scan loop. Each invocation connects to the selected Agilent E5062A or N5222A, evaluates the requested frequency, source power, and IF bandwidth, configures a short two-reading CW acquisition, averages each complex S-parameter, and disconnects after publishing the results.

The configuration page contains expression-capable Frequency, Source power, IF bandwidth, and Point timeout controls. Each is evaluated in the live sequence namespace whenever the command executes. This makes the command suitable beneath an outer temperature, field, frequency, or power loop without creating another scan container. The remaining controls select the analyser model and GPIB resource, channel, averaging, existing correction state, S-parameters, and scalar output representation.

The command publishes Frequency in hertz, Source power in dBm, and one output for each selected S-parameter. S-parameters may be represented as log magnitude in dB, linear magnitude, phase in degrees, real part, or imaginary part. Apply error correction uses the calibration already active in the selected channel; the command does not create or replace a calibration.

This is a leaf command and cannot contain nested sequence steps. On an N5222A, external TTL RF gating applies only during the command’s own CW acquisition and is disabled before disconnect. Use NetworkAnalyserPointScanPlugin when the RF gate must remain active while a nested lock-in or other device measurement runs. The E5062A has no documented equivalent RF-gate input.

Variables:
  • _frequency_hz (float | str) – CW frequency or sequence expression in hertz.

  • _power_dbm (float | str) – Source power or sequence expression in dBm.

  • _if_bandwidth_hz (float | str) – IF bandwidth or sequence expression in hertz.

  • _selected_parameters (tuple[str, ...]) – S-parameters published by the most recent execution.

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

network_analyser_set._frequency_hz = "measurement_frequency"
network_analyser_set._power_dbm = -20.0
config_widget(parent: QWidget | None = None) → QWidget[source]

Return a QWidget for configuring this plugin.

The default implementation returns a simple label. Override this method to provide a richer configuration interface. This method is called by the default config_tabs() implementation to supply the single tab widget.

Keyword Parameters:

parent (QWidget | None) – Optional Qt parent widget.

Returns:

The configuration widget for this plugin.

Return type:

(QWidget)

Examples

>>> from qtpy.QtWidgets import QApplication
>>> _ = QApplication.instance() or QApplication([])
>>> from stoner_measurement.plugins.trace import DummyPlugin
>>> plugin = DummyPlugin()
>>> widget = plugin.config_widget()
>>> widget is not None
True
declared_outputs() → PluginOutputs[source]

Declare configured outputs and their physical units together.

execute() → None[source]

Perform one complete CW point measurement.

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

Return the most recently acquired formatted S-parameter.

property name: str

Unique human-readable name for this plugin.

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

Serialise this plugin’s configuration to a JSON-compatible dict.

The returned dict contains at minimum:

  • "type" — the plugin sub-type tag (e.g. "trace", "state").

  • "class" — the fully qualified class path "module:ClassName" used by from_json() to reconstruct the exact subclass.

  • "instance_name" — the current instance_name.

Subclasses should call super().to_json() and then add their own configuration keys to the returned dict.

Returns:

A JSON-serialisable dictionary representing this plugin’s current configuration.

Return type:

(dict[str, Any])

Examples

>>> from qtpy.QtWidgets import QApplication
>>> _ = QApplication.instance() or QApplication([])
>>> from stoner_measurement.plugins.trace import DummyPlugin
>>> plugin = DummyPlugin()
>>> d = plugin.to_json()
>>> d["type"]
'trace'
>>> d["instance_name"]
'dummy'
>>> "class" in d
True