本文整理匯總了Python中ramanTools.RamanSpectrum.smooth方法的典型用法代碼示例。如果您正苦於以下問題:Python RamanSpectrum.smooth方法的具體用法?Python RamanSpectrum.smooth怎麽用?Python RamanSpectrum.smooth使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ramanTools.RamanSpectrum
的用法示例。
在下文中一共展示了RamanSpectrum.smooth方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: May29b
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def May29b():
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150521/150521_05.txt') ## stoichiometric ODPA capped CdSe
r = removespikes(r)
r.autobaseline((119,286), order = 0)
r.autobaseline((286,1151), order = 4, join = 'start')
r.autobaseline((1151,1489), order = 3, join = 'start')
r.smooth()
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_02.txt') # Cd enriched CdSe
r = removespikes(r)
r.autobaseline((272,1746), order = 2)
#r.autobaseline((1151,1489), order = 3, join = 'start')
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150516/150516_08.txt')
r = removespikes(r)
r.autobaseline((272,1746), order = 2)
r.smooth()
r.plot()
legend(['stoic', 'rich apr8', 'rich may16'])
return 0
示例2: CdSvsCdSe
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def CdSvsCdSe():
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150521/150521_05.txt')
r = removespikes(r)
r.autobaseline((119,286), order = 0)
r.autobaseline((286,1151), order = 4, join = 'start')
r.autobaseline((1151,1560), order = 3, join = 'start')
r.smooth()
r.plot(label = 'CdSe')
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_07.txt')
c = RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_08.txt')
r = add_RamanSpectra(r,c)
r = SPIDcorrect633(r)
r = removespikes(r)
r.autobaseline((145,1148), order = 3)
r.autobaseline((1148,1253), order = 1,join='start')
r.autobaseline((1253,2000), order = 3,join='start')
r.autobaseline((2000,3600), order = 3,join='start')
r.values[:] = r.values[:]*5
#r.smooth()
r.plot(label='CdS')
legend(['CdSe','CdS'])
return 0
示例3: Mar26
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def Mar26():
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150326/orangedot-nativeligand_20.txt')
print type(a)
a.smooth()
a.autobaseline((400,520),order =0)
a.autobaseline((520,1756),order = 4)
a.values[:]*=10
a.plot(label = '633 nm')
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150326/orangedot-nativeligand_21.txt')
a = smooth(a)
a = autobaseline(a,(2482,3600),4)
a*=10
a.plot(label = '633 nm')
b = CdODPARef-2597
b.plot(label = 'reference')
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150326/orangedot-nativeligand_10.txt')
a = smooth(a)
a-=161
a*=25
a.plot(label = '785 nm')
return 0
示例4: May16
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def May16():
c = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_08.txt")
c.values[:] *= 3
c = autobaseline(c, (300, 1700), order=6)
c.smooth()
c.plot(label="Cd-enriched")
a = fitspectrum(
c,
(900, 1150),
"SixGaussian",
[200, 200, 200, 200, 200, 200, 950, 990, 1026, 1064, 1087, 1115, 10, 10, 10, 10, 10, 10, 1, -100],
)
plot(a[1], a[2], linewidth=3, label="Cdenriched fit")
# a = RamanSpectrum('/home/chris/Documents/DataWeiss/150516/150516_08.txt')
# b = RamanSpectrum('/home/chris/Documents/DataWeiss/150516/150516_07.txt')
# c = add_RamanSpectra(a,b)
#
# c = autobaseline(c,(300,1700),order = 4)
# c.smooth()
# c.plot(label='stoichiometric')
#
# CdMeOTPRef.index = array(CdMeOTPRef.index)-5
# (CdMeOTPRef/120).plot()
# (MeOTPRef/240).plot()
a = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_01.txt")
b = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_02.txt")
c = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_03.txt") * 4
d = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_05.txt")
e = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_06.txt")
a = add_RamanSpectra(a, b)
a = add_RamanSpectra(a, c)
a = add_RamanSpectra(a, d)
a = add_RamanSpectra(a, e)
a.values[:] /= 10
a.plot(label="pieces")
# ics('/home/chris/Orca/Successful/CdMeOTP/CdMeOTP.out')
# ics('/home/chris/Orca/CdTP_bridge/CdTP_bridgeDFT.out',color='r')
# a= fitspectrum(a,(900,1150),'SixGaussian', [200,200,200,200,200,200,950,990,1026,1064,1087,1115,10,10,10,10,10,10,1,-100])
# plot(a[1],a[2],linewidth =3,label= 'piecesfit')
return 0
示例5: Fig1
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def Fig1(show_vib_numbers = True): ### reference spectra of methylbenzenethiol
figure(figsize = (6,6))
MBT = copy(MeOTPRef)
MBT-=min(MBT[0:2000])
MBT/=max(MBT[0:2000])
CdMBT = copy(CdMeOTPRef)
CdMBT.index = array(CdMBT.index)-3
CdMBT-=min(CdMBT[0:2000])
CdMBT/=max(CdMBT[0:2000])
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_15.txt')
a.autobaseline((268,440,723,915,1200,1391,1505,1680),specialoption='points', order = 4)
a.smooth(window_len=11,window = 'SG')
a[:]/=3000
MBT.plot(color = 'b',linewidth = 2)
CdMBT.plot(color = 'k',linewidth = 2)
a.plot(color = 'r',linewidth = 2)
xlim(500,1675)
ylim(0,1.5)
ylabel('Intensity (a.u.)')
xlabel('Raman shift (cm$^{-1}$)')
####Assignments
assignmentfontsize = 10
# annotate('Ring bending',(635,0.2), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
annotate('Ring bending',(647,0.38), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
annotate('Ring stretching',(1105,1.05), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='horizontal')
annotate('Ring stretching',(806,1.1), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='horizontal')
annotate('CSH bending ',(914,0.25), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
# annotate('CH bending ',(1190,0.33), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
#annotate('Ring stretching',(1300,0.5), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
# annotate('CH bending',(1382,0.1), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
annotate('CC ring stretching',(1607,0.5), xycoords = 'data',horizontalalignment = 'center',verticalalignment = 'bottom',color = 'k',size = assignmentfontsize,rotation ='vertical')
legend(['MTP', 'CdMTP$_2$', 'QDs-MTP'])
matplotlib.pyplot.tight_layout()
return 0
示例6: Apr8Raman
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def Apr8Raman():
os.chdir('/home/chris/Documents/DataWeiss/150408')
fig = figure()
a = RamanSpectrum('150408_15.txt')
a.autobaseline((268,440,723,915,1200,1391,1505,1680),specialoption='points', order = 4)
a.smooth(window_len=11,window = 'SG')
#a+=800
b = RamanSpectrum('150408_02.txt')
#b = autobaseline(b,(200,1700),leaveout=(200,300), order = 4)
b.autobaseline((268,440,723,915,1200,1391,1505,1680),specialoption='points', order = 4)
b.smooth(window_len=11,window = 'SG')
(normalize(MeOTPRef,(0,10000))*4000+1000).plot(color ='b',linewidth=2)
a.plot(color = 'k',linewidth = 2)
b.plot(color = 'r', linewidth = 2)
ylim(-500,6000)
xlim(200,1675)
legend(['MeOTP ref', 'MeOTP treated','Native ligand only'])
ylabel('Raman Intensity (a.u.)')
xlabel('Raman Shift (cm$^{-1}$)')
figure()
title('Washing')
a = RamanSpectrum('150408_11.txt')
b = RamanSpectrum('150408_02.txt')
a = autobaseline(a, (200,1700),leaveout=(200,300),order=4)
b = autobaseline(b,(200,1700),leaveout=(200,300), order = 4)
(normalize(ODPARef,(0,10000))*4000+2000).plot(color ='b',linewidth=2, label='ODPA Ref')
a.plot(color = 'r',label='washed 5x')
b.plot(color = 'k',label='washed 4x')
#a= fitspectrum(b,(900,1150),'SixGaussian', [200,200,200,200,200,200,950,990,1026,1064,1087,1115,10,10,10,10,10,10,1,-100])
#plot(a[1],a[2],linewidth =3,label='fit')
legend()
ylabel('Raman Intensity (a.u.)')
xlabel('Raman Shift (cm$^{-1}$)')
return 0
示例7: May7
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def May7():
figure()
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150507/150507_01.txt')
a.normalize()
a.plot()
ics('/home/chris/Orca/CdTP_bridge/CdTP_bridgeDFT.out',normalize = True)
title('thiophenol')
figure()
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150507/150507_03.txt')
a.normalize()
a.plot()
i = RamanSpectrum('/home/chris/Documents/DataWeiss/150508/150508_02.txt')
i[:]/=1200
i.smooth()
i.autobaseline((70,450),leaveout=(70,340),order = 4)
i.autobaseline((450,1650),order = 2, join='start')
i.plot()
ics('/home/chris/Orca/CdClTP/CdClTP.out',normalize = True,labelpeaks = False)
figure()
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150507/150507_06.txt') ## bromocomplex
a.autobaseline((70,450),leaveout=(70,340),order = 4)
a.autobaseline((450,1650),order = 2, join='start')
a.normalize()
a.plot()
i = RamanSpectrum('/home/chris/Documents/DataWeiss/150508/150508_08.txt') ## bromo on dots
i[:]/=1200
i.smooth()
i.autobaseline((70,450),leaveout=(70,340),order = 4)
i.autobaseline((450,1650),order = 2, join='start')
i.plot()
ics('/home/chris/Orca/CdBrTP/CdBrTP.out',normalize = True,labelpeaks = False)
return 0
示例8: May29
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def May29():
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150529/150529_05.txt') ### exchanged CdS dots with phosphonic acid (octadecyl)
r.autobaseline((147,1678), order =3)
r.autobaseline((147,356), order = 1)
r.autobaseline((356,389), order = 1, join = 'start')
r.autobaseline((389,892), order = 1, join = 'start')
r.autobaseline((892,923), order = 1, join = 'start')
r.autobaseline((923,1185), order = 1, join = 'start')
r.autobaseline((1185,1211), order = 1, join = 'start')
r.autobaseline((1211,1678), order = 1, join = 'start')
r.smooth()
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150527/150527_06.txt') ### native ligands CdS dots
r.autobaseline((98,764), order = 1)
r.autobaseline((764,839), order = 1, join = 'start')
r.autobaseline((839,1700), order = 2, join = 'start')
r.smooth()
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150521/150521_05.txt') ## stoichiometric ODPA capped CdSe
r = removespikes(r)
r.autobaseline((119,286), order = 0)
r.autobaseline((286,1151), order = 4, join = 'start')
r.autobaseline((1151,1489), order = 3, join = 'start')
r.smooth()
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_02.txt') # Cd enriched CdSe
r = removespikes(r)
r.autobaseline((272,1746), order = 2)
#r.autobaseline((1151,1489), order = 3, join = 'start')
r.plot()
legend(['exchanged', 'oleate', 'stoich','rich'])
ylim(-100,2000)
return 0
示例9: June1
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def June1():
clf()
subplot(122)
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_07.txt')
c = RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_08.txt')
r = add_RamanSpectra(r,c)
r = SPIDcorrect633(r)
r = removespikes(r)
r.autobaseline((145,1148), order = 3)
r.autobaseline((1148,1253), order = 1,join='start')
r.autobaseline((1253,2000), order = 3,join='start')
r.autobaseline((2000,3600), order = 3,join='start')
r.values[:] = r.values[:]*5
#r.smooth()
r.plot()
r= RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_09.txt')
c = RamanSpectrum('/home/chris/Documents/DataWeiss/150601/150601_10.txt')
r = add_RamanSpectra(r,c)
r = SPIDcorrect633(r)
#r = removespikes(r)
r.autobaseline((145,1148), order = 2)
r.autobaseline((1148,1253), order = 1,join='start')
r.autobaseline((1253,1700), order = 3,join='start')
r.autobaseline((1700,3600), order = 3,join='start')
r.values[:] = r.values[:]*5
#r.smooth()
r.plot()
legend(['oleate', 'exchanged'])
subplot(121)
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150529/150529_05.txt')
r.autobaseline((147,2000), order =3)
r.autobaseline((147,356), order = 1)
r.autobaseline((356,389), order = 1, join = 'start')
r.autobaseline((389,892), order = 1, join = 'start')
r.autobaseline((892,923), order = 1, join = 'start')
r.autobaseline((923,1185), order = 1, join = 'start')
r.autobaseline((1185,1211), order = 1, join = 'start')
r.autobaseline((1211,1679), order = 2, join = 'start')
r.autobaseline((1679,1702), order = 2, join = 'start')
r.autobaseline((1702,1900), order = 3, join = 'start')
r.smooth()
r.plot()
r = RamanSpectrum('/home/chris/Documents/DataWeiss/150527/150527_06.txt')
r = SPIDcorrect633(r)
r.autobaseline((98,765), order = 4)
r.autobaseline((765,839), order = 2, join = 'start')
r.autobaseline((839,1456), order = 4, join = 'start')
r.autobaseline((1456,1470), order = 2, join = 'start')
r.autobaseline((1470,1900), order = 4, join = 'start')
r.smooth()
r.plot()
legend(['exchanged', 'oleate'])
return 0
示例10: DMFWash
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def DMFWash():
clf()
ax1 = gca()
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_03.txt')#### sample A washed with DMF
b = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_04.txt')# sa,[;e B washed with DMF]
c = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_05.txt')##sample C washed with DMF
d = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_06.txt')##sample C washed with DMF using 50x close up objective
e= RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_07.txt')##sample E washed with DMF
for z in [a,b,c]:
z.autobaseline((200,725),order=3, join='start')
z.autobaseline((725,800),order=0, join='start')
z.autobaseline((800,1427),order=2, join='start')
z.autobaseline((1427,1435),order=0, join='start')
z.autobaseline((1435,2000),order=0, join='start')
z[:]-=z[1700]
z.plot()
d.autobaseline((520,1250),order = 3)
e.autobaseline((520,1250),order = 3)
d.plot()
e.plot()
xlim(900,1200)
ax1=figure().add_subplot(111)
ratiolist = list()
# native= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ###### Native ligand only
# native[:]/=2
# native=removespikes(native)
# native.autobaseline((600,690,826,861,900,1196,1385,1515,1657),specialoption='points',order=7)
# native.smooth()
#
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files1.txt')
b= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files2.txt')
c_unwashed= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files3.txt')
d_unwashed= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files4.txt')
e_unwashed= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files5.txt')
correct = zeros(e_unwashed.values.shape)
for z in [a,b,c_unwashed,d_unwashed,e_unwashed]:
y = deepcopy(z)
y.smooth()
y.smooth()
y.smooth()
correct+= y/z
correct/=5
for z in [c_unwashed,e_unwashed]:
z[:]*=correct
z=removespikes(z)
z.autobaseline((109,500),order=3, join='start')
z.autobaseline((500,725),order=2, join='start')
z.autobaseline((725,795),order=1, join='start')
z.autobaseline((795,1363),order=2, join='start')
z.autobaseline((1363,1430),order = 1, join = 'start')
z.autobaseline((1430,1930),order = 4, join='start')
z.autobaseline((200,555,613,764,1141,1321,1565,1700,1920),specialoption='points',order=7)
z.smooth()
lw = 2
c_unwashed[:]*=3
guess = [300,1500,1078,1085,15,15,0,0]
r = fitspectrum(d,(1070,1110),'TwoGaussian',guess ) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess )
ratio = r.areas[0]/r.areas[1]
ratiolist.append(ratio)
d.plot(linewidth = lw)
print r.params[0]
for p in r.peaks:
ax1.plot(r.x,p,color = 'k',linewidth = 2)
plot(r.x,r.y, color = 'k', linewidth = lw)
r = fitspectrum(c_unwashed,(1070,1110),'TwoGaussian', guess) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess )
ratio = r.areas[0]/r.areas[1]
ratiolist.append(ratio)
c_unwashed.plot(linewidth = lw)
print r.params[0]
for p in r.peaks:
ax1.plot(r.x,p,color = 'k',linewidth = 2)
plot(r.x,r.y, color = 'k', linewidth = lw)
e[:]+=2000
e_unwashed[:]+=2000
e.smooth()
guess = [300,1500,1078,1085,15,15,0,2000]
#.........這裏部分代碼省略.........
示例11: July1
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def July1():
ratiolist = list()
native= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ###### Native ligand only
native[:]/=2
native=removespikes(native)
native.autobaseline((600,690,826,861,900,1196,1385,1515,1657),specialoption='points',order=7)
native.smooth()
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files1.txt')
b= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files2.txt')
c= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files3.txt')
d= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files4.txt')
e= RamanSpectrum('/home/chris/Documents/DataWeiss/150701/files5.txt')
#c = removespikes(c)
#c = removespikes(c)
correct = zeros(e.values.shape)
for z in [a,b,c,d,e]:
y = deepcopy(z)
y.smooth()
y.smooth()
y.smooth()
correct+= y/z
correct/=5
ax1=figure().add_subplot(111)
mbt = CdMethylTPRef.copy()
mbt[:]/=10
for z in [a,b,c,d,e]:
z[:]*=correct
z=removespikes(z)
z.autobaseline((109,500),order=3, join='start')
z.autobaseline((500,725),order=2, join='start')
z.autobaseline((725,795),order=1, join='start')
z.autobaseline((795,1363),order=2, join='start')
z.autobaseline((1363,1430),order = 1, join = 'start')
z.autobaseline((1430,1930),order = 4, join='start')
z.autobaseline((200,555,613,764,1141,1321,1565,1700,1920),specialoption='points',order=7)
z.smooth()
mbt[:]+=3000
a[:]+=1000
b[:]+=600
c[:]+=400
d[:]+=200
e[:]-=200
native-=500
lw = 2
mbt.plot(linewidth = lw)
guess = [50,100,100,1065,1080,1085,7,7,7,0,z[1110]]
for z in [a,b,c,d,e]:
print z.name
r = fitspectrum(z,(1050,1110),'ThreeGaussian',[50,100,500,1065,1078,1085,15,15,15,0,z[1110]] ) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess )
ratio = r.areas[1]/r.areas[2]
if z is a:
r = fitspectrum(z,(1070,1110),'TwoGaussian',[100,1000,1078,1085,15,15,0,z[1110]] ) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess )
ratio = r.areas[0]/r.areas[1]
ratiolist.append(ratio)
z.plot(linewidth = lw)
print r.params[0]
for p in r.peaks:
ax1.plot(r.x,p,color = 'k',linewidth = 2)
plot(r.x,r.y, color = 'k', linewidth = lw)
native.plot(linewidth = lw)
xlim(555,1700)
ylim(-500,3000)
#legend(['mbt solid','2035eq','713eq','502eq','80eq','58eq','native'])
ax2=figure().add_subplot(111)
print ratiolist
ax2.plot([2035,713,502,80,58],ratiolist,'rs-')
return 0
示例12: thiophenolfits
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smooth [as 別名]
def thiophenolfits():
os.chdir('/home/chris/Documents/DataWeiss/150424')
a = RamanSpectrum('/home/chris/Documents/DataWeiss/150424/150424_01.txt')
b = RamanSpectrum('/home/chris/Documents/DataWeiss/150424/150424_04.txt')
c = RamanSpectrum('/home/chris/Documents/DataWeiss/150424/150424_10.txt')
d = RamanSpectrum('/home/chris/Documents/DataWeiss/150430/150430_01.txt')
e = RamanSpectrum('/home/chris/Documents/DataWeiss/150430/150430_03.txt')
ax1 = gca()
a = removespikes(a)
a.smooth()
a.smooth(window_len=21, window = 'SG')
a.autobaseline((68, 322),order = 4)
a.autobaseline((322, 767),order = 0,join='start')
a.autobaseline((767, 838),order = 0,join='start')
a.autobaseline((838, 1405),order = 2,join='start')
a.autobaseline((1405,1466),order = 0,join='start')
a.autobaseline((1466, 1974),order = 2,join='start')
b = removespikes(b)
b.smooth(window_len=21, window = 'SG')
b.autobaseline((68, 322),order = 4)
b.autobaseline((322, 767),order = 0,join='start')
b.autobaseline((767, 838),order = 0,join='start')
b.autobaseline((838, 1405),order = 2,join='start')
b.autobaseline((1405,1466),order = 0,join='start')
b.autobaseline((1466, 1974),order = 2,join='start')
#
c = removespikes(c)
c.smooth(window_len=21, window = 'SG')
c.autobaseline((68, 322),order = 4)
c.autobaseline((322, 767),order = 0,join='start')
c.autobaseline((767, 838),order = 0,join='start')
c.autobaseline((838, 1405),order = 2,join='start')
c.autobaseline((1405,1466),order = 0,join='start')
c.autobaseline((1466, 1974),order = 2,join='start')
d = removespikes(d)
d.smooth( window_len=21, window = 'SG')
d.autobaseline((68, 322),order = 4)
d.autobaseline((322, 767),order = 0,join='start')
d.autobaseline((767, 838),order = 0,join='start')
d.autobaseline((838, 1405),order = 2,join='start')
d.autobaseline((1405,1466),order = 0,join='start')
d.autobaseline((1466, 1974),order = 2,join='start')
e = removespikes(e)
e.smooth(window_len=21, window = 'SG')
e.autobaseline((68, 322),order = 4)
e.autobaseline((322, 767),order = 0,join='start')
e.autobaseline((767, 838),order = 0,join='start')
e.autobaseline((838, 1405),order = 2,join='start')
e.autobaseline((1405,1466),order = 0,join='start')
e.autobaseline((1466, 1974),order = 2,join='start')
a[:]+=200#ax1.lines[0].set_ydata(ax1.lines[0].get_ydata()+200)
b[:]+=500
c[:]+=800
d[:]+=1100
e[:]+=1500
a.plot(marker = 'o',markersize = 1)
b.plot(marker = 'o',markersize = 1)
c.plot(marker = 'o',markersize = 1)
d.plot(marker = 'o',markersize = 1)
e.plot(marker = 'o',markersize = 1)
ylim(0,1800)
xlim(68,1980)
a_list = list()
b_list = list()
c_list = list()
d_list = list()
e_list = list()
for w in (541,628,742,1574):
z = fitspectrum(a,(w-30,w+30),'OneGaussian', [300, w,50, 0,50])
if z ==-1:
print 'fit awry'
else:
a_list.append(z[0])
plot(z[1], z[2])
z = fitspectrum(a,(1045,1130),'TwoGaussian', [225, 1067,20,250, 1095,20, -1,50])
if z ==-1:
print 'fit awry'
else:
a_list.append(z[0])
plot(z[1], z[2])
###############################################################
#.........這裏部分代碼省略.........