AmplifierTest Virtual Workflow ============================== The ``amplifier-test.py`` script can be run with virtual device configurations for development and regression testing without laboratory hardware. The standard virtual configuration models an amplifier installed in the measurement rack with forward and backward power monitoring. From the ``script`` directory, start the virtual amplifier test with: .. code-block:: console python amplifier-test.py conf/amplifier-test-virtual/conf.py An isolated amplifier with a power meter connected directly to the amplifier output is modeled by the direct configuration: .. code-block:: console python amplifier-test.py conf/amplifier-test-direct-virtual/conf.py This configuration sets ``measurement_setup = "direct"``. Its names mapping uses ``pm_out`` for the direct output power meter instead of the rack setup keys ``pm_fwd``, ``pm_bwd`` and ``output``. The direct configuration defines output cable and attenuator corrections as passive graph nodes and references them on the DOT edges with the usual ``dev`` and ``what`` attributes. The virtual direct workflow uses two edge corrections between ``amp_out`` and ``pm_out`` and includes a 40 dB output attenuator. For the direct setup, ``AmplifierTest`` also checks an optional power-meter safety channel named ``MAXIN`` before it sets a signal-generator level. The check estimates the power-meter input from the requested signal-generator level and the graph correction from ``sg`` to ``pm_out``. The virtual direct configuration and the R&S NRP Z21 configuration provide such a ``MAXIN`` channel. If the selected power-meter configuration does not provide it, this additional power-meter protection is not available. The same configuration can be run through the Qt UI with: .. code-block:: console python amplifier-test-qt.py conf/amplifier-test-virtual/conf.py The configurations use virtual signal-generator, amplifier and power-meter drivers plus 0 dB virtual path corrections. Output files are written below the respective configuration ``output`` directory. The virtual configuration disables compression evaluation with ``do_evaluation = False``. The virtual power-meter data is deterministic and useful for exercising the measurement, logging and pickle workflow, but it is not a realistic compression characteristic. The real Direct configuration under ``conf/amplifier-test-direct`` uses the R&S SMF100A, the BLMA amplifier configuration and an R&S NRP Z21 power-meter configuration as its initial hardware-oriented skeleton. Its direct cable and attenuator correction nodes currently use local 0 dB placeholder path data and must be replaced by the measured correction data for a real measurement. This is also required for the ``MAXIN`` estimate to describe the actual power-meter input. The script writes: .. list-table:: :header-rows: 1 * - File - Purpose * - ``amplifier-test-virtual.p`` - Final ``AmplifierTest`` pickle containing the measured history. * - ``amplifier-test-virtual-after-measure-.p`` - Intermediate pickle written after the measurement step. * - ``amplifier-test-virtual.log`` - Text log from the measurement run. The hardware-independent path is covered by ``test_amplifier_test_script.py``. Run the focused test from the repository root with: .. code-block:: console PYTHONPATH=src:../scuq/src python -m pytest test/test_amplifier_test_script.py