s4p into mixed mode and store in csv

59 views
Skip to first unread message

k2ninaLeo

unread,
May 14, 2021, 7:53:55 AMMay 14
to scikit-rf
I would like to convert SE into Diff for s4p, then store the sparameter value into csv, is it possible? Any reference? 

Julien Hillairet

unread,
May 15, 2021, 3:26:01 AMMay 15
to scik...@googlegroups.com
Dear user,

Did you have a look at the scikit-rf documentation? In particular to the mixed-mode conversion? Once transformed, it is of course possible to extract the S parameter values into a csv file or a new touchstone file.

Best regards,

Julien


Le ven. 14 mai 2021 à 13:53, k2ninaLeo <k2n...@gmail.com> a écrit :
I would like to convert SE into Diff for s4p, then store the sparameter value into csv, is it possible? Any reference? 

--
You received this message because you are subscribed to the Google Groups "scikit-rf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scikit-rf+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scikit-rf/e6faf59d-ae76-475a-adbc-149b7bf95ae2n%40googlegroups.com.

k2ninaLeo

unread,
Jun 11, 2021, 6:01:08 AMJun 11
to scikit-rf
I have tried:
******************
import skrf as rf
dat = rf.Network('meatest.s4p')
data.se2gm(p=2)
dat.to_csv('test.csv', sep='\t', encoding='utf-8')
**************************

Error: AttributeError: 'Network' object has no attribute 'to_csv'

Am i missing something? Mind to guide me?

Denz Choe

unread,
Jun 11, 2021, 6:08:54 AMJun 11
to scikit-rf

k2ninaLeo

unread,
Jun 13, 2021, 5:48:03 AMJun 13
to scikit-rf
Thanks, did it with your guide.

Another is, with that network_2_speardsheet, is it possible to re-structure the format such as freq from Hz into MHz, and db value in 4 decimal place.

I tried to set decimal=round(4) but seen not work.

Julien Hillairet

unread,
Jun 13, 2021, 10:24:39 AMJun 13
to scik...@googlegroups.com
You can do it like that :

import skrf as rf

ntwk = rf.data.ring_slot # example, replace with your data

ntwk.frequency.unit = 'MHz' # change the frequency unit

ntwk.to_dataframe().to_csv('test.csv', float_format='%.4f') # convert into pandas DF then export to csv with desired precision


Best regards,


Julien


Reply all
Reply to author
Forward
0 new messages