Package empro :: Package toolkit :: Module touchstone
[frames] | no frames]

Module touchstone

source code

Module to export network parameters to the Touchstone v1.1 format.

The Touchstone file format can contain S, Y, Z, H or G parameters, though in EMPro, it's primarily used to export simulated S parameters. The following example retrieves the S parameters from the first simulation of the active project (a two port), and exports it to results.s2p. The default reference impedance is 50 ohms, and complex numbers are always written using the real-imaginary format.

Example:

from empro.toolkit import touchstone, portparam S = portparam.getSMatrix(sim=1) touchstone.write('results.s2p', S)

Functions
None
write(path, matrix, parameter="S" , reference=...=50 , format=...=MA)
export an frequency dependent parameter matrix to a Touchstone file:
source code
Variables
  FORMATS = ('DB', 'MA', 'RI')
  DB = 'DB'
  MA = 'MA'
  RI = 'RI'
Function Details

write(path, matrix, parameter="S" , reference=...=50 , format=...=MA)

source code 

export an frequency dependent parameter matrix to a Touchstone file:

  • path: path to touchstone file, with or without the .snp extension.
  • matrix: square matrix of one-dimensional datasets
  • parameter: parameter indicator as written in the option line. Legal values are: S, Y, Z, H, G. The default is S.
  • reference: reference impedance (ohms) as written in the option line. The default reference resistance is 50 ohms.
  • format: format of complex data. Legal values are DB (dB-angle), MA (magnitude-angle) and RI (real-imaginary). Angles are in degrees. The default is MA.
Returns: None