transmitterdan / s2spice

GNU General Public License v3.0
14 stars 1 forks source link

Touchstone version 2.0 files #5

Open dghan0219 opened 1 year ago

dghan0219 commented 1 year ago

S2SPICE v1.0.1 crashes when trying to open a Touchstone version 2.0 file. Converting the file to version 1.1 works fine. Since the differences between the versions are mainly helpful comments and summaries, should S2SPICE ignore the comments and summaries or use any that are useful, such as 2-port data order and mixed-mode order?

transmitterdan commented 1 year ago

Thanks for the feedback. Please try V 1.0.3 found here in GitHub releases. Let me know if that works. If not, please attach a troublesome S file to a comment.

dghan0219 commented 1 year ago

The new version 1.0.3 doesn't crash, but it fails to import the file as well. Here is a very abbreviated Touchstone 2.0 file:

! Mixed-mode S-parameters for 228.6 mm transmission line at 55.000000°C ! 4-port S-parameters [Version] 2.0

MHz S MA R 50

[Number of Ports] 4 [Mixed-Mode Order] D1,3 D2,4 C1,3 C2,4 [Number of Frequencies] 16385 [Reference] 50 50 50 50 [Matrix Format] Full [Begin Information] [End Information] [Network Data] ! freq (MHz) abs(Sdd11) arg(Sdd11) abs(Sdd12) arg(Sdd12) abs(Sdc11) arg(Sdc11) abs(Sdc12) arg(Sdc12) ! abs(Sdd21) arg(Sdd21) abs(Sdd22) arg(Sdd22) abs(Sdc21) arg(Sdc21) abs(Sdc22) arg(Sdc22) ! abs(Scd11) arg(Scd11) abs(Scd12) arg(Scd12) abs(Scc11) arg(Scc11) abs(Scc12) arg(Scc12) ! abs(Scd21) arg(Scd21) abs(Scd22) arg(Scd22) abs(Scc21) arg(Scc21) abs(Scc22) arg(Scc22) 5.25680491984714e-12 0.0342428143325293 -9.89705924560421e-06 0.965555730225454 -5.53255905403431e-07 1e-06 0.0 1e-06 0.0 0.965555730225454 -5.53255905403431e-07 0.0342428143325293 -9.89705924560421e-06 1e-06 0.0 1e-06 0.0 1e-06 0.0 1e-06 0.0 0.0343001010655339 -5.1573280839101e-06 0.965612971923919 -3.85580305335165e-07 1e-06 0.0 1e-06 0.0 0.965612971923919 -3.85580305335165e-07 0.0343001010655339 -5.1573280839101e-06 5.2568049198524 0.0355625322094089 -0.394977395649863 0.963593849940174 -3.22400626252274 1e-06 0.0 1e-06 0.0 0.963593849940174 -3.22400626252274 0.0355625322094089 -0.394977395649863 1e-06 0.0 1e-06 0.0 1e-06 0.0 1e-06 0.0 0.0373303150929175 14.3974465765182 0.963621649103568 -3.25576830128239 1e-06 0.0 1e-06 0.0 0.963621649103568 -3.25576830128239 0.0373303150929175 14.3974465765182 10.5136098396995 0.0357479847437684 -1.75039240513934 0.962566285407271 -6.3739405777761 1e-06 0.0 1e-06 0.0 0.962566285407271 -6.3739405777761 0.0357479847437684 -1.75039240513934 1e-06 0.0 1e-06 0.0 1e-06 0.0 1e-06 0.0 0.0419205194715535 25.0970211827781 0.962528409319668 -6.44066548239045 1e-06 0.0 1e-06 0.0 0.962528409319668 -6.44066548239045 0.0419205194715535 25.0970211827781 86122.2350018557 0.00698966278261341 7.72111658173974 1.12820421233132e-05 135.572488749777 1e-06 0.0 1e-06 0.0 1.12820421233132e-05 135.572488749777 0.00698966278261341 7.72111658173974 1e-06 0.0 1e-06 0.0 1e-06 0.0 1e-06 0.0 0.0970282820596283 0.719369907031016 1.6448030049157e-05 173.333044803307 1e-06 0.0 1e-06 0.0 1.6448030049157e-05 173.333044803307 0.0970282820596283 0.719369907031016 86130.0 0.00698972035124104 7.72138287937647 1.12716064024448e-05 131.338172752673 1e-06 0.0 1e-06 0.0 1.12716064024448e-05 131.338172752673 0.00698972035124104 7.72138287937647 1e-06 0.0 1e-06 0.0 1e-06 0.0 1e-06 0.0 0.0970283516107538 0.719390370854742 1.64332688143904e-05 169.100837537798 1e-06 0.0 1e-06 0.0 1.64332688143904e-05 169.100837537798 0.0970283516107538 0.719390370854742 [End]

dghan0219 commented 1 year ago

Also, version 2.0 files usually have an extension of .ts rather than .snp. Your open dialog should include .ts files if you think you'll support version 2.0 files.