本文整理匯總了Python中ramanTools.RamanSpectrum.smoothbaseline方法的典型用法代碼示例。如果您正苦於以下問題:Python RamanSpectrum.smoothbaseline方法的具體用法?Python RamanSpectrum.smoothbaseline怎麽用?Python RamanSpectrum.smoothbaseline使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ramanTools.RamanSpectrum
的用法示例。
在下文中一共展示了RamanSpectrum.smoothbaseline方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: indivQY
# 需要導入模塊: from ramanTools import RamanSpectrum [as 別名]
# 或者: from ramanTools.RamanSpectrum import smoothbaseline [as 別名]
def indivQY(
UVVisfile,
UVViscolumn,
anthracenecolumn,
fluorescencefile,
anthracenefluorescencefile,
subtractfluorfile=None,
UVVisplot=None,
fluorplot=None,
fluorescencerange=(410, 473),
excitationwavelength=350,
nliq=1.333,
day=0,
label=None,
color="k",
_plot_standard=False,
subtract_smooth_background_for_anthracene=False,
):
print "-------------------------------------"
print "calculating fluorescence yield for", label, "file", fluorescencefile
alphabet = "abcdefghijklmnopqrstuvwxyz"
if len(UVViscolumn) == 1:
numuvviscolumn = alphabet.find(UVViscolumn)
elif len(UVViscolumn) == 2:
numuvviscolumn = alphabet.find(UVViscolumn[0]) * 26 + alphabet.find(UVViscolumn[1])
a = loadtxt(
UVVisfile, delimiter=",", unpack=True, skiprows=1, usecols=(0, numuvviscolumn, alphabet.find(anthracenecolumn))
)
a[1:] -= transpose([a[1:, 0]])
anthracene = RamanSpectrum(pandas.Series(a[2][::-1], a[0][::-1]))
dot = RamanSpectrum(pandas.Series(a[1][::-1], a[0][::-1]))
if subtract_smooth_background_for_anthracene:
anthracene.smoothbaseline((290, 300), (390, 400))
anthracene[:] -= anthracene[389]
anthraceneabsorbance350 = anthracene[excitationwavelength]
absvalues = dot[excitationwavelength]
nE = 1.359
nQ = 1.44
nW = 1.333 ## refractive index water
a = loadtxt(anthracenefluorescencefile, delimiter="\t", unpack=True, skiprows=2, usecols=(0, 3))
a[1] -= a[1, -1]
anthracenefluorescence = RamanSpectrum(pandas.Series(a[1], a[0]))
###Normalizing to value of anthracene at 420 nm The area for the anthracene fluorescence is related to this value by 78.203
# anthracenefluorescencearea = anthracenefluorescence[420]*78.2032212661
# anthracenefluorescencearea = anthracenefluorescence[440]*292.86
anthracenefluorescencearea = anthracenefluorescence[470] * 1257
print "anthracene fluorescence area=", "%.2E" % anthracenefluorescencearea
print anthracenefluorescence.calc_area((355, 550)) / anthracenefluorescence[
470
], "ratio of total anthracene fluorescence area to value at 470"
oneminusTdot = 1 - 10 ** (-absvalues) ##### gives the fraction of photons absorbed by dots
oneminusT_anthracene350 = 1 - 10 ** (-anthraceneabsorbance350)
print "anthracene absorbance at 350 nm:", anthraceneabsorbance350, ". Fraction photons absorbed:", oneminusT_anthracene350
print "dot absorbance at 350 nm:", absvalues, ". Fraction photons absorbed:", oneminusTdot
a = loadtxt(fluorescencefile, delimiter="\t", unpack=True, skiprows=2, usecols=(0, 3))
hi = RamanSpectrum(pandas.Series(a[1], a[0]))
if subtractfluorfile != None:
b = loadtxt(subtractfluorfile, delimiter="\t", unpack=True, skiprows=1, usecols=(0, 3))
fluorbackground = RamanSpectrum(pandas.Series(b[1], b[0]))
hi[:] -= fluorbackground[:]
fluorbackground.plot(ax=fluorplot)
hi.plot(ax=fluorplot)
hi[:] -= min(hi[400:500])
hi[:] *= (
0.27
/ (1 + 0.00145 * 158)
* oneminusT_anthracene350
* nliq ** 2
/ nE ** 2
/ anthracenefluorescencearea
/ oneminusTdot
)
dotfluorescencearea = hi.calc_area(fluorescencerange, fill=False)
## quantum yield of dots using 0.27 as QY for anthracene with o2 quenching corrrection
print "fluorescence (bande edg) yield of dot", dotfluorescencearea
if UVVisplot is not None:
if _plot_standard:
anthracene.plot(ax=UVVisplot) # plot(a[0],anthracene)
dot.plot(ax=UVVisplot, label=label)
if fluorplot is not None:
hi.plot(ax=fluorplot, label=label)
if _plot_standard:
anthracenefluorescence.plot(ax=fluorplot, label=label)
#.........這裏部分代碼省略.........