Commit c21bab35d9e337135a3c2e5b9a6181fb2d633b91
1 parent
8fe481d742
Exists in
master
replace 4 spaces by tabs
Showing 2 changed files with 11 additions and 11 deletions Side-by-side Diff
dat_ident.py
... | ... | @@ -12,11 +12,11 @@ |
12 | 12 | os.chdir('/home/user/sicav_data/Manip/2016/2016-03/') |
13 | 13 | |
14 | 14 | def getColumn(filename, column): |
15 | - results = [] | |
16 | - for dat_file in sorted(glob.glob(filename)): | |
17 | - file_result = csv.reader(open(dat_file), delimiter='\t') | |
18 | - results = results + map(float,[result[column] for result in file_result]) | |
19 | - return results | |
15 | + results = [] | |
16 | + for dat_file in sorted(glob.glob(filename)): | |
17 | + file_result = csv.reader(open(dat_file), delimiter='\t') | |
18 | + results = results + map(float,[result[column] for result in file_result]) | |
19 | + return results | |
20 | 20 | |
21 | 21 | t = getColumn('*-lakeshore.dat', 0) |
22 | 22 | T1 = getColumn('*-lakeshore.dat', 2) |
... | ... | @@ -33,9 +33,9 @@ |
33 | 33 | T4 = [T4[n*i] for i in range(len(T4)/n)] |
34 | 34 | |
35 | 35 | def func(U, a0, b1, b2, y0): |
36 | - sys = signal.lti([a0],[b2, b1, 1]) | |
37 | - y = sys.output(U, t, y0) | |
38 | - return y[1] | |
36 | + sys = signal.lti([a0],[b2, b1, 1]) | |
37 | + y = sys.output(U, t, y0) | |
38 | + return y[1] | |
39 | 39 | |
40 | 40 | print('Fitting...') |
41 | 41 | popt, cov = curve_fit(func, T1, T4) |
first_order_ident.py
... | ... | @@ -9,9 +9,9 @@ |
9 | 9 | |
10 | 10 | '''function to optimize''' |
11 | 11 | def func(u, K, tau, y0): |
12 | - sys = signal.lti(K, [tau, 1]) | |
13 | - y = sys.output(u, t, y0) | |
14 | - return y[1] | |
12 | + sys = signal.lti(K, [tau, 1]) | |
13 | + y = sys.output(u, t, y0) | |
14 | + return y[1] | |
15 | 15 | |
16 | 16 | '''input square signal''' |
17 | 17 | global t |