stoner_measurement.plugins.transform.fourier_transform.FourierTransformPlugin

class stoner_measurement.plugins.transform.fourier_transform.FourierTransformPlugin(parent=None)[source]

Bases: TraceChannelSelectionMixin, TransformPlugin

Transform selected trace data between time and frequency domains.

Use this transform when you want to inspect a trace in the reciprocal domain or reconstruct a time-domain signal from frequency-domain data. The plugin takes selected x/y data, sorts it by x, resamples it onto a uniform grid, and then performs either a forward FFT or an inverse FFT.

In the configuration tabs, the data-selection tab always selects a source trace and column. Advanced mode may override the calculation inputs with x/y expressions while retaining that source context for output naming. A second tab selects whether the transform is forward or inverse.

The output trace contains magnitude, real, imaginary, and phase columns, all sharing a reciprocal-domain x axis.

Variables:
  • trace_key (str) – Key in the _traces catalogue used in simple mode. Defaults to "".

  • column_key (str) – Selected column key from the chosen source trace. Defaults to "".

  • advanced_mode (bool) – When True, evaluate x_expr and y_expr instead of using the selected trace arrays. Defaults to False.

  • x_expr (str) – Python expression used to compute x data in advanced mode. Defaults to "".

  • y_expr (str) – Python expression used to compute y data in advanced mode. Defaults to "".

  • inverse (bool) – When False, compute a forward Fourier transform. When True, treat the input as shifted frequency-domain data and compute an inverse transform. Defaults to False.

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

  • data (dict[str, Any]) – Inherited latest output mapping populated by run(), containing scalar and/or TraceData results.

Keyword Parameters:

parent (QObject | None) – Optional Qt parent object.

Notes

Non-uniform input spacing is handled by interpolation to a uniform grid before applying FFT routines. The output trace contains four columns: magnitude, real part, imaginary part, and angle. The output x-axis unit is converted to the reciprocal of the input x unit where practical.

Examples

With an instance named fourier_transform in the sequence, use the QtConsole to inspect or edit it before running. Substitute your instance name if different; result data reflects completed steps:

fourier_transform.inverse = False
fourier_transform.data
config_tabs(parent: QWidget | None = None) → list[tuple[str, QWidget]][source]

Return plugin configuration tabs.

Keyword Parameters:

parent (QWidget | None) – Optional parent widget.

Returns:

Cached list of configuration-tab title/widget pairs.

Return type:

(list[tuple[str, QWidget]])

declared_outputs() → PluginOutputs[source]

Declare typed transform results without repeating output names.

property name: str

Return the plugin display name.

Returns:

"Fourier Transform".

Return type:

(str)

property required_inputs: list[str]

Return the runtime inputs required by this plugin.

Returns:

An empty list because the plugin reads from selected trace data rather than direct named inputs.

Return type:

(list[str])

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

Serialise plugin configuration to JSON-compatible data.

Returns:

Serialised configuration dictionary including data-selection and transform-mode settings.

Return type:

(dict[str, Any])

transform(data: dict[str, Any]) → dict[str, Any][source]

Return Fourier-domain or time-domain data for the selected trace.

Parameters:

data (dict[str, Any]) – Unused transform input mapping. Present for API compatibility.

Returns:

Mapping containing the output TraceData under the "fft" key, or an empty dict when the transform cannot be performed.

Return type:

(dict[str, Any])