scikit-rf/scikit-rf — pull request #18 by streumix (2013-10-24 09:22:23+00:00)
Title: rework of write_touchstone to be more spec compliant

Intitial purpose: Handle multiport files
- inserted special case for trivial 1-port
- inserted special case for 2-port to go with specific S11, S21, S12, S22 order on data line
- inserted special case for 3-port to write 3-line data block per frequency as requested by spec
- adapted general n-port case to use continuation lines for n>4 with a max of 4 matrix elements per line (spec!) and line break at and of matrix row.
- all continuation lines are indent to allow parsing without knowledge of n ( e.g. IE3D/Mentor HyperLynx 3D EM uses *.sp extension)
- replaced all tabs with space as requesed by the spec

Verification was done based on a full I/O cycle (read/write) of a 47-port file (20MB) --> import into ADS works well