Network.write_touchstone(filename=None, dir=None, write_z0=False, skrf_comment=True, return_string=False, to_archive=None, form='ri')[source]

Write a contents of the Network to a touchstone file.

  • filename (a string, optional) – touchstone filename, without extension. if ‘None’, then will use the network’s name.
  • dir (string, optional) – the directory to save the file in.
  • write_z0 (boolean) – write impedance information into touchstone as comments, like Ansoft HFSS does
  • skrf_comment (bool, optional) – write created by skrf comment
  • return_string (bool, optional) – return the file_string rather than write to a file
  • to_archive (zipfile.Zipfile) – opened ZipFile object to place touchstone file in
  • form ('db','ma','ri') – format to write data, * db = db, deg * ma = mag, deg * ri = real, imag


format supported at the moment are,
[Hz/kHz/MHz/GHz] S [DB/MA/RI]

Frequency unit can be changed by setting Network.frequency.unit property

The functionality of this function should take place in the touchstone class.