Ejemplo n.º 1
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
Ejemplo n.º 2
0
def figure1():
    os.chdir('/home/chris/Documents/DataWeiss/150113')

    r = RamanSpectrum('15_CdSeMTP dropcast_1.txt')
    s = RamanSpectrum('18_1.txt')
    r = smooth(r)
    s= smooth(s)
    r+=100
    s+=100
    r.plot()
    s.plot()
    
    figure()
    r = autobaseline(r,(467,1463),order=3)+200
    r.plot()
    
    s = autobaseline(s,(467,1463),order=3)+400
    s.plot()
    
    MBT = RamanSpectrum('/home/chris/Documents/DataWeiss/141014/4_methoxythiophenol_1.csv')
    MBT-=min(MBT[0:2000])
    MBT/=max(MBT[0:2000])/500
    MBT.plot()
    
    legend(['Ag/Hexanethiol', 'Ag/Hexanethiol + CdSeMTP', 'CdMTP ref'])
    
    
    return 0
Ejemplo n.º 3
0
def May14():
    clf()
    s = RamanSpectrum("/home/chris/Documents/DataWeiss/150514/150514_12.txt")
    a = RamanSpectrum("/home/chris/Documents/DataWeiss/150514/150514_13.txt")
    b = RamanSpectrum("/home/chris/Documents/DataWeiss/150514/150514_14.txt")
    c = add_RamanSpectra(a, b)
    # c = add_RamanSpectra(s,c)

    d = RamanSpectrum("/home/chris/Documents/DataWeiss/150514/150514_15.txt")
    v = RamanSpectrum("/home/chris/Documents/DataWeiss/150514/150514_16.txt")
    z = 0.15

    e = subtract_RamanSpectra(c, d * z)

    # e.smooth()
    l = subtract_RamanSpectra(c, v * z)
    # l.smooth()
    e = RamanSpectrum(e.append(l))
    e = autobaseline(e, (180, 277), order=4)
    e = autobaseline(e, (277, 1700), order=4, join="start")
    # j = subtract_RamanSpectra(c,RamanSpectrum(pandas.Series(f[2],f[1])))
    e.plot()

    # d.plot()
    # v.plot()

    # CdMeOTPRef.index = array(CdMeOTPRef.index)-5
    (CdMeOTPRef / 120).plot()
    (MeOTPRef / 240).plot()

    return 0
Ejemplo n.º 4
0
def Apr15():
    def gauss(x,A,G,m,b):return A*exp(-(1090-x)**2/G)+m*x+b
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150415/150415_15.txt')
    a = SPIDcorrect(a)
    noise = calc_noise(a,(900,1000))
    start = argmin(abs(1065-array(a.index)))
    end = argmin(abs(1115-array(a.index)))
    x = array(a.index[start:end])
    y = a.values[start:end]
    guess = [10,15,-1,y[0]+1000]
    
    peak = scipy.optimize.curve_fit(gauss, x, y, guess)
    print peak[0]
    
    
    a.plot(color = 'k')
    #plot(x,gauss(x,*peak[0]))
    #
    print 'signal to noise =', sqrt(peak[0][0]/noise)
    ylim(27000,37000)
    ylabel('Raman Intensity (a.u.)')
    xlabel('Raman Shift (cm$^{-1}$)')
    
    
    ax3 = gcf().add_axes((0.6,0.6,0.25,0.25))
    a.plot(color='k', ax = ax3)
    ax3.annotate('S/N: '+str(1.66), (1080, 28700), textcoords = 'data', size = 18)
    ax3.set_ylim(27500,29300)
    ax3.set_xlim(900,1200)
    return 0
Ejemplo n.º 5
0
def Mar31():
    
    subplot(221)
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150331/150331_02.txt')
    a = autobaseline(a,(141,1700),order = 4)
    a = smooth(a)+50
    #b = RamanSpectrum('/home/chris/Documents/DataWeiss/150331/150331_03.txt')
    #c =add_RamanSpectra(a,b)
    a.plot(color = 'k')
    

    
    ylim(0,200)
    xlim(140,1700)
    
    subplot(222)
    
    a.plot(color = 'k')
    xlim(2700,3100)
    ylim(50,100)
    
    subplot(223)
    (RamanSpectrum('/home/chris/Documents/DataWeiss/140918/9_CdMeOTP.SPE')/10-1800).plot(color = 'b')
    CdODPARef.plot(color = 'r')
    xlim(100,1700)
    ylim(0,5000)
    
    subplot(224)
    (RamanSpectrum('/home/chris/Documents/DataWeiss/140918/7_CdMeOTP.SPE')-40000).plot(color='b')
    (CdODPARef+10000).plot(color = 'r')
    xlim(2700,3100)
