This notebook demonstrates how to convert a s2p touchstone file to an interactive html sheet.
from pyMez import *
from pyMez.Code.DataHandlers.Translations import *
s2p=S2PV1(os.path.join(os.getcwd(),"S2p_to_Html_Files/20160301_30ft_cable_0.s2p"))
s2p.show();
# We transform to xml specifing format and a xsl style sheet
xml=S2PV1_to_XmlDataTable(s2p,format="MA",style_sheet=os.path.join(TESTS_DIRECTORY,"../XSL/S2P_MA_STYLE.xsl"))
# this converts it to the text, we can use .save_HTML to save a file
html_text=xml.to_HTML()
# now we can load the html_text into a HTMLBase class to show in the browser and save
html=HTMLBase(html_text=html_text)
# this displays it in the default browser
html.show()
# to save it we just specify the path and save it
html.save(os.path.join(os.getcwd(),"S2p_to_Html_Files/20160301_30ft_cable_0.html"))