stoner_measurement.plugins.state_scan.network_analyser.NetworkAnalyserPointScanPlugin¶
- class stoner_measurement.plugins.state_scan.network_analyser.NetworkAnalyserPointScanPlugin(parent=None)[source]¶
Bases:
StateScanPluginScan 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
RFPulseModInsignal 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()
- declared_outputs() PluginOutputs[source]¶
Declare configured outputs and their physical units together.
- get_s_parameter(parameter: str) float | None[source]¶
Return the most recently acquired formatted S-parameter value.
- is_at_target() bool[source]¶
Return
Truewhen the hardware has settled at the commanded target.- Returns:
Trueif settled;Falsewhile ramping or settling.- Return type:
(bool)
- 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, andscan_generator_changedis 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.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