-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_NonLinear.py
78 lines (61 loc) · 1.46 KB
/
test_NonLinear.py
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
import numpy as np
import matplotlib.pyplot as plt
import time
import SPINLib
start_time = time.time()
sp_sum=SPINLib.spectr()
sp_sum.open_spe(r'spe\gauss_sum.spe')
s=[r'spe\gauss_100.spe',
r'spe\gauss_300.spe',
r'spe\gauss_500.spe',
r'spe\gauss_700.spe',
r'spe\gauss_900.spe']
base = []
for nm in s:
base.append(SPINLib.spectr())
base[-1].open_spe(nm)
x=[i for i in range(1000)]
# for sp in base:
# plt.plot(x, sp.sp)
plt.plot(x, sp_sum.sp)
print(sp_sum.split(base), sum(sp_sum.sp))
#-0.00007*I2*I2 + 0.99*I2 + 0.1
sp_sum.A1=0.1
sp_sum.A2=0.99
sp_sum.A3=-0.00007
sp_sum.ShiftComp(1,0,True)
print(sp_sum.split(base), sum(sp_sum.sp))
plt.plot(x, sp_sum.sp)
#sp3=SPINLib.spectr()
#sp1.plot_sp_lg()
#ip,wp=sp2.find_peaks(0.1,0,0.003,3)
#print(ip)
#
#for j in ip:
# x, y = [j,j], [0, sp2.sp[int(j)]]
# plt.plot(x, y)
#
#sp2.open_spe('spe\g4_Cs_60.spe')
##sp3.open_spe('spe\Pb.12mm.spe')
#sp3 = sp1*2.222+sp2*3.333
#sp2=sp1*3
#x=sp3.split((sp1,sp2),(100,500),1)
#print(x)
#ind=np.arange(len(sp1.sp))
#plt.plot(ind,sp1.sp,'.')
#plt.plot(ind,sp2.sp,'.')
#plt.plot(ind,sp3.sp,'-')
#plt.plot(ind,sp2.sp,'.-')
#plt.plot(ind,sp1.sp,'.-')
#sp.open_cmp('Cs+Co_AL=2.cmp')
#sp0=sp.ShiftComp(-10,2)
#sp1=sp.spread(0,0.003,3)
#sp.find_peaks()
#print(sp.peaks)
#ind=np.arange(len(sp0))
#plt.plot(ind,sp0,'.-')
#plt.plot(ind,sp.sp,'.-')
#plt.plot(ind,sp1,'.-')
#print(sp.history)
#sp.save_json()
print("--- %s seconds ---" % (time.time() - start_time))