temfield_mpylab.measurement_worker

class temfield_mpylab.measurement_worker.AMWaveformLimits(maximum_peak_compression_db: float = 1.0, minimum_modulation_depth_percent: float = 75.0, maximum_modulation_depth_percent: float = 85.0, minimum_modulation_frequency_khz: float = 0.95, maximum_modulation_frequency_khz: float = 1.05, minimum_r_squared: float = 0.995, maximum_normalized_rmse: float = 0.03, carrier_relative_tolerance: float = 0.02, maximum_peak_relative_tolerance: float = 0.02, maximum_stability_relative_spread: float = 0.02, required_stable_waveforms: int = 3)[source]

Bases: object

Engineering limits for TEMField’s in-loop AM validation.

The 2 dB difference between the ideal 5.1 dB AM peak ratio and the historical 3.1 dB saturation boundary motivates an outer compression limit. TEMField uses the more conservative 1 dB default because the EUT is already present during this validation.

maximum_peak_compression_db: float = 1.0
minimum_modulation_depth_percent: float = 75.0
maximum_modulation_depth_percent: float = 85.0
minimum_modulation_frequency_khz: float = 0.95
maximum_modulation_frequency_khz: float = 1.05
minimum_r_squared: float = 0.995
maximum_normalized_rmse: float = 0.03
carrier_relative_tolerance: float = 0.02
maximum_peak_relative_tolerance: float = 0.02
maximum_stability_relative_spread: float = 0.02
required_stable_waveforms: int = 3
as_dict()[source]

Return a serialization-friendly mapping.

__init__(maximum_peak_compression_db: float = 1.0, minimum_modulation_depth_percent: float = 75.0, maximum_modulation_depth_percent: float = 85.0, minimum_modulation_frequency_khz: float = 0.95, maximum_modulation_frequency_khz: float = 1.05, minimum_r_squared: float = 0.995, maximum_normalized_rmse: float = 0.03, carrier_relative_tolerance: float = 0.02, maximum_peak_relative_tolerance: float = 0.02, maximum_stability_relative_spread: float = 0.02, required_stable_waveforms: int = 3) None
class temfield_mpylab.measurement_worker.InLoopAMValidationResult(status: str, passed: bool, reason: str, factor: float, target_field_v_per_m: float, start_field_v_per_m: float, limits: AMWaveformLimits, ramp_points: tuple, stable_waveforms: tuple, carrier_correction_attempts: int = 0, carrier_correction_waveforms: tuple = (), method: str = 'in_loop_waveform_rapp', normative: bool = False, ramp_strategy: str = 'adaptive_square_law')[source]

Bases: object

Result of TEMField’s non-normative waveform validation.

Parameters:
  • status (str) – Machine-readable decision status.

  • passed (bool) – Whether the final waveform set satisfies all configured limits.

  • reason (str) – Human-readable decision reason.

  • factor (float) – Positive AM peak factor 1 + m.

  • target_field_v_per_m (float) – Requested fitted carrier field in volts per metre.

  • start_field_v_per_m (float) – Safe CW starting field in volts per metre.

  • limits (AMWaveformLimits) – Engineering limits used for the decision.

  • ramp_points (tuple) – Fitted waveform diagnostics acquired during the upward ramp.

  • stable_waveforms (tuple) – Final waveform fits used for the reported decision.

  • carrier_correction_attempts (int, optional) – Number of downward final-carrier corrections applied.

  • carrier_correction_waveforms (tuple, optional) – Otherwise valid final fits superseded by the downward correction.

  • method (str, optional) – Validation method identifier.

  • normative (bool, optional) – Whether the method claims normative IEC status.

  • ramp_strategy (str, optional) – Actor-level ramp strategy identifier.

status: str
passed: bool
reason: str
factor: float
target_field_v_per_m: float
start_field_v_per_m: float
limits: AMWaveformLimits
ramp_points: tuple
stable_waveforms: tuple
carrier_correction_attempts: int = 0
carrier_correction_waveforms: tuple = ()
method: str = 'in_loop_waveform_rapp'
normative: bool = False
ramp_strategy: str = 'adaptive_square_law'
as_dict()[source]

Return a serialization-friendly mapping.

__init__(status: str, passed: bool, reason: str, factor: float, target_field_v_per_m: float, start_field_v_per_m: float, limits: AMWaveformLimits, ramp_points: tuple, stable_waveforms: tuple, carrier_correction_attempts: int = 0, carrier_correction_waveforms: tuple = (), method: str = 'in_loop_waveform_rapp', normative: bool = False, ramp_strategy: str = 'adaptive_square_law') None
temfield_mpylab.measurement_worker.analyse_am_waveform(times_ms, values, modulation_depth_percent)[source]

Fit sinusoidal and Rapp models to one measured field waveform.

peak_compression_db is the differential AM/AM gain loss between the carrier input and the positive AM peak. It is independent of the fitted absolute field scale and is therefore directly comparable across frequencies and target field strengths.

temfield_mpylab.measurement_worker.validate_am_fit(fit, target_field_v_per_m, modulation_depth_percent, limits, *, check_carrier=True)[source]

Return (passed, reason) for one final-target waveform fit.

check_carrier=False is used when several stable final waveforms are available and their mean carrier level is evaluated separately with validate_carrier_level(). All per-waveform signal-quality, modulation, compression, and peak-safety limits remain active.

temfield_mpylab.measurement_worker.validate_carrier_level(fits, target_field_v_per_m, limits)[source]

Validate the mean carrier field of stable final-target waveforms.

temfield_mpylab.measurement_worker.validate_waveform_stability(fits, limits)[source]

Return whether consecutive final-target waveforms are sufficiently stable.

