Network.__init__(file=None, name=None, comments=None, f_unit=None, **kwargs)[source]

Network constructor.

Creates an n-port microwave network from a file or directly from data. If no file or data is given, then an empty Network is created.

  • file (str or file-object) –
    file to load information from. supported formats are:
    • touchstone file (.s?p)
    • pickled Network (.ntwk, .p) see write()
  • name (str) – Name of this Network. if None will try to use file, if its a str
  • comments (str) – Comments associated with the Network
  • **kwargs – key word arguments can be used to assign properties of the Network, such as s, f and z0.


From a touchstone

>>> n = rf.Network('ntwk1.s2p')

From a pickle file

>>> n = rf.Network('ntwk1.ntwk')

Create a blank network, then fill in values

>>> n = rf.Network()
>>> freq = rf.Frequency(1,3,3,'ghz')
>>> n.frequency, n.s, n.z0 = freq,[1,2,3], [1,2,3]

Directly from values

>>> n = rf.Network(f=[1,2,3],s=[1,2,3],z0=[1,2,3])

See also

init from impedance values
read a network from a file
write a network to a file, using pickle
write a network to a touchstone file