Ejemplo n.º 6
0
def m():

    r = RamanSpectrum('/home/chris/Documents/DataWeiss/150304/2_ light.SPE')
    v = smooth(r)
    for i in range(5):
        v = smooth(v)
    v.plot(marker='s')
    r.plot()
    return 0
Ejemplo n.º 7
0
def Mar24():  ########### Raman of older red dots.  These have polystyrene or toluene on them. 
    figure()
    j = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_22.txt')
    k = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_23.txt')
    l = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_26.txt')
    m = add_RamanSpectra(j,k)
    m=add_RamanSpectra(m,l)
    m=autobaseline(m,(0,3300),order = 0)
    m=smooth(m)
    m.plot(label='NativeLigands')
    
    j = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_24.txt')
    k = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_25.txt')
    l = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_26.txt')
    m = add_RamanSpectra(j,k)
    m=add_RamanSpectra(m,l)
    m=autobaseline(m,(0,3300),order = 0)
    
    m=smooth(m)
    m.plot(label='NativeLigands')
    
    j = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_28.txt')
    k = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_29.txt')
    
    m = add_RamanSpectra(j,k)
    m=autobaseline(m,(0,3300),order = 0)
    m=smooth(m)
    
    m.plot(label='NativeLigands')
    
    ref = RamanSpectrum('/home/chris/Documents/DataWeiss/141007/Liquid sample corrected-spectrum of toluene.txt')
    ref.plot(label = 'toluene')
    legend()
    title('Native Ligand')
    
    
    figure()
    j = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_34.txt')
    m=smooth(j)
    m.plot(label='MeOTP')
    
    
    j = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_35.txt')
    k = RamanSpectrum('/home/chris/Documents/DataWeiss/150324/NativeLigand_Red_36.txt')
   
    m = add_RamanSpectra(j,k)
   
    m=smooth(m)
    m.plot(label='MeOTP')
    
    title('MeOTP treated')
    
    
    return 0
Ejemplo n.º 8
0
def Jan22():### data from trying out the cryostat
    from scipy import optimize
    os.chdir('/home/chris/Documents/DataWeiss/150121')
    
    
    red = RamanSpectrum('17.SPE')
    red = normalize(red,(0,1600))
    red.plot(label='647 nm')
    
    green = RamanSpectrum('14.SPE')
    green=normalize(green,(0,1600))
    green.plot(label = '514 nm')
    
    
    cdRef=normalize(CdMeOTPRef,(0,1600))
    cdRef.plot(label = 'CdMeOTP Reference')
    
    mtpref = normalize(MeOTPRef,(0,1600))
    mtpref.plot(label = 'MeOTP Reference')
    xlim(1050,1150)
    
    legend()
    
    def singlegauss(x, A1, x1, c1):return A1*exp(-(x-x1)**2/(2*c1**2)) 
    def doublegauss(x, A1, x1, c1,A2,x2,c2):return A1*exp(-(x-x1)**2/(2*c1**2)) +A2*exp(-(x-x2)**2/(2*c2**2))
    green = autobaseline(green, (1050,1150), order = 0)
    print argmin(abs(green.index-1100))
    x = array(green.index[620:680])
    y = array(green.values[620:680])  
    print x
    
    
    r = list(optimize.curve_fit(singlegauss,x,y,[1,1087,20])[0])
    figure()
    plot(x,y,'s')
    plot(x,singlegauss(x,*r),'k')
    print r
    
    r = list(optimize.curve_fit(doublegauss,x,y,[1,1080,10,1,1090,10])[0])
    
    plot(x,doublegauss(x,*r),'r')
    
    
    plot(x,singlegauss(x,r[0],r[1],r[2]),'k.')
    plot(x,singlegauss(x,*r[3:6]),'k.')
    
    
    print r
    
    
         
    xlabel('Raman Shift cm$^{-1}$')
    ylabel('Intensity a.u.')
    return 0
