Touchstone interop¶
The cross-server exchange format. Frequencies are always Hz on the wire: display-friendly units (MHz, GHz) appear in human-facing messages, never in stored data.
API¶
Hz-strict Touchstone read / write helpers built on scikit-rf.
Internal frequency unit is always Hz. We surface this contract by returning (freq_hz, s_complex) tuples instead of trusting consumers to read scikit-rf's Frequency object correctly.
read_touchstone(path)
¶
Read a Touchstone file into an skrf Network. Path is resolved to absolute.
Source code in packages/rf-mcp-common/src/rf_mcp_common/touchstone.py
write_touchstone(network, path, *, form='ri')
¶
Write an skrf Network to a Touchstone file.
form is one of "ri" (real/imaginary), "ma" (mag/angle),
or "db" (dB/angle).
Source code in packages/rf-mcp-common/src/rf_mcp_common/touchstone.py
network_to_touchstone(freq_hz, s, path, *, z0=50.0, name=None, form='ri')
¶
Build an skrf Network from raw arrays and write it to disk.
Source code in packages/rf-mcp-common/src/rf_mcp_common/touchstone.py
sparams_at(network, freq_hz, *, interp=True)
¶
Return the S-matrix at a single frequency.
If freq_hz is not in the sweep and interp=True, linearly
interpolate. Otherwise raise ValueError.