diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-07-08 22:35:29 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-07-08 22:35:29 +0200 |
commit | 5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db (patch) | |
tree | 4ab98185fd13d4d2f4866057407371b750079205 /ee/tools | |
download | ee-python-5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db.tar.gz ee-python-5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db.tar.bz2 ee-python-5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db.tar.xz ee-python-5a8207c9d18ff88d6c762b8c57d57d9c4a2ff8db.zip |
o Start on some electronics engineering code.
Diffstat (limited to 'ee/tools')
-rw-r--r-- | ee/tools/__init__.py | 0 | ||||
-rw-r--r-- | ee/tools/read_ltspice_raw.py | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/ee/tools/__init__.py b/ee/tools/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ee/tools/__init__.py diff --git a/ee/tools/read_ltspice_raw.py b/ee/tools/read_ltspice_raw.py new file mode 100644 index 0000000..0b3b7e1 --- /dev/null +++ b/ee/tools/read_ltspice_raw.py @@ -0,0 +1,27 @@ +import ee +import sys + +raw = ee.read_ltspice_raw(sys.argv[1]) + +#print("Variables:") +#for i, v in enumerate(raw.variables): +# print("{:2}: kind: {:20} expression: {}".format(i, v.kind, v.expression)) + +#for i, v in enumerate(raw.variables): +# print("{:2}: kind: {:20} expression: {}".format(i, v.kind, v.expression)) +# for p in raw.values[i]: +# print(" {}".format(p)) + +xs = raw.get_values('V(load)') + +import matplotlib +matplotlib.use('Agg') + +import matplotlib.pyplot as plt +from matplotlib.ticker import FuncFormatter, MaxNLocator +fig = plt.figure() +ax = fig.add_subplot(111) +ax.plot(xs) + +with open("ltspice.png", "wb") as f: + plt.savefig(f, format="png") |