mpylab.env.univers.AmplifierTest module

This is mpylab.env.univers.AmplifierTest: Test amplifier for gain and compression

author:

Hans Georg Krauthäuser (main author)

license:

GPL-3 or higher

class mpylab.env.univers.AmplifierTest.AmplifierTest(SearchPaths=None)

Bases: Measure

Measure amplifier gain and compression characteristics.

Raw input and output powers are retained in rawData; evaluated gain and compression points are stored in processedData.

Parameters:

SearchPaths (sequence of path-like, optional) – Directories searched for DOT graphs, device INI files, and data files.

GetGainAndCompression(description: str | None = None, small_signal_factor: int = 10) None

Evaluate gain and 1 dB and 3 dB compression points.

Parameters:
  • description (str) – Raw-data description to evaluate. It must already contain a completed amplifier measurement.

  • small_signal_factor (int, optional) – Reserved compatibility parameter. It is currently unused by the characteristic fit.

Raises:

RuntimeError – If description is omitted or not present in rawData.

Measure(description='AmplifierTest', dotfile='amplifier.dot', delay=0.2, freqs=None, levels=None, names=None, virtual=False, measurement_setup='rack')

Measure amplifier input and output power over frequency and level.

Parameters:
  • description (str, optional) – Key under which the raw measurement is stored.

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

  • delay (float, optional) – Settling time in seconds after changing the generator level.

  • freqs (sequence of float, optional) – Measurement frequencies in hertz.

  • levels (sequence of scuq.Quantity, optional) – Signal-generator output levels. Power quantities are expected.

  • names (mapping, optional) – Logical-to-graph device-name mapping. The rack setup requires sg, amp_in, amp_out, pm_fwd, pm_bwd, and output. The direct setup requires sg, amp_in, amp_out, and pm_out.

  • virtual (bool, optional) – Put all graph devices into virtual mode before initialization.

  • measurement_setup ({"rack", "direct"}, optional) – "rack" uses the forward and backward power monitors of a measurement rack. "direct" reads a power meter connected to the isolated amplifier output.

Returns:

Final device status; zero indicates success.

Return type:

int

OutputIniFile(description=None, fname=None, driver='amplifier.py', gpib=1, maxin_compression='1dB', frequency_interpolation='LOG', value_interpolation='DB', complex_interpolation='POLAR')

Write evaluated amplifier characteristics as an NPORT-style INI file.

The file contains S21, MAXIN, C1DB, and C3DB channels.

Parameters:
  • description (str, optional) – Processed-data description to export.

  • fname (path-like, optional) – Destination file. If omitted, write to standard output.

  • driver (str, optional) – Driver filename written to the INI description block.

  • gpib (int, optional) – GPIB address written to the INI initialization block.

  • maxin_compression ({"1dB", "3dB"}, optional) – Compression point exported as the MAXIN channel.

  • frequency_interpolation ({"LINEAR", "LOG"}, optional) – Frequency-coordinate interpolation policy.

  • value_interpolation ({"LINEAR", "DB"}, optional) – Interpolate linear quantities or their dB/dBm representation.

  • complex_interpolation ({"CARTESIAN", "POLAR"}, optional) – Complex interpolation policy written for the NPORT contract. The generated channels currently contain real scalars. CARTESIAN cannot be combined with DB value interpolation.

Returns:

Zero if description is unavailable; otherwise None after writing the output.

Return type:

int or None