Ejemplo n.º 9
0
def May21():
    a = RamanSpectrum("/home/chris/Documents/DataWeiss/150521/150521stoic_dots.CSV")
    a[:] -= 0.2
    n_guess = [
        0.05,
        0.05,
        0.05,
        0.1,
        0.05,
        0.05,
        0.05,
        0.05,
        0.05,
        0.05,
        1015,
        1048,
        1075,
        1100,
        1159,
        1169,
        1184,
        1204,
        1221,
        1246,
        20,
        20,
        20,
        40,
        20,
        40,
        20,
        20,
        20,
        20,
        0,
        0.0,
    ]

    a.plot(color="k")
    print a.nearest(1100)
    print a.nearest(1300)
    b = fitspectrum(a, (1000, 1260), "xGaussian", n_guess)
    print b.params[0]
    plot(b.x, b.y, "r")
    print len(b.x)
    print len(b.peaks)
    # plot(b.x,b.peaks[0])
    for p in b.peaks:
        plot(b.x, p, "b")
        # pass

    b = (RamanSpectrum("/home/chris/Documents/DataWeiss/150520/150520_02.txt") - 500) / 10000
    b.plot()
    return 0
Ejemplo n.º 10
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
Ejemplo n.º 11
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
Ejemplo n.º 12
0
def smooth_phonon():
    import RamanTools2
    
    aa = RamanSpectrum('/home/chris/Documents/DataWeiss/141029/4_RubyRed in PS phonon_1.txt')
     
    
    aa-=min(aa)    
    aa/=max(aa)
    aa._smooth(aa.values,window = 'flat')  
    
    aa.plot(color = 'r')
   
    return aa
Ejemplo n.º 13
0
def Apr6():
    subplot(221)
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150406/150406_02.txt')
    a.plot(color = 'k')
    
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150406/150406_03.txt')
    a.plot(color = 'k')
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150406/150406_04.txt')
    a.plot(color = 'k')
    
    ylim(1000,3500)
    xlim(100,1700)
    
    subplot(222)
    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150406/150406_01.txt')
    a.plot(color = 'k')
    xlim(2700,3100)
    
    subplot(223)
    (RamanSpectrum('/home/chris/Documents/DataWeiss/140918/9_CdMeOTP.SPE')/10-1800).plot(color = 'b')
    CdODPARef.plot(color = 'r')
    xlim(100,1700)
    ylim(0,5000)
    
    subplot(224)
    (RamanSpectrum('/home/chris/Documents/DataWeiss/140918/7_CdMeOTP.SPE')-40000).plot(color='b')
    (CdODPARef+10000).plot(color = 'r')
    xlim(2700,3100)

    return 0
Ejemplo n.º 14
0
def concentrationdependence():  ### determine best conc of dots to add to silver to get signal/fluorescend. 

    os.chdir('/home/chris/Documents/DataWeiss/150114')
    
    two_x = RamanSpectrum('1_concentration 2x -highest conc_1.txt')
    two_x+=1000
    one_x = RamanSpectrum('2_1x conc_1.txt')
    one_x+=500
    _25x = RamanSpectrum('3_0_25xconc_1.txt')
    _25x*=10
    _25x-=1000
    _0625x = RamanSpectrum('5_0_0625x conc_1.txt')
    _0625x*=10
    _0625x-=1500
    
    
    two_x.plot()
    one_x.plot()
    _25x.plot()
    _0625x.plot()
    
    legend(['2x','1x','0.25x*10','0.0625x * 10'])
    xlabel('Raman Shift cm$^{-1}$')
    ylabel('Intensity a.u.')
    return 0
