如何从原始文件或SVG中输出数据?

huangapple go评论70阅读模式
英文:

how can output data from a rawfile or svg?

问题

I'm using Ngspice to do circuit simulations and plot a vector, but I don't know how to export data from an SVG or raw file. The circuit is as follows.

The netlist is as follows:

ivdd 0 nd_pkg_pad 0 ac 1.0
.ac dec 100 10meg 10g
.save vm(nd_pkg_pad)
.control
set filetype=ascii
run
plot vm(nd_pkg_pad) xlog ylog
.endc
.end

To run the netlist on Linux 20.04, use the following command:

ngspice
ngspice-> source circuit1.sp

It outputs a plot that can be saved in SVG format. I want to know how to extract data from this plot and export it to Excel, selecting 1000 points of frequency and their corresponding voltage values. It's better to use Python code because there are many plots to be handled. Thanks a lot!

英文:

there! I'm using Ngspice to do circuit simulations. and plot a vector,but i don't know how to export data from an svg or raw file.The circuit is like below.如何从原始文件或SVG中输出数据?

and the netlist is below

ivdd 0 nd_pkg_pad 0 ac 1.0
.ac dec 100 10meg 10g
.save vm(nd_pkg_pad)
.control
set filetype=ascii
run
plot vm(nd_pkg_pad) xlog ylog
.endc
.end

Then run the netlist on Linux 20.04
The command is

ngspice
ngspice-> source circuit1.sp

Then it outputs a plot as below:

如何从原始文件或SVG中输出数据?

it can be saved in SVG format. but I wanna know how to extract data from this plot and export it to excel like choosing 1000 points of frequency and their corresponding voltage value.

it's better to use python code because a lot of plots to be handled.Thanks a lot!!!

答案1

得分: 1

The method to transform voltage plot to data is using "wrdata"
for example, in a .cir or .sp file, a circuit netlist file, the command is:

wrdata filename(like test.txt) vm(node1)

<----(vm represent voltage, and node1 is a node name)

then test.txt will be generated and you can see the voltage data when do ac analysis.

英文:

The method to transform voltage plot to data is using "wrdata"
for example,in a .cir or .sp file ,a circuit netlist file,the command is:

wrdata filename(like test.txt) vm(node1)

<----(vm represent voltage,and node1 is a node name)

then test.txt will be generated and you can see the voltage data when do ac analysis.

huangapple
  • 本文由 发表于 2023年3月12日 17:40:46
  • 转载请务必保留本文链接:https://go.coder-hub.com/75712253.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定