skrf.io.touchstone.Touchstone.__init__
- Touchstone.__init__(file, encoding=None)[source]
constructor
- Parameters:
Examples
From filename
>>> t = rf.Touchstone('network.s2p')
File encoding can be specified to help parsing the special characters:
>>> t = rf.Touchstone('network.s2p', encoding='ISO-8859-1')
From file-object
>>> file = open('network.s2p') >>> t = rf.Touchstone(file)
From a io.StringIO object
>>> link = 'https://raw.githubusercontent.com/scikit-rf/scikit-rf/master/examples/ basic_touchstone_plotting/horn antenna.s1p' >>> r = requests.get(link) >>> stringio = io.StringIO(r.text) >>> stringio.name = 'horn.s1p' # must be provided for the Touchstone parser >>> horn = rf.Touchstone(stringio)