gnucap-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnucap-devel] output commands (Re: gnucap sandbox)


From: Felix Salfelder
Subject: [Gnucap-devel] output commands (Re: gnucap sandbox)
Date: Mon, 22 Apr 2019 23:34:25 +0200
User-agent: NeoMutt/20170113 (1.7.2)

Hi Patrick

Thanks for your mail.

> 1) i want to save all data from a simulation session into a csv file. i
> thought it would be nice to have a command csv "data.csv" - from there it
> would be possible to do some plots (with e.g. xls or matplotlib). i got a
> basic command working, but not sure where to take the data from

when you run a command like
gnucap> transient 1 2 3 > data.out
the data that would otherwise be printed will end up in a file. it is
not csv, but a simpler format. a format that gnuplot and gwave
can read. you could use a small class as in [1] to read it from
within python.

you could write a small program that converts to some other format, and
run it as in
gnucap> transient 1 2 3 | anyprogram
i have not used this much -- passing arguments or redirecting further
seems not implemented, definitely something worth adding...

some day, the notorious output-pluggability will allow to do pretty much
exactly what you are suggesting. there is a demo hdf command [2] which
shows the intended use. the demo command syntax is something like
gnucap> hdfprobe tran v(nodes)
gnucap> tran 1 2 3.
a similar plugin could then implement csv.

cheers
felix

[1] 
https://codeberg.org/gnucap/gnucap-python/src/branch/develop/examples/dataparse.py
[2] https://git.savannah.gnu.org/cgit/gnucap.git/log/?h=hdf-14



reply via email to

[Prev in Thread] Current Thread [Next in Thread]