mpylab.env.tem.TEMCell module¶
This is mpylab.env.tem.TEMCell.
Provides mpylab.env.tem.TEMCell for EMC measurements in TEM cells
- author:
Hans Georg Krauthäuser (main author)
- license:
GPL-3 or higher
- class mpylab.env.tem.TEMCell.FieldProbeMonitorLeveler(actor, reader, start_level=None, component='y', probe_axis_map=None, monitor_cell_axis='cell_y', set_level_callback=None)
Bases:
objectHardware-independent field-probe monitor leveler core.
- Parameters:
actor (object) – Device exposing
SetLeveland optionallyGetLevel.reader (object) – Field probe exposing
GetData.start_level (Quantity or float, optional) – Initial actor power. Required when the actor has no
GetLevel.component (str, optional) – Compatibility parameter retained for callers using the older API.
probe_axis_map (Mapping, str, or None, optional) – Orientation used to transform probe readings into cell coordinates.
monitor_cell_axis (str, optional) – Cell axis controlled by the leveler.
set_level_callback (callable, optional) – Protected level-setting function returning applied level and metadata.
Notes
The leveler adjusts an actor with
SetLevelso that a reader withGetDataobserves a requested field strength. Actor levels are handled as power quantities and updated with the squared field ratio.- adjust_level(target_field, maxiter=10, relerr=0.01)
Adjust actor power until the monitor field reaches
target_field.The historical
(applied_level, observed_field)return value is retained. Structured completion details are available throughlast_result.- Parameters:
target_field (Quantity or float) – Positive target field strength.
maxiter (int, optional) – Maximum number of level adjustments.
relerr (float, optional) – Required relative field error.
- Returns:
Applied actor power and observed field strength.
- Return type:
tuple[Quantity, Quantity]
- Raises:
RuntimeError – If the requested tolerance is not reached within
maxiter.
- class mpylab.env.tem.TEMCell.TEMCell
Bases:
MeasureA class for TEM-cell measurements according to IEC 61000-4-20
- Calculate_Emax(description='EUT', Dmax=3.0, s=10, hg=0.8, RH=(1, 4), rstep=None, Zc=50, is_oats=True)
This function estimates the maximum E field strength, as it would be expected from a OATS/FAR measurement, from the total radiated power determined by
Calculate_Prad().- Parameters:
description (-) – String to identify the emission measurement.
Dmax (-) – the maximum of the direktivity of the EUT.
s (-) – Distance from the EUT in meters
hg (-) – height over ground plane in meters
RH (-) – range of the hight scan in meters
rstep (-) – the step width of the hight scan used to calculate the max. Used in
mpylab.tools.radiated_emission_geometry.gmax_oats()Zc (-) – characteristic impedance of the TEM cell in Ohms (forwarded to
Calculate_Prad())is_oats (-) – if True, a ground plane is assumed, else free space
- Calculate_EmissionLimitComparison(description='EUT', emission_limit=None)
Compare calculated emission field strength against a radiated-emission limit.
The comparison uses
Emax[f][port][index]["total"]and stores one result dictionary per frequency, port and result index inprocessedData_Emission[description]["LimitComparison"].- Parameters:
description (str, optional) – Processed emission dataset description.
emission_limit (object or Mapping) – Radiated-emission limit object or configuration.
- Returns:
Zero on success, negative when required data are missing.
- Return type:
int
- Calculate_EmissionPrescreen(description='EUT', emission_limit=None, e0y_description='Main EUT Pos', use_e0y_GTEManalytical=None, EUTpos=None, Zc=50, Dmax=3.0, s=10, hg=0.8, RH=(1, 4), rstep=None, is_oats=True, component='y', evaluate3pos=None, e0y_position_wavelength_factor=0.5, margin_db=6.0, position_count=None, prescan_detector='PK')
Calculate voltage prescreening data for detector remeasurement.
- Parameters:
description (str, optional) – Emission dataset description.
emission_limit (object or Mapping, optional) – Limit defining the required final detector; no limit disables the prescreen.
e0y_description (str, optional) – Explicit data-based e0y source.
use_e0y_GTEManalytical (bool or None, optional) – Use analytical e0y from the stored geometry.
EUTpos (Mapping, optional) – EUT x/y and h or z coordinates.
Zc (Quantity or float, optional) – Cell characteristic impedance in ohms.
Dmax (float, optional) – Assumed maximum EUT directivity.
s (float, optional) – Evaluation distance in metres.
hg (float, optional) – EUT height above ground in metres.
RH (tuple[float, float], optional) – Receive-height scan range in metres.
rstep (float or None, optional) – Optional receive-height calculation step.
is_oats (bool, optional) – Apply OATS rather than free-space correlation.
component (str, optional) – Cell field component used by the e0y source.
evaluate3pos (bool or None, optional) – Restrict the position assumption to three orientations.
e0y_position_wavelength_factor (float, optional) – Accepted point-source displacement as a wavelength fraction.
margin_db (float, optional) – Margin below the inverted limit that triggers remeasurement.
position_count (int or None, optional) – Number of equal-voltage EUT positions assumed by the inversion.
prescan_detector (str, optional) – Detector used for the initial fast measurement.
- Returns:
Zero on success or when no limit is configured; negative on error.
- Return type:
int
- Calculate_Prad(description='EUT', e0y_description='Main EUT Pos', use_e0y_GTEManalytical=None, EUTpos=None, Zc=50, component='y', evaluate3pos=None, e0y_position_wavelength_factor=0.5, detector=None, fallback_detector='PK')
Calculate total radiated power from TEM-cell emission voltages.
- Parameters:
description (str, optional) – Emission dataset description.
e0y_description (str, optional) – Explicit data-based e0y source description.
use_e0y_GTEManalytical (bool or None, optional) – Use analytical e0y from the stored GTEM geometry.
EUTpos (Mapping, optional) – EUT x/y and h or z coordinates.
Zc (Quantity or float, optional) – Cell characteristic impedance in ohms.
component (str, optional) – Cell field component used by the e0y source.
evaluate3pos (bool or None, optional) – Restrict correlation to the first three standard positions.
e0y_position_wavelength_factor (float, optional) – Accepted point-source displacement as a wavelength fraction.
detector (str, optional) – Force one detector for final correlation.
fallback_detector (str, optional) – Detector used when the required limit detector is unavailable.
Notes
Results are stored below
PradandPrad_noisein the processed emission dataset.
- Evaluate_Emission(description='EUT', e0y_description='Main EUT Pos', use_e0y_GTEManalytical=None, EUTpos=None, Zc=50, Dmax=3.0, s=10, hg=0.8, RH=(1, 4), is_oats=None, component='y', evaluate3pos=None, e0y_position_wavelength_factor=0.5, emission_limit=None)
Calculate maximum radiated field from a TEM-cell emission result.
- Parameters:
description (str, optional) – Raw and processed emission dataset description.
e0y_description (str, optional) – Explicit measured or Verification-derived e0y source description.
use_e0y_GTEManalytical (bool or None, optional) – Use analytical e0y from the stored GTEM geometry.
EUTpos (Mapping, optional) – EUT x/y and h or z coordinates. Stored measurement coordinates are used when omitted.
Zc (Quantity or float, optional) – Cell characteristic impedance in ohms.
Dmax (float, optional) – Assumed maximum EUT directivity.
s (float, optional) – Evaluation distance in metres.
hg (float, optional) – EUT height above the ground plane in metres.
RH (tuple[float, float], optional) – Receive-antenna height-scan range in metres.
is_oats (bool or None, optional) – Apply OATS ground-plane correlation;
Nonedefaults to true.component (str, optional) – Cell field component used by the e0y source.
evaluate3pos (bool or None, optional) – Restrict correlation to the first three standard positions.
e0y_position_wavelength_factor (float, optional) – Accepted point-source displacement as a wavelength fraction.
emission_limit (object or Mapping, optional) – Radiated-emission limit used for final comparison.
Notes
Results are written to
processedData_Emission[description].
- Evaluate_Immunity(description='EUT', eut_status_checker=None)
Summarize a TEM/GTEM immunity measurement.
The immunity measurement result is primarily the EUT status observed at each frequency and EUT position. This evaluator copies the measured status together with the applied test field and forward/backward power into
processedData_Immunity[description]['result']and adds a booleanpassedflag per point. Requested exposures without an EUT status are reported separately as incomplete. This includes exposures skipped because amplifier protection prevented the requested field.- Parameters:
description (str, optional) – Raw and processed immunity dataset description.
eut_status_checker (callable, optional) – Compatibility predicate for legacy EUT status values.
- Returns:
Zero on success, negative when required raw data are missing.
- Return type:
int
- Evaluate_Verification(description='GTEM', component='y', probe_axis_map=None, field_uniformity_scale='all', selected_field_uniformity_scale='db', analytical_e0y_max_m=1000)
Evaluate TEM mode verification data.
The result is written to
processedData_Verification[description]and contains frequency-indexedreference_fieldandforward_powervalues. The evaluation follows the newer IEC 61000-4-20 TEM-mode verification logic for the constant-forward-power method. Because the interpretation of the field-uniformity statistics is still under discussion,field_uniformity_scalecan be"db","linear","coverage","both", or"all". The selected scale feeds the operationalreference_fieldand pass/fail result; when"all"is used, the dB, linear, and legacy 75 % coverage alternatives are stored in the processed data.componentselects the primary TEM/GTEM cell axis,"y"by default. Field-probe vectors are mapped to cell axes usingprobe_axis_map. Ifprobe_axis_mapis omitted, the mapping stored with the raw data is used when it is unambiguous; otherwise the default axis identity mapping is used.- Parameters:
description (str, optional) – Raw and processed Verification dataset description.
component (str, optional) – Primary TEM field component.
probe_axis_map (Mapping, str, or None, optional) – Explicit probe-to-cell orientation override.
field_uniformity_scale (str, optional) – Statistics to calculate:
db,linear,coverage,both, orall.selected_field_uniformity_scale (str, optional) – Statistic used for the operational result.
analytical_e0y_max_m (int, optional) – Upper analytical-series index for the e0y comparison.
- Returns:
Zero on success, negative when required raw data are missing.
- Return type:
int
- Evaluate_e0y(description=None, analytical_e0y_max_m=1000)
Evaluate measured GTEM
e0ydata.The result is written to
processedData_e0y[description]. If raw geometry or source metadata are available, they are copied to the processed result. Raw data without explicit source metadata are marked assource_type = "unknown"andmethod = "measured_e0y". When point-source position metadata and GTEM geometry are available, the measured cell-ye0yis also compared with the analytical GTEM value. This comparison is informational and does not alter the frequency-indexede0ytable used by emission evaluation.- Parameters:
description (str) – Raw and processed e0y dataset description.
analytical_e0y_max_m (int, optional) – Upper analytical-series index used for the comparison.
- Returns:
Zero on success, negative when required raw data are missing or geometrically inconsistent.
- Return type:
int
- Measure_Emission(description='EUT', positions=None, dotfile='gtem-emission.dot', delay=0.0, freqs=None, receiverconf=None, SearchPaths=None, names=None, eut_h=None, eut_z=None, eut_x=None, eut_y=None, emission_limit=None, e0y_description='Main EUT Pos', use_e0y_GTEManalytical=None, EUTpos=None, Zc=50, Dmax=3.0, s=10, hg=0.8, RH=(1, 4), is_oats=None, component='y', e0y_position_wavelength_factor=0.5, prescreen_margin_db=6.0, prescreen_position_count=None, prescan_detector='PK', acquisition_mode='auto', scan_chunk_size=None, progress_log_batch_size=500, detailed_point_logging=False, progress_callback=None, cancel_callback=None, preflight_only=False, preflight_cache=True, preflight_cache_dir=None, battery_check_interval=60.0)
Performs a emission measurement according to IEC 61000-4-20.
- Parameters:
description (str, optional) – Measurement-history key.
positions (sequence of str, optional) – Three or twelve EUT orientations.
dotfile (path-like or str, optional) – Measurement graph.
delay (float, optional) – Settling delay after a frequency change, in seconds.
freqs (iterable of float, optional) – Measurement frequencies in hertz.
receiverconf (Mapping, optional) – Receiver settings passed to
mpylab.tools.mgraph.MGraph.ConfReceivers().SearchPaths (sequence of path-like, optional) – Directories searched for graph, INI, and data files.
names (Mapping[str, object], optional) – Logical-to-physical graph node mapping.
eut_h (Quantity or float, optional) – Mutually exclusive EUT plane coordinates.
eut_z (Quantity or float, optional) – Mutually exclusive EUT plane coordinates.
eut_x (Quantity or float, optional) – EUT coordinates used by analytical e0y evaluation.
eut_y (Quantity or float, optional) – EUT coordinates used by analytical e0y evaluation.
emission_limit (object or Mapping, optional) – Limit used to schedule final-detector remeasurements.
e0y_description (str, optional) – Explicit data-based e0y source.
use_e0y_GTEManalytical (bool or None, optional) – Use analytical e0y from the stored geometry.
EUTpos (Mapping, optional) – Complete EUT position override.
Zc (Quantity or float, optional) – Cell characteristic impedance in ohms.
Dmax (float, optional) – Assumed maximum EUT directivity.
s (float, optional) – Evaluation distance in metres.
hg (float, optional) – EUT height above ground in metres.
RH (tuple[float, float], optional) – Receive-height scan range in metres.
is_oats (bool or None, optional) – Select OATS or free-space correlation.
component (str, optional) – Cell field component used by e0y.
e0y_position_wavelength_factor (float, optional) – Accepted point-source displacement as a wavelength fraction.
prescreen_margin_db (float, optional) – Margin for final-detector remeasurement selection.
prescreen_position_count (int or None, optional) – Position count assumed by inverted-limit prescreening.
prescan_detector (str, optional) – Detector used by the fast initial scan.
acquisition_mode (str, optional) –
auto,scan, or point-by-point acquisition.scan_chunk_size (int or None, optional) – Maximum frequencies per native receiver scan.
progress_log_batch_size (int, optional) – Points grouped into one textual progress update.
detailed_point_logging (bool, optional) – Log every raw and corrected receiver point.
progress_callback (callable, optional) – Observer receiving structured progress dictionaries.
cancel_callback (callable, optional) – Predicate requesting cancellation of a running scan.
preflight_only (bool, optional) – Validate setup without performing the measurement.
preflight_cache (bool, optional) – Reuse matching device-independent preflight results.
preflight_cache_dir (path-like, optional) – Persistent preflight-cache directory.
battery_check_interval (float or None, optional) – Minimum interval between battery checks, in seconds.
- Returns:
- int – Measurement status code; zero indicates success.
Parameter –
description: key to identify the measurement in the result dictionary
battery_check_interval: minimum time in seconds between battery-state queries. The default is 60 seconds. Use 0 to query after every scan phase or None to disable polling.
positions: a sequence of EUT positions to be measured. Each position is a string characterizing the orientation of the cell coordinate system (without prime) relative to the EUT coordinate system. A standard choice is to align the z-axis in the direction of wave propagation, the y-axis parallel to the E-field (vertical) and the x-axis parallel to the H-field. The centre of the EUT is placed at (x = 0,y,z) with x = 0 in the middle of the septum. A local “primed” coordinate system (x’, y’, z’) is assigned to the EUT. Position xx’yy’zz’ aligns x’ with x, y’ with y, and z’ with z. Position xz’yx’zy’ is obtained by simply permuting the primed EUT axes: x’ to y, y’ to z, and z’ to x. This is equivalent to two 90° rotations of the EUT. Position xy’yz’zx’ is obtained by a further permutation: x’ to z, y’ to x, z’ to y. IEC 61000-4-21 defines two standard setups: with the 3 positions (“xx’yy’zz’”, “xz’yx’zy’”, “xy’yz’zx’”), or with 12 positions (see below).
3 standart positions (
std_3_positions):("xx'yy'zz'", "xz'yx'zy'", "xy'yz'zx'")
First three standard orientations.
12 standard positions (
std_12_positions):("xx'yy'zz'", "xz'yx'zy'", "xy'yz'zx'", "xz'yy'z(-x')", "x(-x')yz'zy'", "xy'y(-x')zz'", "x(-x')yy'z(-z')", "x(-z')y(-x')zy'", "xy'y(-z')z(-x')", "x(-z')yy'zx'", "xx'y(-z')zy'", "xy'yx'z(-z')")
12 standard orientations.
dotfile: forwarded to
mpylab.tools.mgraph.MGraphto create the mearsurment graph.delay: time in seconds to wait after setting the frequencie before pulling date from the instruments
freqs: sequence of frequencies in Hz to use for the measurements.
receiverconf: forwarded to
mpylab.tools.mgraph.MGraph.ConfReceivers()names: dict with the mapping from internal names to dot-file names.
The dict has to have keys ‘port’ and ‘receivers’. The corresponding values are sequences of equal length giving the names of the ports and of the receivers in the dot-file. For a GTEM the length of this lists is one. For a Crawford cell it would be two.
eut_h: optional GTEM height of the EUT position. Mutually exclusive with
eut_z.eut_z: optional GTEM z coordinate of the EUT position. Mutually exclusive with
eut_h.eut_x: optional EUT x coordinate for analytical GTEM e0y evaluation.
eut_y: optional EUT y coordinate for analytical GTEM e0y evaluation.
emission_limit: optional radiated-emission limit object or configuration dictionary. If omitted, no detector prescreening is performed during the measurement.
prescreen_margin_db: peak-voltage margin below the inverted field limit that is still flagged for remeasurement with the detector required by the limit.
prescan_detector: detector used for the initial fast scan. The final evaluation falls back to this detector when no remeasurement with the detector required by the limit is available. Remeasurement frequencies found at one EUT orientation are applied to every subsequently measured orientation. If a frequency is discovered too late for an earlier orientation, the operator receives a detector/orientation/frequency summary and can revisit the orientation, continue with the conservative prescan fallback, or quit after autosaving.
acquisition_mode:
'auto'or'scan'groups compatible frequencies into receiver scans.'point'retains one receiver acquisition per frequency as a hardware-test fallback.scan_chunk_size: optional maximum number of frequencies per scan block. The default
Nonekeeps one native sweep per homogeneous graph and receiver configuration. Autosave is only performed between blocks so an active hardware data stream is not interrupted.progress_log_batch_size: number of receiver points combined into one console progress update and, when detailed point logging is enabled, one file-logger update. Structured progress callbacks still receive every individual point.
detailed_point_logging: write the raw and path-corrected value of every receiver point to the configured file loggers. The default
Falsekeeps only batched progress, diagnostics and timing summaries in the logs; complete measurement values remain available in the raw result data and output files.progress_callback: optional observer receiving structured progress dictionaries. It runs in the measurement thread; Qt applications must bridge it to the UI thread with a signal.
cancel_callback: optional callable returning true when a running receiver scan should stop.
preflight_only: initialize devices, validate e0y/limit setup, RF-off/quit, then return before prompts, measurement loops and output generation.
preflight_cache: reuse device-independent preflight results when all relevant graph, calibration, frequency and evaluation inputs are unchanged. Live hardware endpoint checks still run.
preflight_cache_dir: optional persistent cache directory. The default is the user-local mpylab cache directory.
- Measure_Immunity(description='EUT', positions=None, dotfile='gtem-immunity.dot', delay=0.0, reference='verification', kernel=(None, None), leveling=None, freqs=None, SGLevel=-20, immunity_target_efield=None, am_headroom_policy='require_normative', am_depth=0.8, am_frequency=1000.0, am_source='INT1', am_waveform='SINE', am_lfout='OFF', eut_monitor=None, manual_eut_monitor=None, eut_event_policy=None, performance_criterion='A', post_exposure_timeout=None, allow_short_dwell_for_testing=False, allow_incomplete_positions_for_testing=False, eut_h=None, eut_z=None, preflight_only=False, SearchPaths=None, names=None, battery_check_interval=60.0, mode='GTEM')
Performs an immunity measurement according to IEC 61000-4-20.
- Parameters:
description (str, optional) – Measurement-history key.
positions (Mapping[str, sequence], optional) – Vertical and horizontal EUT orientation sequences.
dotfile (path-like or str, optional) – Measurement graph.
delay (float, optional) – Settling delay after a frequency change, in seconds.
reference (str, optional) – Verification dataset used for field and power selection.
kernel (tuple or callable, optional) – Immunity state-machine factory and optional configuration.
leveling (sequence of Mapping, optional) – TEM leveling configurations.
freqs (iterable of float, optional) – Test frequencies in hertz.
SGLevel (float, optional) – Initial signal-generator level in dBm.
immunity_target_efield (Quantity or float, optional) – Required unmodulated immunity field strength.
am_headroom_policy (str, optional) – Policy for accepting Verification AM-headroom evidence.
am_depth (float, optional) – AM depth as a fraction.
am_frequency (float, optional) – AM frequency in hertz.
am_source (str, optional) – Signal-generator modulation source.
am_waveform (str, optional) – Modulation waveform.
am_lfout (str, optional) – Signal-generator low-frequency output state.
eut_monitor (EUTMonitor or sequence of EUTMonitor, optional) – Additional automatic EUT monitors.
manual_eut_monitor (ManualEUTMonitor, optional) – Mandatory operator-intervention monitor implementation.
eut_event_policy (Mapping, optional) – Retry, continue, and stop actions for EUT events.
performance_criterion (str, optional) – EMC performance criterion
A,B, orC.post_exposure_timeout (float or None, optional) – Post-exposure EUT observation time in seconds.
allow_short_dwell_for_testing (bool, optional) – Permit non-normative short dwell times in tests.
allow_incomplete_positions_for_testing (bool, optional) – Permit a diagnostic subset of standard EUT orientations.
eut_h (Quantity or float, optional) – EUT septum height for reference-plane selection.
eut_z (Quantity or float, optional) – EUT longitudinal coordinate for reference-plane selection.
preflight_only (bool, optional) – Validate configuration and hardware without applying RF exposure.
SearchPaths (sequence of path-like, optional) – Directories searched for graph, INI, and data files.
names (Mapping[str, object], optional) – Logical-to-physical measurement-graph node mapping.
battery_check_interval (float or None, optional) – Minimum interval between battery checks, in seconds.
mode ({"GTEM", "TERM"}, optional) – Logical measurement-graph mode. Standard immunity measurements use
"GTEM".
- Returns:
int – Measurement status code; zero indicates success.
Parameter –
description: key to identify the measurement in the result dictionary
battery_check_interval: minimum time in seconds between battery-state queries. The default is 60 seconds. Use 0 to query at every measurement opportunity or None to disable polling.
positions: a sequence of EUT positions to be measured. Each position is a string characterizing the orientation of the cell coordinate system (without prime) relative to the EUT coordinate system. A standard choice is to align the z-axis in the direction of wave propagation, the y-axis parallel to the E-field (vertical) and the x-axis parallel to the H-field. The centre of the EUT is placed at (x = 0,y,z) with x = 0 in the middle of the septum. A local “primed” coordinate system (x’, y’, z’) is assigned to the EUT. Position xx’yy’zz’ aligns x’ with x, y’ with y, and z’ with z. Position xz’yx’zy’ is obtained by simply permuting the primed EUT axes: x’ to y, y’ to z, and z’ to x. This is equivalent to two 90° rotations of the EUT. Position xy’yz’zx’ is obtained by a further permutation: x’ to z, y’ to x, z’ to y. IEC 61000-4-20 defines two standard setups: vertical and horizontal polarization (see below).
4 vertical positions (
std_vertical_positions):("xx'yy'zz'", "xz'yy'z(-x')", "x(-x')yy'z(-z')", "x(-z')yy'zx'")
Vertical standard orientations.
4 horizontal positions (
std_horizontal_positions):("xy'y(-x')zz'", "xy'y(-z')z(-x')", "xy'yx'z(-z')", "xy'yz'zx'")
Horizontal standard orientations.
dotfile: forwarded to
mpylab.tools.mgraph.MGraphto create the mearsurement graph.delay: time in seconds to wait after setting the frequency before pulling date from the instruments
freqs: sequence of frequencies in Hz to use for the measurements.
SGLevel: signal-generator level used before a reference-based field setting is implemented.
reference: TEM verification reference dataset used to derive field and forward power.
immunity_target_efield: optional required immunity test field strength. When set, the routine selects the matching
immunity_referencepower curve from the selected verification reference and records the exact/interpolated choice in raw data.am_headroom_policy: controls acceptance of the headroom evidence stored by Verification.
"require_normative"is the standard IEC 61000-4-20 mode."allow_field_proxy"accepts an explicitly marked non-normative field-probe proxy;"ignore"is intended only for diagnostics.am_depth: AM depth as a fraction. IEC 61000-4-20 requires 0.8.
am_frequency: modulation frequency in hertz. IEC 61000-4-20 requires 1 kHz.
am_source, am_waveform, am_lfout: signal-generator AM setup.
eut_monitor: optional automatic thread-neutral EUT monitor or sequence of monitors. Manual input remains active independently. A blocking hardware monitor should be wrapped in
mpylab.env.eut.ThreadedEUTMonitor.manual_eut_monitor: optional manual input object used by a GUI. When omitted, a keyboard-backed
mpylab.env.eut.ManualEUTMonitoris created.eut_event_policy: measurement-level actions for
failedandnot_evaluatedmonitor events plusmax_retries. Defaults to continuing after an EUT failure and stopping when the EUT status cannot be evaluated.performance_criterion: EMC immunity performance criterion
"A","B", or"C"used by the evaluation. A retry never hides a known degradation or failure for criterion A.post_exposure_timeout: optional time in seconds for monitoring the EUT after AM and RF have been switched off.
Nonekeeps the compatible single-phase monitor workflow.allow_short_dwell_for_testing: allow dwell times below the normative 0.5 s minimum in virtual or unit-test runs.
allow_incomplete_positions_for_testing: permit a diagnostic subset of the standard vertical and horizontal EUT exposures.
eut_h: optional EUT target height for reference-plane selection.
eut_z: optional EUT target z coordinate for reference-plane selection.
preflight_only: initialize devices, configure every requested frequency with RF off, validate references, leveling and amplifier protection, store
preflightData_Immunity, execute RF-off/quit, and return without an exposure.names: dict with the mapping from internal names to dot-file names.
- Measure_Verification(description=None, dotfile='gtem-uniformity.dot', delay=1.0, freqs=None, target_efield=None, initial_sg_power_dbm=-20, target_fwd_power=None, target_fwd_power_dbm=None, required_immunity_efields=None, am_headroom_factor=1.8, am_headroom_maximum_drop_db=7.1, am_headroom_coverage_factor=2.0, am_headroom_allow_upper_uncertainty=False, leveling=None, uniform_area=None, SearchPaths=None, names=None, probe_axis_maps=None, preflight_only=False, battery_check_interval=60.0, mode='GTEM')
Performs field uniformity and TEM-mode verification according to IEC 61000-4-20.
The routine supports three operating modes:
open-loop measurement with the initial signal-generator level
initial_sg_power_dbmwhen no active leveling is configured,constant forward-power leveling with
target_fwd_powerortarget_fwd_power_dbm,constant field-strength leveling with
target_efield.
- Parameters:
description (str, optional) – Measurement-history key.
dotfile (path-like or str, optional) – Measurement graph.
delay (float, optional) – Settling delay after a frequency change, in seconds.
freqs (iterable of float, optional) – Verification frequencies in hertz.
target_efield (Quantity, float, or sequence, optional) – One or more constant-field Verification targets.
initial_sg_power_dbm (float, optional) – Initial signal-generator level in dBm.
target_fwd_power (Quantity or float, optional) – Constant forward-power target in watts.
target_fwd_power_dbm (float, optional) – Constant forward-power target in dBm.
required_immunity_efields (sequence, optional) – Later immunity field levels for reference-power and AM-headroom derivation.
am_headroom_factor (float, optional) – Unmodulated headroom field divided by the immunity test field.
am_headroom_maximum_drop_db (float, optional) – Upper accepted measured reduction. Defaults to 7.1 dB.
am_headroom_coverage_factor (float, optional) – Coverage factor for the optional upper-bound uncertainty rule.
am_headroom_allow_upper_uncertainty (bool, optional) – If true, expanded-uncertainty overlap may satisfy only the upper interval boundary. Defaults to false; neither boundary otherwise uses measurement uncertainty.
leveling (sequence of Mapping, optional) – TEM leveling configurations.
uniform_area (str, CalibrationPlane, or Mapping) – Stored name or definition of the Verification plane.
SearchPaths (sequence of path-like, optional) – Directories searched for graph, INI, and data files.
names (Mapping[str, object], optional) – Logical-to-physical graph node mapping.
probe_axis_maps (Mapping, optional) – Per-probe orientations supplied by the measurement configuration.
preflight_only (bool, optional) – Validate setup without measuring.
battery_check_interval (float or None, optional) – Minimum interval between battery checks, in seconds.
mode ({"GTEM", "TERM"}, optional) – Logical measurement-graph mode. Standard Verification uses
"GTEM".
- Returns:
int – Measurement status code; zero indicates success.
Parameters –
description: key to identify the measurement in the result dictionary
dotfile: forwarded to
mpylab.tools.mgraph.MGraphto create the mearsurement graph.delay: time in seconds to wait after setting the frequency before pulling date from the instruments
freqs: sequence of frequencies in Hz to use for the measurements.
target_efield: desired field strength as a field-strength Quantity. Required only for constant field-strength leveling. A sequence of values measures all listed targets at every uniform-area point before the probe is moved. If
target_efieldis omitted butrequired_immunity_efieldsis configured, these immunity levels are used as explicit verification targets for constant-field-strength leveling.target_fwd_power: target forward power at the GTEM input as a power Quantity or a value in W.
target_fwd_power_dbm: target forward power at the GTEM input in dBm.
required_immunity_efields: optional list of later immunity test field strengths. The evaluation stores the forward power needed for each requested test level and for the corresponding
am_headroom_factorfield strength.am_headroom_factor: multiplier between the required immunity test level and the unmodulated field strength used to reserve AM headroom. Defaults to 1.8 for 80 % AM.
am_headroom_maximum_drop_db: configurable upper interval bound, 7.1 dB by default.
am_headroom_coverage_factor: coverage factor used only when upper-bound uncertainty overlap is enabled.
am_headroom_allow_upper_uncertainty: permit uncertainty overlap at the upper boundary; disabled by default.
uniform_area: name or definition of the stored uniform area whose points are used for the TEM-mode verification.
initial_sg_power_dbm: initial signal-generator level in dBm.
preflight_only: initialize devices, set the initial signal generator level with RF off, RF-off/quit, then return before the measurement loop.
battery_check_interval: minimum time in seconds between battery-state queries. The default is 60 seconds. Use 0 to query at every measurement point or None to disable polling.
leveling: If leveling is None it is initialized with:
leveling = [{'condition': 'False', 'actor': None, 'actor_min': None, 'actor_max': None, 'watch': None, 'nominal': None, 'reader': None, 'path': None}]
names: dict with the mapping from internal names to dot-file names.
The dict has to have keys
’sg’: signalgenerator
’a1’: amplifier input port
’a2’: amplifier output port
’port’: TEM cell feeding
’pmfwd’: forward power meter
’pmbwd’: backward power meter
’fp’: list of field probes
The corresponding values give the names in the dot-file.
- Measure_e0y(description=None, dotfile='gtem-e0y.dot', delay=1.0, freqs=None, target_efield=None, initial_sg_power_dbm=-20, target_fwd_power=None, target_fwd_power_dbm=None, leveling=None, e0y_h=None, e0y_z=None, e0y_x=None, e0y_y=None, SearchPaths=None, names=None, probe_axis_maps=None, preflight_only=False, battery_check_interval=60.0, mode='GTEM')
Performs determination of e0y according to IEC 61000-4-20.
- Parameters:
description (str, optional) – Measurement-history key.
dotfile (path-like or str, optional) – Measurement graph.
delay (float, optional) – Settling delay after a frequency change, in seconds.
freqs (iterable of float, optional) – Measurement frequencies in hertz.
target_efield (Quantity or float, optional) – Target field for constant-field leveling.
initial_sg_power_dbm (float, optional) – Initial signal-generator level in dBm.
target_fwd_power (Quantity or float, optional) – Target forward power in watts.
target_fwd_power_dbm (float, optional) – Target forward power in dBm.
leveling (sequence of Mapping, optional) – TEM leveling configurations.
e0y_h (Quantity or float, optional) – Septum height at the measurement point.
e0y_z (Quantity or float, optional) – Longitudinal coordinate at the measurement point.
e0y_x (Quantity or float, optional) – Lateral point coordinate.
e0y_y (Quantity or float, optional) – Height above the cell floor.
SearchPaths (sequence of path-like, optional) – Directories searched for graph, INI, and data files.
names (Mapping[str, object], optional) – Logical-to-physical graph node mapping.
probe_axis_maps (Mapping, optional) – Per-probe orientations supplied by the measurement configuration.
preflight_only (bool, optional) – Validate setup without measuring.
battery_check_interval (float or None, optional) – Minimum interval between battery checks, in seconds.
mode ({"GTEM", "TERM"}, optional) – Logical measurement-graph mode. Standard e0y measurements use
"GTEM".
- Returns:
int – Measurement status code; zero indicates success.
Parameters –
description: key to identify the measurement in the result dictionary
dotfile: forwarded to
mpylab.tools.mgraph.MGraphto create the mearsurment graph.delay: time in seconds to wait after setting the frequency before pulling date from the instruments
freqs: sequence of frequencies in Hz to use for the measurements.
target_efield: desired field strength as a field-strength Quantity. Used by constant-field-strength leveling entries via
nominal = "target_efield".initial_sg_power_dbm: signal generator power level in dBm.
target_fwd_power: target forward power at the GTEM input as a power Quantity or a value in W. Used by constant-forward-power leveling entries via
nominal = "target_fwd_power".target_fwd_power_dbm: target forward power at the GTEM input in dBm. Mutually exclusive with
target_fwd_power.e0y_h: optional GTEM height of the point where e0y is measured. Mutually exclusive with
e0y_z.e0y_z: optional GTEM z coordinate of the point where e0y is measured. Mutually exclusive with
e0y_h.e0y_x: optional x coordinate of the e0y measurement point. Defaults to 0 when a point source is configured.
e0y_y: optional y coordinate of the e0y measurement point. Required when
e0y_hore0y_zis set.preflight_only: initialize devices, report field-probe orientation, set the initial signal-generator level with RF off, RF-off/quit, then return before the measurement loop.
battery_check_interval: minimum time in seconds between battery-state queries. The default is 60 seconds. Use 0 to query at every measurement point or None to disable polling.
leveling: If leveling is None it is initialized with:
leveling = [{'condition': 'False', 'actor': None, 'actor_min': None, 'actor_max': None, 'watch': None, 'nominal': None, 'reader': None, 'path': None}]
names: dict with the mapping from internal names to dot-file names.
The dict has to have keys
’sg’: signalgenerator
’a1’: amplifier input port
’a2’: amplifier output port
’port’: TEM cell feeding
’pmfwd’: forward power meter
’pmbwd’: backward power meter
’fp’: list of field probes
The corresponding values give the names in the dot-file.
- OutputPreflightData_Emission(description='EUT', fname=None)
Write the structured emission readiness matrix as TSV.
- Parameters:
description (str, optional) – Preflight dataset description.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputPreflightData_Immunity(description='EUT', fname=None)
Write the structured immunity readiness matrix as TSV.
- Parameters:
description (str, optional) – Preflight dataset description.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputProcessedData_Emission(description=None, what=None, fname=None)
Write processed emission results and optional detail tables.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys. Without it, compact and detailed tables are generated.
fname (path-like, optional) – Base output filename; omitted output is written to stdout.
- OutputProcessedData_Immunity(description=None, what=None, fname=None)
Write processed immunity results to stdout or a target file.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys to select.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputProcessedData_Verification(description=None, what=None, fname=None)
Write processed TEM Verification results and detail tables.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys. Without it, compact and detailed tables are generated.
fname (path-like, optional) – Base output filename; omitted output is written to stdout.
- OutputProcessedData_e0y(description=None, what=None, fname=None)
Write processed e0y results and optional detail tables.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys. Without it, compact and detailed tables are generated.
fname (path-like, optional) – Base output filename; omitted output is written to stdout.
- OutputRawData_Emission(description=None, what=None, fname=None)
Write raw emission measurement data to stdout or a target file.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys to select.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputRawData_Immunity(description=None, what=None, fname=None)
Write raw immunity measurement data to stdout or a target file.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys; defaults to power and EUT status.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputRawData_Verification(description=None, what=None, fname=None)
Write raw TEM-mode Verification data.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys to select.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- OutputRawData_e0y(description=None, what=None, fname=None)
Write raw e0y calibration data to stdout or a target file.
- Parameters:
description (str, optional) – Dataset description to write.
what (str or sequence of str, optional) – Nested result keys; defaults to the measured field.
fname (path-like, optional) – Output filename; omitted output is written to stdout.
- c0 = Quantity(m*s^(-1), 299792458.0)
- doLeveling(leveling, mg, names, dct)
Perform TEM-specific leveling.
Power-based configurations use
mpylab.tools.mgraph.Levelerwith anobserver. Field-probe configurations usereaderand adjust the actor until the requested field strength is observed.- Parameters:
leveling (iterable of Mapping) – Ordered leveling configurations guarded by optional conditions.
mg (mpylab.tools.mgraph.MGraph) – Active measurement graph.
names (Mapping[str, object]) – Logical-to-physical graph node mapping.
dct (dict) – Runtime measurement context. Leveling traceability is added here.
- Returns:
Applied actor level for the first matching configuration, or
Nonewhen no condition matches.- Return type:
Quantity or None
- e0y_GTEM_analytical(a, h, g, y, x=0, Zc=50, max_m=10)
Calculate analytical GTEM field per square root of forward power.
- Parameters:
a (float) – Cell width in metres.
h (float) – Septum height in metres.
g (float) – Gap width in metres.
y (float) – EUT-centre height above the cell floor in metres.
x (float, optional) – Lateral EUT-centre offset from the cell centre in metres.
Zc (Quantity or float, optional) – Characteristic impedance in ohms.
max_m (int, optional) – Upper index of the analytical series expansion.
- Returns:
Analytical
e0yin V/m/sqrt(W).- Return type:
Quantity
Notes
The formula used by IEC 61000-4-20 originates from Michael Koch’s doctoral thesis.
- e0y_GTEM_analytical_from_geometry(x, y, z, max_m=1000)
Calculate analytical GTEM
e0yfrom the stored geometry.- Parameters:
x (Quantity or float) – Lateral position in metres.
y (Quantity or float) – Height above the cell floor in metres.
z (Quantity or float) – Longitudinal cell position.
max_m (int, optional) – Upper index of the analytical series expansion.
- Returns:
Analytical
e0yin V/m/sqrt(W).- Return type:
Quantity
- e0y_source_position_deviation(source_position, target_position, frequencies=None, wavelength_factor=0.5)
Compare a point
e0ysource position with the EUT position.The accepted distance is
wavelength_factor * c0 / fmax. With the default factor of 0.5, the accepted distance is one half wavelength at the highest requested emission frequency.- Parameters:
source_position (Mapping or None) – Position associated with the measured point source.
target_position (Mapping or None) – Intended EUT position.
frequencies (iterable of float, optional) – Planned frequencies in hertz.
wavelength_factor (float, optional) – Maximum position deviation as a fraction of the shortest wavelength.
- Returns:
Coordinate deviations, distance limit, tolerance result, and decision flag, or
Nonewhen comparison is impossible.- Return type:
dict or None
- static e0y_source_suitability(summary)
Aggregate source checks into a machine-readable suitability block.
- Parameters:
summary (Mapping) – e0y source summary containing geometry, frequency, and position checks.
- Returns:
Usability state, decision flag, reasons, warnings, and checks that could not be evaluated.
- Return type:
dict
- eta0 = Quantity(u"Ω", 376.73031340987586 +/- 5.6788176410469925e-08 [NC])
- eut_positions_emission = (("xx'yy'zz'", "xz'yx'zy'", "xy'yz'zx'"), ("xz'yy'z(-x')", "x(-x')yz'zy'", "xy'y(-x')zz'"), ("x(-x')yy'z(-z')", "x(-z')y(-x')zy'", "xy'y(-z')z(-x')"), ("x(-z')yy'zx'", "xx'y(-z')zy'", "xy'yx'z(-z')"))
- eut_positions_immunity = {'h': ("xy'y(-x')zz'", "xy'y(-z')z(-x')", "xy'yx'z(-z')", "xy'yz'zx'"), 'v': ("xx'yy'zz'", "xz'yy'z(-x')", "x(-x')yy'z(-z')", "x(-z')yy'zx'")}
- static field_probe_monitor_target_from_e0y(target_eut_field, eut_e0y, monitor_e0y)
Return the monitor-probe field needed for the target EUT field.
eut_e0yandmonitor_e0yare field-per-square-root-power factors for the EUT and monitor-probe positions. The returned field is the field that the monitor probe should observe when the EUT position reachestarget_eut_field.- Parameters:
target_eut_field (Quantity or float) – Required field strength at the EUT position.
eut_e0y (Quantity or float) – Field-per-square-root-power factor at the EUT.
monitor_e0y (Quantity or float) – Field-per-square-root-power factor at the monitor probe.
- Returns:
Required monitor-probe field strength.
- Return type:
Quantity
- field_probe_monitor_target_from_geometry(target_eut_field, eut_position, monitor_position, max_m=1000)
Return the monitor-probe target field from analytical GTEM geometry.
Positions are dictionaries with
yand eitherzorh.xdefaults to zero. This helper is intentionally independent from hardware access and prepares the futurefield_probe_monitorleveling strategy.- Parameters:
target_eut_field (Quantity or float) – Required field strength at the EUT position.
eut_position (Mapping) – EUT x/y and h or z coordinates.
monitor_position (Mapping) – Monitor-probe x/y and h or z coordinates.
max_m (int, optional) – Upper index of the analytical series expansion.
- Returns:
Required field strength at the monitor-probe position.
- Return type:
Quantity
- format_e0y_source_summary(summary)
Format one entry returned by
summarize_e0y_sources().- Parameters:
summary (Mapping) – One source summary.
- Returns:
Multiline human-readable source and suitability description.
- Return type:
str
- format_e0y_sources(summaries=None)
Format available GTEM
e0ysources for display.- Parameters:
summaries (sequence of Mapping, optional) – Source summaries; generated automatically when omitted.
- Returns:
Multiline list of available sources.
- Return type:
str
- classmethod format_field_probe_orientation_preflight(graph_name, probe_axis_map, source='default')
Return a readable preflight summary for one probe orientation.
- Parameters:
graph_name (str) – Physical field-probe node name.
probe_axis_map (mapping, str, or None) – Orientation to display.
source (str, optional) – Selected configuration source.
- Returns:
Multiline orientation and transformation-matrix summary.
- Return type:
str
- static frequency_coverage(source_frequencies, requested_frequencies)
Return frequency-range coverage for a data-based
e0ysource.- Parameters:
source_frequencies (iterable of float or None) – Frequencies available from the source, in hertz.
requested_frequencies (iterable of float or None) – Frequencies required by the planned measurement, in hertz.
- Returns:
Source and requested ranges, uncovered frequencies, and whether a user decision is required.
Nonemeans no range was requested.- Return type:
dict or None
- has_measurement_history()
Return whether this instance already contains TEM measurement data.
- Returns:
Truewhen any raw, processed, preflight, or reference dataset is present.- Return type:
bool
- interpolate_reference_dataset(lower_reference, upper_reference, target_h, name=None, freqs=None)
Interpolate two GTEM verification reference datasets to a target height.
The interpolation uses the measured field-per-square-root-power factor
K = reference_field / sqrt(forward_power). For an ideal linearly scaling GTEM cell,K * his approximately height-independent, so this quantity is interpolated between the two reference planes and then converted back toKattarget_h.- Parameters:
lower_reference (Mapping) – Verification dataset below the requested height.
upper_reference (Mapping) – Verification dataset above the requested height.
target_h (Quantity or float) – Requested septum height.
name (str, optional) – Description assigned to the interpolated dataset.
freqs (iterable of float, optional) – Frequencies to include; common available frequencies are used by default.
- Returns:
Interpolated reference dataset with traceability metadata.
- Return type:
dict
- k_factor = 0.125
- classmethod resolve_field_probe_axis_map_sources(mg, names, config_probe_axis_maps=None)
Resolve orientations and retain their selected sources.
- Parameters:
mg (mpylab.tools.mgraph.MGraph) – Measurement graph containing probe nodes and their INI data.
names (mapping) – Logical node mapping containing the
fpprobe entries.config_probe_axis_maps (mapping, optional) – Probe orientations supplied by the measurement configuration.
- Returns:
Entries with
probe_axis_mapandsourcefor every probe.- Return type:
dict
- classmethod resolve_field_probe_axis_maps(mg, names, config_probe_axis_maps=None)
Resolve normalized field-probe orientations.
- Parameters:
mg (mpylab.tools.mgraph.MGraph) – Measurement graph containing probe nodes and their INI data.
names (mapping) – Logical node mapping containing the
fpprobe entries.config_probe_axis_maps (mapping, optional) – Probe orientations supplied by the measurement configuration.
- Returns:
Normalized orientation for every physical probe node.
- Return type:
dict
- Raises:
mpylab.env.tem.probe_orientation.ProbeOrientationConflictError – If explicit sources define different orientations.
- select_e0y_source(e0y_description, target_position=None, frequencies=None, wavelength_factor=0.5, summaries=None)
Select and confirm a data-based
e0ysource for emission evaluation.The method keeps source discovery, diagnostics and user confirmation separate from the radiated-power calculation. Geometry mismatch for measured
e0ydata remains a hard error.- Parameters:
e0y_description (str) – Explicit source description. Automatic selection is deliberately rejected when more than one source may be available.
target_position (Mapping, optional) – Planned EUT position used for suitability checks.
frequencies (iterable of float, optional) – Planned frequencies in hertz.
wavelength_factor (float, optional) – Accepted point-source distance as a fraction of wavelength.
summaries (sequence of Mapping, optional) – Previously generated source summaries.
- Returns:
Selected source summary, or
Noneif the operator rejects a source requiring confirmation.- Return type:
dict or None
- select_immunity_reference_power(reference='verification', frequency=None, required_immunity_efield=None, interpolation='linxliny')
Return the verified forward power for a later immunity test level.
The lookup uses
processedData_Verification[reference]["immunity_reference"]. Exact configured immunity field strengths are returned directly. Field strengths between two configured values are interpolated linearly overE**2, which matches the expected relation between field strength and forward power for a linear test chain. Requests outside the configured field-strength range are rejected.- Parameters:
reference (str, optional) – Verification dataset description.
frequency (float) – Requested immunity frequency in hertz.
required_immunity_efield (Quantity or float) – Required unmodulated immunity field strength.
interpolation (str, optional) – Frequency interpolation mode passed to the calibration lookup.
- Returns:
Selected or interpolated forward powers, AM-headroom evidence, source frequencies, and traceability metadata.
- Return type:
dict
- set_geometry(geometry)
Attach and validate the fixed TEM/GTEM geometry for this history.
- Parameters:
geometry (GTEMGeometry or Mapping) – Geometry object or configuration from which one can be created.
- Returns:
Stored geometry, or the matching geometry already attached.
- Return type:
GTEMGeometry
- set_uniform_area(uniform_area)
Attach a uniform-area definition to this measurement history.
- Parameters:
uniform_area (CalibrationPlane or Mapping) – Plane definition compatible with the fixed cell geometry.
- Returns:
Validated and stored uniform-area plane.
- Return type:
CalibrationPlane
- summarize_e0y_sources(target_position=None, frequencies=None, wavelength_factor=0.5)
Return available GTEM
e0ymetadata without selecting a source.- Parameters:
target_position (Mapping, optional) – Planned EUT position used for spatial suitability checks.
frequencies (iterable of float, optional) – Planned measurement frequencies in hertz.
wavelength_factor (float, optional) – Accepted point-source distance as a fraction of wavelength.
- Returns:
Summaries of measured-e0y and Verification-derived sources.
- Return type:
list[dict]
- summarize_reference_planes(reference=None, freqs=None)
Summarize available TEM verification planes for planned immunity frequencies.
The summary is intentionally conservative: requested frequencies outside the reference range are reported as warnings, and usable area bounds are derived only from verification point data at exact reference frequencies.
- Parameters:
reference (str, optional) – Restrict the summary to one Verification dataset description.
freqs (iterable of float, optional) – Planned immunity frequencies in hertz.
- Returns:
Plane metadata, frequency coverage, usable bounds, and warnings.
- Return type:
list[dict]
- uniform_area_position_check(uniform_area_plane, target_position)
Check whether an EUT position is covered by a uniform-area plane.
- Parameters:
uniform_area_plane (CalibrationPlane or None) – Verified plane and its spatial bounds.
target_position (Mapping or None) – EUT position containing x/y and optionally h or z coordinates.
- Returns:
Bounds, in-plane and plane-position checks, combined result, and decision flag, or
Nonewhen the check cannot be performed.- Return type:
dict or None
- class mpylab.env.tem.TEMCell.TestField(instance, reference='verification', interpolation='linxliny')
Bases:
objectCallable converter from forward power to expected field strength.
- Parameters:
instance (TEMCell) – Measurement history containing processed Verification data.
reference (str, optional) – Verification dataset description.
interpolation (str, optional) – Frequency interpolation mode for reference field and forward power.
- class mpylab.env.tem.TEMCell.TestPower(instance, reference='verification', interpolation='linxliny')
Bases:
objectCallable converter from target field to required forward power.
- Parameters:
instance (TEMCell) – Measurement history containing processed Verification data.
reference (str, optional) – Verification dataset description.
interpolation (str, optional) – Frequency interpolation mode for reference field and forward power.
- mpylab.env.tem.TEMCell.corrected_power_magnitude(power)
Return corrected power as a non-negative real Watt quantity.
- Parameters:
power (Quantity, number, or None) – Corrected power, potentially complex because of path corrections.
- Returns:
Magnitude reduced to watts, or
Nonefor missing input.- Return type:
Quantity or None
- mpylab.env.tem.TEMCell.leveling_metadata_from_context(context)
Return traceability fields written by TEM leveling helpers.
- Parameters:
context (Mapping) – Measurement context populated during leveling.
- Returns:
Entries whose keys begin with
leveling_, excluding the transientleveling_contextentry.- Return type:
dict
- class mpylab.env.tem.TEMCell.stdImmunityKernel(field, freqs, positions, messenger, UIHandler, lcls, dwell, keylist='sS', modulation=None, allow_short_dwell_for_testing=False, allow_incomplete_positions_for_testing=False, eut_monitor=None, manual_eut_monitor=None, eut_event_policy=None, post_exposure_timeout=None)
Bases:
objectState-machine kernel for standard TEM immunity test sequences.
- Parameters:
field (Quantity or callable) – Immunity field requested for each exposure.
freqs (iterable of float) – Test frequencies in hertz.
positions (Mapping[str, sequence]) – Vertical and horizontal EUT positions.
messenger (callable) – User-message and decision callback.
UIHandler (object) – UI adapter used for non-blocking operator input.
lcls (dict) – Measurement-local state containing status and exposure dictionaries.
dwell (float) – Exposure dwell time in seconds.
keylist (str, optional) – Manual intervention keys.
modulation (Mapping, optional) – AM configuration including depth, frequency, source, and waveform.
allow_short_dwell_for_testing (bool, optional) – Permit non-normative short dwell times in tests.
allow_incomplete_positions_for_testing (bool, optional) – Compatibility test option retained by the kernel API.
eut_monitor (EUTMonitor or sequence of EUTMonitor, optional) – Additional automatic EUT monitors.
manual_eut_monitor (ManualEUTMonitor, optional) – Mandatory operator-intervention monitor implementation.
eut_event_policy (Mapping, optional) – Policy mapping monitor events to retry, stop, or continue actions.
post_exposure_timeout (float or None, optional) – Maximum post-exposure observation time in seconds.
- close()
Stop and close the EUT monitor without accessing measurement RF hardware.
- poll_urgent_event_command()
Return a command for a pending non-passing monitor event.
- Returns:
Immediate state-machine command, or
Nonewhen no urgent event is pending.- Return type:
tuple or None
- test(stat)
Return the next immunity command based on the current status.
- Parameters:
stat (str or None) – Result of the previously executed command, including safety and EUT-monitor events.
- Returns:
Next
(command, label, parameters)state-machine entry.- Return type:
tuple