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


Python RamanSpectrum.add_RamanSpectra方法代碼示例

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


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

示例1: Fig2

# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import add_RamanSpectra [as 別名]
def Fig2():  ##### View,filter, and average spectra of PbS dots with Methoxythiophenol in the 2300-3400 cm-1 range
    subplot(121)
    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/7_.txt")

    takeout(a)
    a.plot()
    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/7_.txt")
    b = RamanTools.FourierFilter(b, width=380)

    takeout(b, centers=(456, 483), demo=True)
    b.plot()
    c = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/8_.txt")
    takeout(c)
    c.plot()
    m = RamanTools.add_RamanSpectra(a, b)
    n = RamanTools.add_RamanSpectra(m, c)

    legend(["1", "2", "3"])
    subplot(122)

    MTP = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141014/4_methoxythiophenol_1.csv")
    MTP -= min(MTP[0:1000])
    MTP /= max(MTP[0:1000])
    MTP *= 1000
    MTP.plot(color="b", linewidth=3)
    n.autobaseline((2300, 3400))
    n /= 10
    n.plot()
    xlim(2300, 3400)
    ylim(-500, 1500)

    return 0
開發者ID:cmthompson,項目名稱:data,代碼行數:34,代碼來源:Subgroup+Nov25.py

示例2: Fig1

# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import add_RamanSpectra [as 別名]
def Fig1():  ##### View,filter, and average spectra of PbS dots with Methoxythiophenol in the 800-1600 cm-1 range
    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/5_.txt")
    # takeout(a)

    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/6_.txt")
    takeout(b)

    c = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/8_.txt")
    takeout(c)

    d = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/6_.txt")
    takeout(d)

    e = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/3_.txt")

    for l in [a, b, c, d, e]:
        noise = l.calc_noise((1100, 1200))
        signal = l.values[argmin(abs(array(l.index) - 1596))] - l.values[argmin(abs(array(l.index) - 1650))]
        print "S/N:", signal / noise

    l = RamanTools.add_RamanSpectra(a, b)

    m = RamanTools.add_RamanSpectra(l, c)

    o = RamanTools.add_RamanSpectra(m, d)
    # o = RamanTools.add_RamanSpectra(o,e)

    noise = l.calc_noise((1100, 1200))
    signal = l.iloc[argmin(abs(array(l.index) - 1596))] - l.iloc[argmin(abs(array(l.index) - 1650))]
    print "S/N:", signal / noise

    noise = m.calc_noise((1100, 1200))
    signal = m.iloc[argmin(abs(array(m.index) - 1596))] - m.iloc[argmin(abs(array(m.index) - 1650))]
    print "S/N:", signal / noise

    noise = o.calc_noise((1100, 1200))
    signal = o.iloc[argmin(abs(array(m.index) - 1596))] - o.iloc[argmin(abs(array(o.index) - 1650))]
    print "S/N:", signal / noise

    figure()
    subplot(311)
    a.plot(color="r")
    b.plot(color="k")
    c.plot(color="b")
    d.plot(color="g")
    legend(["a", "b", "c", "d"])

    # n = FourierFilter(n, width = 400)
    subplot(312)
    o.plot()

    subplot(313)

    n = RamanTools.FourierFilter(o, width=170)

    n.autobaseline((700, 1700))

    n.plot(color="k")

    ####  Reference Spectrum of MTP on Cd

    MTP = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141014/4_methoxythiophenol_1.csv")
    MTP -= min(MTP[0:1000])
    MTP /= max(MTP[0:1000])
    MTP *= 1000
    MTP.plot(color="b", linewidth=3)

    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/10_control pbs.txt")
    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/11_control.txt")
    c = RamanTools.add_RamanSpectra(a, b)
    control = RamanTools.FourierFilter(c, width=170)
    control.autobaseline((700, 1700))

    control.plot(color="r")

    xlim(700, 1700)
    ylim(-500, 1500)
    return 0
開發者ID:cmthompson,項目名稱:data,代碼行數:80,代碼來源:Subgroup+Nov25.py

示例3: Fig3

# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import add_RamanSpectra [as 別名]
def Fig3():  ### Combine final spectra from fig1 and fig2.  Display side by side.  Showing no SH stretch but some modes for phenyl ring in MTP.
    subplot(121)
    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/5_.txt")
    takeout(a)

    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/6_.txt")
    takeout(b)

    c = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/8_.txt")
    takeout(c)

    d = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/6_.txt")
    takeout(d)

    e = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/3_.txt")

    ##### total of 4500 s measurement for a-e, for a-d total is 2500 s
    l = RamanTools.add_RamanSpectra(a, b)

    m = RamanTools.add_RamanSpectra(l, c)

    o = RamanTools.add_RamanSpectra(m, d)
    n = RamanTools.FourierFilter(o, width=170)

    n.autobaseline((700, 1700))
    n /= 2500

    MTP = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141014/4_methoxythiophenol_1.csv")
    MTP -= min(MTP[0:1000])
    MTP /= max(MTP[0:1000])
    MTP += 1

    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/10_control pbs.txt")
    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/11_control.txt")
    c = RamanTools.add_RamanSpectra(a, b)
    ####total colection time for a and b is 1700
    control = RamanTools.FourierFilter(c, width=170)
    control.autobaseline((700, 1700))
    control[:] /= 1700
    control += 0.5

    MTP.plot(color="b", linewidth=3, label="MTP reference")
    control.plot(color="r", label="PbS-oleate only")
    n.plot(color="k", label="PbS-oleate + MTP")
    annotate(
        "C-S-H bend",
        (910, 1.25),
        xytext=(910, 2.0),
        arrowprops={"width": 1, "headwidth": 3, "frac": 0.05, "color": "k"},
        fontsize=14,
    )
    annotate(
        "Ring expansion",
        (804, 2.1),
        xytext=(804, 2.6),
        arrowprops={"width": 1, "headwidth": 3, "frac": 0.05, "color": "k"},
        fontsize=14,
    )
    annotate(
        "Ring expansion",
        (1095, 1.85),
        xytext=(1140, 1.9),
        arrowprops={"width": 1, "headwidth": 3, "frac": 0.05, "color": "k"},
        fontsize=14,
    )
    annotate(
        "Ring asymmetric rocking",
        (1600, 1.7),
        xytext=(1300, 1.8),
        arrowprops={"width": 1, "headwidth": 3, "frac": 0.05, "color": "k"},
        fontsize=14,
    )

    legend()
    xlim(700, 1700)
    ylim(-0.5, 3)
    ylabel("Intensity (a.u.)")
    xlabel("Raman Shift (cm$^{-1}$)")

    subplot(122)

    a = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141125/7_.txt")

    takeout(a)

    b = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/7_.txt")
    b = RamanTools.FourierFilter(b, width=380)

    takeout(b, centers=(456, 483))

    c = RamanTools.RamanSpectrum("/home/chris/Documents/DataWeiss/141126/8_.txt")
    takeout(c)
    #### Total collection time is 2500 s

    m = RamanTools.add_RamanSpectra(a, b)
    g = RamanTools.add_RamanSpectra(m, c)
    g.autobaseline((2300, 3400))

    g[:] /= 2500

#.........這裏部分代碼省略.........
開發者ID:cmthompson,項目名稱:data,代碼行數:103,代碼來源:Subgroup+Nov25.py


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