當前位置: 首頁>>代碼示例>>Python>>正文


Python RamanSpectrum.set_name方法代碼示例

本文整理匯總了Python中ramanTools.RamanSpectrum.set_name方法的典型用法代碼示例。如果您正苦於以下問題:Python RamanSpectrum.set_name方法的具體用法?Python RamanSpectrum.set_name怎麽用?Python RamanSpectrum.set_name使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ramanTools.RamanSpectrum的用法示例。


在下文中一共展示了RamanSpectrum.set_name方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: Aug27abs

# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import set_name [as 別名]
def Aug27abs():
    """UVvis spectra of CdS dots prepared for Zurich XPS"""
    figure()
    title('Aug27')
    a = loadtxt('/home/chris/Dropbox/DataWeiss/150827/CdS_synthAug27.csv', skiprows = 1, unpack= True,delimiter=',')
    a[1]-=a[1][0]
    
    plot(a[0],a[1])
    
    b = loadtxt('/home/chris/Dropbox/DataWeiss/150827/CdSsynthAug27_fluor.csv',skiprows = 1, unpack= True,delimiter=',')
    b = RamanSpectrum(pandas.Series(b[3],b[0]))
    b.set_name('myname')
    b[:]/=b[408]
    b.plot()
    b[:]/=b[408]
    r = fitspectrum(b,(407,470),'xGaussian',[1,0.5,0.2,423,439,450,18,10,18,0,0])
    print r.params
    for i in r.peaks:
        plot(r.x,i)
    b.plot()
    print r.params[0][6]
    print 'FWHM fluorescence =', 2*numpy.sqrt(r.params[0][6]*log(2))
    
    figure()
    title('UVVis absorption of CdS quantum dots')
    c = loadtxt('/home/chris/Dropbox/DataWeiss/150828/CdS_synthAug28.csv', skiprows = 1, unpack= True,delimiter=',')
    c[1]-=c[1][0]
    plot(c[0],c[1])
    ylabel('absorbance (a. u.)')
    xlabel('wavelength (nm)')
    annotate('$\lambda_{max}$ = 412 nm \n diameter = 3.8 nm',(412,0.51))
    
    figure()
    title('Aug31')
    d = loadtxt('/home/chris/Dropbox/DataWeiss/150831/CdS_synthAug31.csv', skiprows = 1, unpack= True,delimiter=',')
    d[1]-=d[1][0]
    d[1]/=0.497
    plot(d[0],d[1])
    
    dfluor = loadtxt('/home/chris/Dropbox/DataWeiss/150831/CdS_synthAug31_fluor.csv',skiprows = 1, unpack= True,delimiter=',')
    dfluor = RamanSpectrum(pandas.Series(dfluor[3],dfluor[0]))
    dfluor.set_name('myname')
    dfluor[:]-=min(dfluor)
    dfluor[:]/=dfluor[422]
    dfluor.plot()
    legend(['absoption', 'fluorescence'])
    ylabel('absorbance (a. u.)')
    xlabel('wavelength (nm)')
    
    r = fitspectrum(dfluor,(407,670),'xGaussian',[1,1,423,580,18,200,0,0])
    print r.params
#    for i in r.peaks:
#        plot(r.x,i)

    
    print 'FWHM fluorescence  =', 2*numpy.sqrt(r.params[0][4]*log(2))
 
    
    
    figure()
    title('all spectra corrected for dilution')
    subplot(121)
    a[1]*=(1652/52)
    c[1]*=(1675/73)
    d[1]*=(1731/63)
    
    plot(a[0],a[1])
    plot(c[0],c[1])
    plot(d[0],d[1])
    legend(['Aug27', 'Aug28', 'Aug31'])
    ylabel('absorbance of original solution (a. u.)')
    
    average = (40*a[1]+40*c[1]+80*d[1])/160
    
    subplot(122)
    
    plot(a[0],average)
    legend(['average'])
    return 0
    

          
    
            
開發者ID:cmthompson,項目名稱:data,代碼行數:81,代碼來源:Aug27.py


注:本文中的ramanTools.RamanSpectrum.set_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。