Ejemplo n.º 1
0
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)

    return dotfluorescencearea