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
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
def Feb1(): ## """Resonance Raman of CdSe dots with PPA in water. February 1""" clf() a473 = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160201/160201_07.txt') a633 = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160201/160201_08.txt') a633=SPIDcorrect633(a633) a473.autobaseline((120,700),order = 3) a633.autobaseline((120,700),order = 3) a473.plot() a633.plot() legend(['473','633']) return 0
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
def OPAMBTExchange(): figure() a = RamanSpectrum('/home/chris/Documents/DataWeiss/150707/150707_02.txt') b = RamanSpectrum('/home/chris/Documents/DataWeiss/150707/150707_03.txt') a[:]*=5 b[:]*=5 subplot(121) a.plot() CdMethylTPRef.plot() legend(['new','old']) r = fitspectrum(a,(1070,1110),'OneGaussian',[25000,1088,10,0,0]) plot(r.x,r.y, 'k',linewidth = 2) r = fitspectrum(CdMethylTPRef,(1070,1110),'OneGaussian',[25000,1088,10,0,0]) plot(r.x,r.y,'r' ,linewidth = 2) subplot(122) b.plot() CdMeOTPRef.plot() legend(['new','old']) r = fitspectrum(b,(1070,1110),'OneGaussian',[60000,1088,10,0,0]) plot(r.x,r.y,'k',linewidth = 2) r = fitspectrum(CdMeOTPRef,(1070,1110),'OneGaussian',[6000,1088,10,0,0]) plot(r.x,r.y,'r', linewidth = 2) figure() June22() c= RamanSpectrum('/home/chris/Documents/DataWeiss/150707/150707_05.txt') c.autobaseline((200,2000),order= 4) c[:]+=4000 c.plot() figure() d= RamanSpectrum('/home/chris/Documents/DataWeiss/150707/150707_06.txt') d.autobaseline((200,2000),order= 4) d[:]*=10 d.plot() a.plot() legend(['exchanged', 'reference']) return 0
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
def Apr8Raman_forVictor(): os.chdir('/home/chris/Documents/DataWeiss/150408') fig = figure(figsize=(12,6)) subplot(121) a = RamanSpectrum('150408_15.txt') a = autobaseline(a, (200,1700),leaveout=(200,300),order=4) a+=800 b = RamanSpectrum('150408_02.txt') b = autobaseline(b,(200,1700),leaveout=(200,300), order = 4) (normalize(MeOTPRef,(0,10000))*4000+2000).plot(color ='b',linewidth=2,label = 'thiophenolate reference') a.plot(color = 'k',linewidth = 2) b.plot(color = 'r', linewidth = 2) ylim(-500,10000) xlim(740,1675) arrowprops={'width':1,'headwidth':3,'color':'k'} ylabel('Raman Intensity (a.u.)') xlabel('Raman Shift (cm$^{-1}$)') annotate('C-S-H bend', (913,2830),xytext = (913,3300), xycoords = 'data',arrowprops = arrowprops,horizontalalignment='center' ) subplot(122) e = RamanSpectrum('150408_13.txt') e.autobaseline((2500,3600),leaveout=(200,300),order=2) e.autobaseline((2500,2800),leaveout=(200,300), order = 1,join='end') e+=800 f = RamanSpectrum('150408_03.txt') f.autobaseline((2500,3600),leaveout=(200,300), order = 2) f.autobaseline((2500,2800),leaveout=(200,300), order = 1,join='end') (normalize(MeOTPRef,(0,10000))*4000+2000).plot(color ='b',linewidth=2) e.plot(color = 'k',linewidth = 2, ) f.plot(color = 'r', linewidth = 2) annotate('S-H stretch', (2560,3370),xytext = (2600,4500), xycoords = 'data',arrowprops = arrowprops,horizontalalignment='center' ) ylim(-500,10000) xlim(2500,3200) legend(['thiophenol reference','CdSe thiophenolate-treated','CdSe native ligand only']) ylabel('Raman Intensity (a.u.)') xlabel('Raman Shift (cm$^{-1}$)') # savetxt() return 0
def calculate_enchancement(): global r,s #### Calc SERS enhancement on os.chdir('/home/chris/Documents/DataWeiss/150109') r = RamanSpectrum('1_MeTOP roughened Ag_1.txt') s = RamanSpectrum('2_MeOTP smooth silver_1.txt') r.autobaseline((500,1750),order=0) s.autobaseline((500,1750),order=0) on_roughened = calc_area(r,(1050,1130))*100 #### multiply, because used filter 0.01 on_smooth = calc_area(s,(1050,1130)) print 'hormalized area on roughened substrate =', on_roughened print 'hormalized area on roughened substrate =', on_smooth r.plot(color = 'r') s.plot(color = 'k') legend(['roughened', 'smooth (x100)'],loc=2) annotate('x100', (0.6,0.7), xycoords = 'axes fraction', size = 24,color = 'k') print 'Approximate surface enhancement =',on_roughened/on_smooth xlabel('Raman Shift cm$^{-1}$') ylabel('Intensity a.u.') return 0
def Feb10(): figure() a = RamanSpectrum('/home/chris/Documents/DataWeiss/150210/43_ long scan.SPE') adding = pandas.Series([NaN]*len(arange(300,1500,0.5)),arange(300,1500,0.5)) d=a.append(adding) d = d.interpolate(method='index') d = d[arange(300,1500,0.5)] e = FourierFilter(d,width = 1100) e.plot() b = RamanSpectrum('/home/chris/Documents/DataWeiss/150210/44.SPE') c=b+a a.autobaseline((300,1600),order = 4) #a = smooth(a,window_len=9) b.autobaseline((300,1600),order = 4) #b=smooth(b,window_len=9) #a.plot() #b.plot() c= autobaseline(c,(300,1600),order = 4) c = smooth(c, window_len=9) #c.plot() legend(['a','d','e']) return d
def CdMBTinDMF(): clf() a = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_01.txt')#### DMFonly b = RamanSpectrum('/home/chris/Documents/DataWeiss/150709/150709_02.txt')#### 510mg DMF with 200 mgCdMBT a.autobaseline((523,935,1336,1780),order = 3,specialoption='points') b.autobaseline((523,935,1336,1780),order = 3,specialoption='points') a[:]*=4720 a[:]/=6256 c = RamanSpectrum(b-a) c.plot() r = fitspectrum(c,(1070,1105),'xVoigt',[10000,1088,15,6,0,0]) plot(r.x,r.y,'s-',linewidth=2) for i in r.peaks: plot(r.x,i) print r.areas print r.params[0][2:4] CdMethylTPRef.plot() # def difference(c): return sum((b[200:1700]-c*a[200:1700])**2) # r = minimize(difference,[1]) return r.params
def Dec15(): """PPAcapped CdS in water Raman""" cla() ODPARef.plot() OPARef.plot() ax = subplot(111) a = RamanSpectrum('151215/151215_04.txt')#,name='DMF 65 mM') a.autobaseline((295,350,473,580,755,988,1188,1317,1756,1853,2296,2400,2600),join='end',order = 8,specialoption='points') a.plot() b=RamanSpectrum('151215/151215_02.txt')#,name='7uM PPAcapped dots in water/DMF') b[:]/=3 b.autobaseline((295,350,473,580,755,961,1317,1756,1853,2296,2400,2600),join='end',order = 8,specialoption='points') b.plot() c=RamanSpectrum('151215/151215_05.txt')#,name = 'PPA') c.autobaseline((295,350,473,580,755,961,1317,1756,1853,2296,2400,2600),join='end',order = 8,specialoption='points') c.plot() quickoffset(ax,rnge=(200,1600)) return 0
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
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
def SH(): os.chdir('/home/chris/Documents/DataWeiss/150728') cdmbt=copy.deepcopy(CdMethylTPRef) mbt=copy.deepcopy(MethylTPRef) cdmbt.autobaseline((193,4000),order = 0) mbt.autobaseline((193,4000),order = 0) mbt[:]/=95 cdmbt[:]/=5 cdmbt.to_csv('/home/chris/Dropbox/Ken/CdMBT2.csv') fig1 = figure(figsize=(6, 12)) A = RamanSpectrum('filesA.txt') ##450 eq B = RamanSpectrum('filesB.txt') #200 eq MBT C = RamanSpectrum('filesC.txt') #100 eq MBT D = RamanSpectrum('filesD.txt') # 80 eq MBT E = RamanSpectrum('filesE.txt') # 50 eq MBT F = RamanSpectrum('filesF.txt') #25 eq MBT G = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_03.txt') G.autobaseline((2500,2700,3100,3200),order = 2, specialoption='points') for z in [A,B,C,D,E,F]: #z = SPIDcorrect633(z) z.autobaseline((200,361),order = 1,join='start') z.autobaseline((361,394),order = 2,join='start') z.autobaseline((394,647),order = 2,join='start') z.autobaseline((647,682),order = 0,join='start') z.autobaseline((682,923),order = 0,join='start') z.autobaseline((923,955),order = 0,join='start') z.autobaseline((955,1187),order = 0,join='start') z.autobaseline((1187,1214),order = 0,join='start') z.autobaseline((1214,1437),order = 0,join='start') z.autobaseline((1437,1462),order = 0,join='start') z.autobaseline((1462,1675),order = 2,join='start') z.autobaseline((1675,1701),order = 0,join='start') z.autobaseline((1701,1900), order =2,join='start') z.autobaseline((1900,2400), order =5,join='start') z.autobaseline((2400,3200),order = 0,join='start') z.autobaseline((3200,3600),order = 0,join='start') # z.autobaseline((981,1013,1098,1141,1251,1491),order =3,specialoption='points', join='start') z[:]/=50 z.smooth() z-=z[2402] for z in [G]: z.autobaseline((2400,3200),order = 0) z[:]/=50 z.smooth() z-=z[2402] mbt[:]+=700 mbt.set_name('mmmmmm') A[:]*=2 A[:]+=600 B[:]+=500 C[:]+=400 D[:]+=300 E[:]+=200 F[:]+=100 G[:]*=10 for z in [mbt,A,B,C,D,E,F,G]: z.to_csv('/home/chris/Dropbox/Ken/SHregion/'+z.name[-5]+'.csv') mbt.plot() A.plot() B.plot() C.plot() D.plot() E.plot() F.plot() G.plot() fs = 14 anx = 2605 annotate('solid MBT',(anx,740), fontsize=fs) annotate('450 eq MBT',(anx,620), fontsize=fs) annotate('200 eq MBT',(anx,520), fontsize=fs) annotate('100 eq MBT',(anx,420), fontsize=fs) annotate('80 eq MBT',(anx,320), fontsize=fs) annotate('50 eq MBT',(anx,220), fontsize=fs) annotate('25 eq MBT',(anx,120), fontsize=fs) annotate('0 eq',(anx,10), fontsize=fs) xlim(2500,3030) ylim(-20,1300) return 0
def SH(): os.chdir('/home/chris/Documents/DataWeiss/150728') cdmbt=copy.copy(CdMethylTPRef) mbt=copy.copy(MethylTPRef) cdmbt.autobaseline((1000,1200),order = 0) mbt.autobaseline((1000,1200),order = 0) mbt[:]/=95 cdmbt[:]/=5 cdmbt.to_csv('/home/chris/Dropbox/Ken/CdMBT2.csv') fig1 = figure(figsize=(6, 12)) A = RamanSpectrum('filesA.txt') ##450 eq B = RamanSpectrum('filesB.txt') #200 eq MBT C = RamanSpectrum('filesC.txt') #100 eq MBT D = RamanSpectrum('filesD.txt') # 80 eq MBT E = RamanSpectrum('filesE.txt') # 50 eq MBT F = RamanSpectrum('filesF.txt') #25 eq MBT G = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_03.txt') G.autobaseline((2500,2700,3100,3200),order = 2, specialoption='points') for z in [A,B,C,D,E,F,G]: z.autobaseline((2400,3200),order = 0) z[:]/=50 z.smooth() z-=z[2402] mbt[:]+=700 mbt.set_name('mmmmmm') A[:]*=2 A[:]+=600 B[:]+=500 C[:]+=400 D[:]+=300 E[:]+=200 F[:]+=100 G[:]*=10 for z in [mbt,A,B,C,D,E,F,G]: #z.to_csv('/home/chris/Dropbox/Ken/SHregion/'+z.name[-5]+'.csv') pass mbt.plot() A.plot() B.plot() C.plot() D.plot() E.plot() F.plot() G.plot() fs = 14 anx = 2605 annotate('solid MBT',(anx,740), fontsize=fs) annotate('450 eq MBT',(anx,620), fontsize=fs) annotate('200 eq MBT',(anx,520), fontsize=fs) annotate('100 eq MBT',(anx,420), fontsize=fs) annotate('80 eq MBT',(anx,320), fontsize=fs) annotate('50 eq MBT',(anx,220), fontsize=fs) annotate('25 eq MBT',(anx,120), fontsize=fs) annotate('0 eq',(anx,10), fontsize=fs) xlim(2500,3030) ylim(-20,1300) return 0
def June30(): """CdOPA references and some dots""" d = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_06.txt') ### pH 1 a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_07.txt') ### pH 5 b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_08.txt') ### pH 12 c= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots d.autobaseline((283,1989),order = 3) a.autobaseline((283,1989),order = 3) b.autobaseline((283,1989),order = 3) c.autobaseline((600,690,826,861,900,1196,1385,1515,1657),specialoption='points',order=7) #c[:]+=4500 #b[:]+=3000 #a[:]+=1500 c.plot() b.plot() a.plot() #d.plot() legend(['dots','CdOPA pH12', 'pH 5', 'pH1']) a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150630/150623_2.txt') a.autobaseline((700,1500), order = 0) b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150630/150623_3.txt') b.autobaseline((300,791), order =2) b.autobaseline((791,858),order = 0,join='start') b.autobaseline((858,2000),order =1,join='start') b.autobaseline((400,700,954,1495,1700),specialoption='points',order=3) #a.plot() c = add_RamanSpectra(a,b) b.plot() # OPARef.plot() return 0
def May18(): r = RamanSpectrum("/home/chris/Documents/DataWeiss/150518/150518_03b.txt") r.autobaseline((100, 763), order=3) r.autobaseline((763, 836), order=1, join="start") r.autobaseline((836, 1600), order=3, join="start") r.plot() r = RamanSpectrum("/home/chris/Documents/DataWeiss/150518/150518_05b.txt") r.autobaseline((100, 763), order=3) r.autobaseline((763, 836), order=1, join="start") r.autobaseline((836, 1650), order=3, join="start") r.plot() return 0
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]) ############################################################### for w in (623,639,793,1086,1598): z = fitspectrum(b,(w-30,w+30),'OneGaussian', [300, w,50, 0,850]) if z ==-1: print 'fit awry' else: b_list.append(z[0]) plot(z[1], z[2]) ############################################################### for w in (144,206,499,623,636,795,1088,1178,1280,1591): z= fitspectrum(c,(w-30,w+30),'OneGaussian', [300, w,50, 0,1150]) if z ==-1: print 'fit awry' else: c_list.append(z[0]) plot(z[1], z[2]) ############################################################### for w in (88,122,262,496,538,628,724,1066,1087,1177,1561): z= fitspectrum(d,(w-30,w+30),'OneGaussian', [300, w,50, 0,1550]) if z ==-1: print 'fit awry' else: d_list.append(z[0]) plot(z[1], z[2]) ############################################################### for w in (242,631,813,1083,1157,1588): z= fitspectrum(e,(w-30,w+30),'OneGaussian', [300, w,50, 0,50]) if z ==-1: print 'fit awry' else: e_list.append(z[0]) plot(z[1], z[2]) f = open('/home/chris/Documents/DataWeiss/150430/thiophenolsonDots.txt', 'w') f.write('\n\nchloro\n\n') for i in a_list: f.write(str(i[0])+'\n') f.write('\n\ncmethyl\n\n') for i in b_list: f.write(str(i[0])+'\n') f.write('\n\nmethoxy\n\n') for i in c_list: f.write(str(i[0])+'\n') f.write('\n\ncbromo\n\n') for i in d_list: f.write(str(i[0])+'\n') f.write('\n\ncfluoro\n\n') for i in e_list: f.write(str(i[0])+'\n') f.close() # fitspectrum(spectrum, rnge, func, guess) return (a_list,b_list,c_list,d_list,e_list)
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
def July1phosphonicacidtreated(): a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_07.txt') ### pH 5 b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_08.txt') ### pH 12 c= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots a.autobaseline((283,1989),order = 3) b.autobaseline((283,1989),order = 3) c.autobaseline((600,690,826,861,900,1196,1385,1515,1657),specialoption='points',order=7) c[:]+=4500 b[:]+=3000 a[:]+=1500 c.plot() b.plot() a.plot() c= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150701/files6phosphonate.txt' ) c.autobaseline((283,1989),order = 3) c[:]*=3 c.plot() a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150630/150623_2.txt') a.autobaseline((700,1500), order = 0) b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150630/150623_3.txt') b.autobaseline((300,791), order =2) b.autobaseline((791,858),order = 0,join='start') b.autobaseline((858,2000),order =1,join='start') b.autobaseline((400,700,954,1495,1700),specialoption='points',order=3) c = add_RamanSpectra(a,b) x = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150623/150623_4.txt') b.plot() OPARef.plot() x.plot() legend(['dots','CdOPA pH12', 'pH 5','phosJuuly1', 'phosJune23', 'OPA ref','june23']) return 0
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
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
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] r = fitspectrum(e,(1050,1110),'ThreeGaussian', [100,300,1500,1065,1078,1085,15,15,15,0,2000] ) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess ) ratio = r.areas[1]/r.areas[2] ratiolist.append(ratio) e.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(e_unwashed,(1070,1110),'TwoGaussian',guess) #r = fitspectrum(z,(1070,1110),'TwoGaussian',guess ) ratio = r.areas[0]/r.areas[1] ratiolist.append(ratio) e_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) legend(['c-washed1', 'c-unwashed','e-washed', 'eunwashed']) print ratiolist return 0
def June22(): """Nice spectra of CdOPA and dotsOPA""" d = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_06.txt') ### pH 1 a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_07.txt') ### pH 5 b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150622/150622_08.txt') ### pH 12 c= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots d.autobaseline((283,1989),order = 3) d.autobaseline((284,408,577,701,826,1147,1380,1588,1849,1976),join='start',order = 9,specialoption='points') a.autobaseline((283,1989),order = 3) a.autobaseline((284,577,701,826,1147,1380,1588,1849,1976),join='start',order = 9,specialoption='points') b.autobaseline((283,1989),order = 3) b.autobaseline((284,577,701,826,1147,1380,1588,1849,1976),join='start',order = 9,specialoption='points') c= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots c.autobaseline((911,1196,1385,1515,1800),specialoption='points',order=7,join='start') c.autobaseline((280,600,690,826,861,911),specialoption='points', order = 5,join='end') c.autobaseline((281,630), order = 4, join = 'end') c.autobaseline((1492,1800), order = 5, join = 'start') c[:]*=3 c[:]+=5000 b[:]+=4000 a[:]+=1300 c.plot() b.plot() a.plot() d.plot() ylim(0,10000) xlim(400,1800) legend(['dots','CdOPA pH12', 'pH 5', 'pH1']) tosave = transpose([d.index,d.values,a.values,b.values]) savetxt('/home/chris/Desktop/emily/CdOPARaman.csv', tosave, header = 'pH1, pH5, pH12',delimiter = ',') c.to_csv('/home/chris/Desktop/emily/DotsOPARaman.csv') ylabel('Intensity (a.u.)') xlabel('Raman Shift (cm$^{-1}$)') # savefig('/home/chris/Dropbox/GroupmeetingJuly9_2015/dotsandrefs.png', dpi=256) return 0
def MBTSeries(): """methylbenzenethiol exchanged CdSe quantum dots on June12""" clf() ax1 = gca() chdefarea=array([]) thiolarea=array([]) native= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ###### Native ligand only native[:]/=2 #native=removespikes(native) native.autobaseline((911,1196,1385,1515,1800),join='start',specialoption='points',order=7) native.autobaseline((600,690,826,861,911),specialoption='points', order = 5,join='end') eightyfour= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150623/150623_7.txt') ###### 84 eq eightyfour[:]/=2 #eightyfour=removespikes(eightyfour) eightyfour.autobaseline((764,838),order = 0,join='start') eightyfour.autobaseline((838,2000),order = 1,join='start') eightyfour.autobaseline((600,690,826,861,900,1196,1385,1515,1657),specialoption='points',order=7) # eightyfour.smooth() sixhundredforty= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150617/150617_01.txt') ###### 640 eq MBT #sixhundredforty=removespikes(sixhundredforty) sixhundredforty.autobaseline((803,861),order=1, join='start') sixhundredforty.autobaseline((861,1254),order = 2, join='start') sixhundredforty.autobaseline((1254,1515),order = 4, join = 'start') sixhundredforty.autobaseline((1515,2000),order = 3, join = 'start') sixhundredforty.autobaseline((555,613,764,1141,1321,1565,1652),specialoption='points',order=6) #sixhundredforty.smooth() thirtytwo=RamanSpectrum('/home/chris/Dropbox/DataWeiss/150623/150623_10.txt') ###### 32 equivalents #thirtytwo=removespikes(thirtytwo) thirtytwo.autobaseline((300,862),order = 1,join='start') thirtytwo.autobaseline((786,862),order = 0,join='start') thirtytwo.autobaseline((862,1425),order = 2,join='start') thirtytwo.autobaseline((1425,1439),order = 1,join='start') thirtytwo.autobaseline((1439,2000),order = 2,join='start') x = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150623/150623_12.txt') #x= removespikes(x) x.autobaseline((740,1441),order = 1) thirtytwo=add_RamanSpectra(thirtytwo,x) thirtytwo.autobaseline((740,764,1052,1141,1321,1425,1441),specialoption='points',order=2) # thirtytwo.smooth() oneseventynine=RamanSpectrum('/home/chris/Dropbox/DataWeiss/150623/150623_16.txt') ###### 179 equivalents # oneseventynine=removespikes(oneseventynine) oneseventynine.autobaseline((300,793),order = 1,join='start') oneseventynine.autobaseline((793,862),order = 1,join='start') oneseventynine.autobaseline((862,1460),order = 1,join='start') oneseventynine.autobaseline((1460,1486),order = 1,join='start') oneseventynine.autobaseline((1486,2000),order = 1,join='start') oneseventynine.autobaseline((740,764,1052,1141,1321,1425,1441,1700),specialoption='points',order=2) #oneseventynine.smooth() mbt = CdMethylTPRef.copy() mbt[:]/=10 lw = 2 thirtytwo[:]+=200 eightyfour[:]+=700 oneseventynine[:]+=1000 sixhundredforty[:]+=1550 mbt[:]+=1950 chtwistarea=array([native.calc_area((1285,1332)),thirtytwo.calc_area((1285,1332)),eightyfour.calc_area((1285,1332)),oneseventynine.calc_area((1285,1332)),sixhundredforty.calc_area((1285,1332)),mbt.calc_area((1285,1332))]) chdefarea=array([native.calc_area((1413,1475)),thirtytwo.calc_area((1413,1475)),eightyfour.calc_area((1413,1475)),oneseventynine.calc_area((1413,1475)),sixhundredforty.calc_area((1413,1475)),mbt.calc_area((1413,1475))]) thiolarea1=array([native.calc_area((1587,1611)),thirtytwo.calc_area((1587,1611)),eightyfour.calc_area((1587,1611)),oneseventynine.calc_area((1587,1611)),sixhundredforty.calc_area((1587,1611)),mbt.calc_area((1587,1611))]) fits1 = list() fits2 = list() a = [thirtytwo, eightyfour, oneseventynine, sixhundredforty, mbt] a.reverse() for i in a: i.plot(linewidth=lw,axes=ax1) native.plot(linewidth = lw,axes=ax1) ax1.set_ylabel('Intensity (a.u.)') ax1.set_xlabel('Raman shift (cm$^{-1}$') legend(['solid', '640eq','179', '84eq','32eq','0']) ax1.set_xlim(500,1800) ax1.set_ylim(0,10000) ax2 = figure().add_subplot(111) for i in [thirtytwo, eightyfour, oneseventynine, sixhundredforty]: guess = [100,500,500,1065,1080,1085,7, 7,7,0,i[1100]] r = fitspectrum(i,(1050,1105), 'xGaussian', guess) for p in r.peaks: ax1.plot(r.x, p,'k', linewidth = 2) fits1.append(r.areas[1]/r.areas[2]) ax2.plot([32,84,179,640],fits1,'rs-', label='1') return None
def Jan6(): ### Raman spectra of PPA exchanged dots at different points in exchange clf() a = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_03.txt') b = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_05.txt') c = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_06.txt') d = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_07.txt') e = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_09.txt') f = RamanSpectrum('/home/chris/Dropbox/DataWeiss/160106/160106_10.txt') a = removespikes(a) a.autobaseline((200,1800), order = 5) a.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') b.autobaseline((200,1800), order = 5) b.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') b[:]+=10000 c.autobaseline((200,1800), order = 5) c.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') c[:]+=20000 d.autobaseline((200,1800), order = 5) d.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') d[:]+=30000 e.autobaseline((200,1800), order = 5) e.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') e[:]+=40000 f.autobaseline((200,1800), order = 5) f.autobaseline((1800,2100,2700,3200,3600), specialoption='points',order = 3,join='start') f[:]+=50000 a.plot(color = 'k') b.plot(color = 'k') c.plot(color = 'k') d.plot(color = 'k') e.plot(color = 'k') f.plot(color = 'k') OPAdots = RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots OPAdots= RamanSpectrum('/home/chris/Dropbox/DataWeiss/150612/150612_01_CdSe.txt') ## dots OPAdots.autobaseline((911,1196,1385,1515,1800),specialoption='points',order=7,join='start') OPAdots.autobaseline((280,600,690,826,861,911),specialoption='points', order = 5,join='end') OPAdots.autobaseline((281,630), order = 4, join = 'end') OPAdots.autobaseline((1492,1800), order = 5, join = 'start') OPAdots[:]*=3 OPAdots[:]+=35000 # OPAdots.plot() DMF = RamanSpectrum('/home/chris/Dropbox/DataWeiss/151215/151215_04.txt') DMF.autobaseline((300,1800), order =3) DMF[:]+=21000 #DMF.plot() #(CdOPARef*3+35000).plot(color = 'b') return 0