class temfield_mpylab.measurement_worker.TestSusceptibility(parent=None)[source]

Bases: Measure

__init__(parent=None)[source]

constructor

Init(names=None, datafunc=None, pin=None, dwell_time=None, e_target=None, dotfile=None, SearchPath=None, leveler_par=None, adjust_to_setting=None, probe_orientations=None)[source]

Configure the susceptibility measurement.

Raw field-probe readings are mapped once from probe coordinates into the final (Ex, Ey, Ez) cell-coordinate order. Component selection and custom datafunc callbacks operate on that mapped vector.

Parameters:
  • names (mapping, optional) – Measurement-graph role to node-name mapping.

  • datafunc (callable, optional) – Custom observer function receiving an already ordered three-axis field vector. By default, adjust_to_setting selects the value.

  • pin (iterable of float, optional) – Initial signal-generator levels in dBm.

  • dwell_time (float, optional) – Exposure time in seconds; defaults to one second.

  • e_target (float, optional) – Requested carrier field strength in volts per metre.

  • dotfile (path-like, optional) – Measurement-graph DOT file.

  • SearchPath (iterable of path-like, optional) – Search paths used to resolve graph configuration files.

  • leveler_par (mapping, optional) – Explicit mpylab leveler parameters.

  • adjust_to_setting ({"x", "y", "z", "mag", "largest"}, optional) – Field value used for leveling. Missing and legacy "auto" values select "y".

  • probe_orientations (mapping, optional) – Direct or per-probe orientation configuration. Graph-node and field-probe INI metadata are used when this is omitted.

init_measurement(am)[source]

Initialize devices and AM configuration while keeping RF off.

reset_to_safe_actor_level()[source]

Reset the generator to its lowest configured level with RF off.

rf_on()[source]
rf_off()[source]
am_on()[source]
am_off()[source]
adjust_level(target_field=None)[source]

Level to the target field and return the full probe field vector.

The structured mpylab.tools.mgraph.LevelingResult is retained in last_leveling_result. Callers must only expose the EUT to the test field when that result has status converged.

prepare_am_waveform_validation(modulation_depth_percent)[source]

Level only to the safe CW starting field for in-loop AM validation.

Parameters:

modulation_depth_percent (float) – Sinusoidal AM depth from 0 through 100 percent. It determines the peak-to-carrier factor used to keep the initial AM peak at or below the requested carrier field.

Returns:

Three-axis probe field at e_target / (1 + modulation_depth).

Return type:

list of scuq.quantities.Quantity

Notes

TEMField deliberately does not approach factor * e_target as CW: the EUT is already in the test volume. Amplifier linearity is assessed later from the actual AM waveform while its level is increased from this safe starting point.

set_am_ramp_level(actor_level)[source]

Apply one protected signal-generator level during the AM ramp.

read_field()[source]

Return the current mapped three-axis field-probe reading.

leveling_succeeded()[source]

Return whether the most recent leveling operation converged.

get_waveform()[source]
do_measurement(f)[source]
quit_measurement()[source]
stdUserInterruptHandler(dct, ignorelist='')[source]
class temfield_mpylab.measurement_worker.TEMFieldWorker(*, dwell_time, e_target, names, dotfile, searchpath, adjust_to_setting, am, freqs, eut_monitor=None, manual_eut_monitor=None, performance_criterion='A', eut_event_policy=None, post_exposure_timeout=10.0, probe_orientations=None, am_waveform_limits=None, am_ramp_step_db=1.0, am_ramp_settle_time=0.05)[source]

Bases: QObject

__init__(*, dwell_time, e_target, names, dotfile, searchpath, adjust_to_setting, am, freqs, eut_monitor=None, manual_eut_monitor=None, performance_criterion='A', eut_event_policy=None, post_exposure_timeout=10.0, probe_orientations=None, am_waveform_limits=None, am_ramp_step_db=1.0, am_ramp_settle_time=0.05)[source]

Create a measurement worker.

Raw field-probe components are mapped once into TEM-cell coordinates by the measurement layer before the worker evaluates or exports them.

Parameters:
  • dwell_time (float) – Exposure time per frequency in seconds.

  • e_target (float) – Requested carrier field strength in volts per metre.

  • names (mapping) – Measurement-graph role to node-name mapping.

  • dotfile (path-like) – Measurement-graph DOT file.

  • searchpath (iterable of path-like) – Search paths used to resolve graph configuration files.

  • adjust_to_setting ({"x", "y", "z", "mag", "largest"}) – Field value used for leveling and waveform analysis.

  • am (float) – Sinusoidal AM depth in percent.

  • freqs (iterable of float) – RF frequencies in hertz.

  • eut_monitor (mpylab.env.eut.EUTMonitor, optional) – Automatic EUT monitor.

  • manual_eut_monitor (mpylab.env.eut.ManualEUTMonitor, optional) – Operator-driven EUT monitor.

  • performance_criterion (str, optional) – IEC 61000-4-20 EUT performance criterion.

  • eut_event_policy (mapping, optional) – Actions for reported EUT event states.

  • post_exposure_timeout (float, optional) – Maximum post-exposure monitoring time in seconds.

  • probe_orientations (mapping, optional) – Direct or per-probe orientation checked against graph metadata.

  • am_waveform_limits (AMWaveformLimits or mapping, optional) – Model-based compression, signal-quality, field, and stability limits for the in-loop AM waveform validation.

  • am_ramp_step_db (float, optional) – Maximum signal-generator power step during the AM ramp.

  • am_ramp_settle_time (float, optional) – Settling time before each waveform acquisition, in seconds.

run()[source]
stop()[source]
toggle_pause()[source]
rf_on()[source]
rf_off()[source]
am_on()[source]
am_off()[source]