Ejemplo n.º 15
0
def May16():

    c = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_08.txt")
    c.values[:] *= 3
    c = autobaseline(c, (300, 1700), order=6)
    c.smooth()
    c.plot(label="Cd-enriched")
    a = fitspectrum(
        c,
        (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="Cdenriched fit")

    #    a = RamanSpectrum('/home/chris/Documents/DataWeiss/150516/150516_08.txt')
    #    b = RamanSpectrum('/home/chris/Documents/DataWeiss/150516/150516_07.txt')
    #    c = add_RamanSpectra(a,b)
    #
    #    c = autobaseline(c,(300,1700),order = 4)
    #    c.smooth()
    #    c.plot(label='stoichiometric')
    #

    # CdMeOTPRef.index = array(CdMeOTPRef.index)-5
    # (CdMeOTPRef/120).plot()
    # (MeOTPRef/240).plot()
    a = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_01.txt")
    b = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_02.txt")
    c = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_03.txt") * 4
    d = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_05.txt")
    e = RamanSpectrum("/home/chris/Documents/DataWeiss/150516/150516_06.txt")
    a = add_RamanSpectra(a, b)

    a = add_RamanSpectra(a, c)

    a = add_RamanSpectra(a, d)

    a = add_RamanSpectra(a, e)

    a.values[:] /= 10
    a.plot(label="pieces")

    # ics('/home/chris/Orca/Successful/CdMeOTP/CdMeOTP.out')
    # ics('/home/chris/Orca/CdTP_bridge/CdTP_bridgeDFT.out',color='r')
    # a= fitspectrum(a,(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= 'piecesfit')
    return 0
Ejemplo n.º 16
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
Ejemplo n.º 17
0
def Oct17NMRfitting():
#    a = loadtxt('/home/chris/Dropbox/DataWeiss/151020/MPAexchange on HCN_1000eq.csv',skiprows = 1, usecols = (0,1), delimiter = ',', unpack = True)
#   `r = RamanSpectrum(pandas.Series(a[1],a[0]))
#    w=1E-5
#    g = [0.05,0.03,0.05,.03,.1,.03,.05,.03,.05,1.38,1.39,1.395,1.405,1.41,1.42,1.425,1.43,1.44,w,w,w,w,w,w,w,w,w,0,0]
#    s = fitspectrum(r,(1.34,1.46), 'xGaussian', g)
#    clf()
#    r.plot()
#    for i in s.peaks: plot(s.x,i)
#    plot(s.x,s.y)
#    print s.areas
#    xlim(1.34,1.49)
#    ylim(-0.01,0.1)
    
 
#    a = loadtxt('/home/chris/Dropbox/DataWeiss/151020/MPAexchange on HCN_100eq.csv',skiprows = 1, usecols = (0,1), delimiter = ',', unpack = True)
#    r = RamanSpectrum(pandas.Series(a[1],a[0]))
#    r.name = ''
#    w=1E-5
#    a = 0.04
#    g = [a,a,a,a,a,a,a,a,a,a,a,1.38,1.385,1.392,1.398,1.405,1.41,1.412,1.42,1.43,1.435,1.44,w,w,w,w,w,w,w,w,w,w,w,0,0]
#   # s =  fitspectrum(r,(1.34,1.46), 'xGaussian', g)
#    
#    r.plot()
#    for i in s.peaks: plot(s.x,i)
#    plot(s.x,s.y)
#    print s.areas
#    xlim(1.34,1.49)
#    ylim(-0.01,0.1)
    
    a = loadtxt('/home/chris/Dropbox/DataWeiss/151020/MPAexchange on HCN_100eq.csv',skiprows = 1, usecols = (0,1), delimiter = ',', unpack = True)
    r = RamanSpectrum(pandas.Series(a[1],a[0]))
    r.name = ''
    w=1E-5
    a = 0.04
    g = [a,0.05,a,a,a,a,a,a,a,a,a,1.725,1.73,1.738,1.743,1.745,1.75,1.755,1.765,1.77,1.78,1.785,w,w,w,w,w,w,w,w,w,w,w,0,0]
    s =  fitspectrum(r,(1.70,1.80), 'xGaussian', g)
    clf()
    r.plot()
    for i in s.peaks: plot(s.x,i)
    plot(s.x,s.y)
    print s.params[0]
    xlim(1.70,1.80)
    ylim(-0.01,0.1)
    return s.areas
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
Ejemplo n.º 19
0
def RhodBonRaman():
    
    
    os.chdir('/home/chris/Documents/DataWeiss/150228')
    RB1=RamanSpectrum('RhB 500sec 0_01_filter.SPE')
    RB2= RamanSpectrum('RhB 500sec 0_1_filter.SPE')
    RB3=RamanSpectrum('RhB 500sec full power_filter.SPE')
    RBref = RamanSpectrum(pandas.Series.from_csv('/home/chris/Documents/DataWeiss/RhodamineB.csv'))
    RBref.index=pandas.Float64Index(10**7/514.5-10**7/array(RBref.index))
    dark = mean(RamanSpectrum('dark 50 s.SPE'))*10
    
    
    

    RB1/=max(RB1)
    RB1.plot()
    RBref.plot()
    return RBref
    
Ejemplo n.º 20
0
def May20():
    a = RamanSpectrum("/home/chris/Documents/DataWeiss/150520/150520_02.txt")
    #    def xGaussian(x,*guess):
    #        numpeaks = (len(guess)-2)/3
    #        y = guess[-2]*x/1000+guess[-1]
    #        for i in range(numpeaks):
    #            y+= guess[i]*exp(-(x-guess[i+numpeaks])**2/guess[i+2*numpeaks])
    #        return y
    n_guess = [
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        100,
        720,
        790,
        785,
        811,
        820,
        848,
        865,
        885,
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        0,
        600,
    ]

    a.plot()
    b = fitspectrum(a, (700, 908), "xGaussian", n_guess)
    plot(b[1], b[2])
    return 0
Ejemplo n.º 21
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
Ejemplo n.º 22
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
Ejemplo n.º 23
0
def Jan18():### data from trying out the cryostat
    os.chdir('/home/chris/Documents/DataWeiss/150118')
    green = RamanSpectrum('11_phonon long scan.SPE')
    green.plot()
    
    red = RamanSpectrum('12b.SPE')
    s = argmin(abs(red.index-1468))
    print s
    print red.iloc[s-1:s+2]
    red.iloc[s+1:] -= red.iloc[s+1]-red.iloc[s]
   # red = _smooth(red)
    red = autobaseline(red,(131,500),order = 0)
    red = autobaseline(red,(500,950),order= 4)
    red = autobaseline(red,(950,1520),order= 1)
    red.plot()
    
    
    red = RamanSpectrum('13.SPE')
    s = argmin(abs(red.index-942.3))
  
    red.iloc[s+1:] -= red.iloc[s+1]-red.iloc[s]
    #red = _smooth(red)
    red = autobaseline(red,(525,1612),order = 0)
    #red = autobaseline(red,(500,950),order= 4)
    #red = autobaseline(red,(950,1520),order= 1)
    red.plot()
    return 0
Ejemplo n.º 24
0
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
Ejemplo n.º 25
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
Ejemplo n.º 26
0
def May21b():
    clf()
    a = RamanSpectrum("/home/chris/Documents/DataWeiss/150520/150520_02.txt")
    a[:] -= 0.2
    n_guess = [
        0.05,
        0.05,
        0.05,
        0.05,
        0.05,
        0.05,
        0.05,
        1068,
        1100,
        1169,
        1184,
        1204,
        1221,
        1246,
        20,
        20,
        20,
        20,
        20,
        20,
        20,
        0,
        0.21,
    ]

    a.plot(color="k")
    CdODPARef.autobaseline((200, 1700), order=1)
    CdODPARef.plot()

    # b = RamanSpectrum('/home/chris/Documents/DataWeiss/150408/150408_02.txt')
    # b = autobaseline(b,(200,1700),leaveout=(200,300), order = 4)
    # b.plot()
    return 0
Ejemplo n.º 27
0
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
Ejemplo n.º 28
0
def processxymap():
    os.chdir('/home/chris/Documents/DataWeiss/150114')
    averagespectrum = RamanSpectrum('10_maybemap_1.txt')
    
    phononarea = array([])
    fluorescenceat1600=array([])
    fullspectrum = ndarray((1000,))
    for f in os.listdir('.'):
        if '10_maybemap' in f:
            if 'SPE' in f:
                continue
            elif f == 'maybemap_1.txt':
                
                continue
            elif f == 'maybemap.txt':
                
                continue
            
            else:
                r = RamanSpectrum(f)
                phononarea = append(phononarea,r.calc_area((200,230)))
                fluorescenceat1600 = append(fluorescenceat1600,r.values[-1]-min(r.values))
                averagespectrum+=r
    averagespectrum = _smooth(averagespectrum)
    figure()
    subplot(221)
    
    
    hist(fluorescenceat1600,bins=range(0,200,20))
    hist(phononarea,bins=range(0,200,20),color='r')
    xticks(range(0,200,20))
    subplot(223)
    averagespectrum.plot()
                
                
    return phononarea
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 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