MSC Virtual Workflows

The MSC measurement scripts can be run with virtual device configurations for development and regression testing without laboratory hardware.

Available scripts and configurations

The modern text-based MSC scripts live in the script directory:

Script

Purpose

Typical virtual configuration

msc-maincal.py

Chamber calibration for empty and loaded states

conf/msc-immunity-virtual/conf.py

msc-eutcal.py

EUT loading calibration

conf/msc-immunity-virtual/conf-eutcal.py

msc-immunity.py

Immunity measurement using the calibration history

conf/msc-immunity-virtual/conf-immunity.py

msc-emission.py

Emission measurement using the calibration history

conf/msc-emission-virtual/conf.py or conf/msc-emission-virtual/conf-after-immunity.py

Each of these scripts also has a Qt starter with the same configuration interface: msc-maincal-qt.py, msc-eutcal-qt.py, msc-immunity-qt.py and msc-emission-qt.py. These starters use the simple Qt UI with Stop / RF Off and run the measurement logic in a worker thread.

The msc-immunity-virtual and msc-emission-virtual configurations use virtual instruments and synthetic path corrections. The matching *-realpaths configurations still use virtual instruments, but load real path correction data from MpyConfig/LargeRC/ini.

History pickles

The MSC pickle files are history containers. A script loads an existing MSC instance from pickle_input_filename, adds the next measurement and evaluation results, and writes the complete updated instance to pickle_output_filename.

This means that every new output pickle should contain the full previous measurement history plus the newly added data. For traceability, do not treat these files as isolated intermediate calibration files.

Typical sequences are:

maincal -> eutcal -> immunity
maincal -> eutcal -> emission
maincal -> eutcal -> immunity -> emission

Virtual MSC immunity chain

From the script directory, the virtual immunity chain can be run as:

python msc-maincal.py conf/msc-immunity-virtual/conf.py
python msc-eutcal.py conf/msc-immunity-virtual/conf-eutcal.py
python msc-immunity.py conf/msc-immunity-virtual/conf-immunity.py

The same chain can be run through the Qt starters:

python msc-maincal-qt.py conf/msc-immunity-virtual/conf.py
python msc-eutcal-qt.py conf/msc-immunity-virtual/conf-eutcal.py
python msc-immunity-qt.py conf/msc-immunity-virtual/conf-immunity.py

The corresponding output pickles are written below conf/msc-immunity-virtual/output.

The real-path variant uses the same script sequence with conf/msc-immunity-virtual-realpaths:

python msc-maincal.py conf/msc-immunity-virtual-realpaths/conf.py
python msc-eutcal.py conf/msc-immunity-virtual-realpaths/conf-eutcal.py
python msc-immunity.py conf/msc-immunity-virtual-realpaths/conf-immunity.py

Virtual MSC emission

For an emission run directly after EUT calibration:

python msc-emission.py conf/msc-emission-virtual/conf.py

Or with the Qt UI:

python msc-emission-qt.py conf/msc-emission-virtual/conf.py

For an emission run that should preserve a preceding immunity measurement in the same history:

python msc-emission.py conf/msc-emission-virtual/conf-after-immunity.py

The corresponding real-path variants are:

python msc-emission.py conf/msc-emission-virtual-realpaths/conf.py
python msc-emission.py conf/msc-emission-virtual-realpaths/conf-after-immunity.py

Real path data

The *-realpaths variants expect the MpyConfig checkout next to the mpylab repository:

workspace/
├── mpylab/
└── MpyConfig/
    └── LargeRC/
        └── ini/

If MpyConfig/LargeRC/ini is missing, tests that need real path correction data are skipped. The pure virtual configurations remain fully hardware independent.

Tests

The hardware-independent MSC workflows are covered by the pytest suite:

Test

Coverage

test_msc_immunity_virtual_config.py

Loads the virtual and real-path DOT configurations and initializes the MGraph without hardware access.

test_msc_virtual_history_workflow.py

Runs the script sequence with temporary output files and verifies that each output pickle preserves the previous MSC history.

Run the tests from the repository root with:

PYTHONPATH=src:../scuq/src python -m pytest test