forked from JohnDMcMaster/eetime
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplot.py
More file actions
executable file
·50 lines (39 loc) · 1.09 KB
/
plot.py
File metadata and controls
executable file
·50 lines (39 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/usr/bin/env python3
import argparse
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
import numpy as np
import scipy.optimize
from scipy.optimize import curve_fit
import json
import glob
import os
import eetime.jl
def decode(reads):
times = []
percentages = []
for aread in reads:
times.append(aread["seconds"])
percentages.append(aread["erase_percent"])
return times, percentages
def main():
parser = argparse.ArgumentParser(description='Help')
parser.add_argument('--save', default=None)
parser.add_argument('jls', nargs="+", help='')
args = parser.parse_args()
plt.xlabel("t (sec)")
plt.ylabel("% erased")
for jli, (fn, header, _footer,
reads) in enumerate(eetime.jl.load_jls_arg(args.jls)):
print("")
print(fn)
plt.title(header["prog_dev"])
times, percentages = decode(reads)
plt.plot(times, percentages, label=str(jli))
plt.legend()
if args.save:
plt.savefig(args.save)
else:
plt.show()
if __name__ == "__main__":
main()