In [33]:
# Created 2016, Zack Gainsforth
%pylab inline
import sys, os
import QuickPlot
import matplotlib.pylab as pylab
pylab.rcParams['figure.figsize'] = 8, 6  # that's default image size for this interactive session


Populating the interactive namespace from numpy and matplotlib
/Users/Zack/anaconda/envs/conda35/lib/python3.5/site-packages/IPython/core/magics/pylab.py:161: UserWarning: pylab import has clobbered these variables: ['yscale']
`%matplotlib` prevents importing * from pylab and numpy
  "\n`%matplotlib` prevents importing * from pylab and numpy"

In [57]:
boldlevel=2
yscale=1

# eV, ldosup, ldosdw pdosup pdosdw
Ti_s1 = genfromtxt('Ti128_pdos/Ti128-pdos.pdos_atm#128(TiX)_wfc#1(s)', skip_header=1)
Ti_p2 = genfromtxt('Ti128_pdos/Ti128-pdos.pdos_atm#128(TiX)_wfc#2(p)', skip_header=1)
Ti_s3 = genfromtxt('Ti128_pdos/Ti128-pdos.pdos_atm#128(TiX)_wfc#3(s)', skip_header=1)
Ti_d4 = genfromtxt('Ti128_pdos/Ti128-pdos.pdos_atm#128(TiX)_wfc#4(d)', skip_header=1)
Timag = genfromtxt('Spectrum-Ave-Ti', skip_header=1)
Timag[:,1] /= max(Timag[:,1])



# LDOS
fig,ax = QuickPlot.QuickPlot(Ti_s1[:,0], Ti_s1[:,1], boldlevel=boldlevel, color='blue')
QuickPlot.QuickPlot(Ti_p2[:,0], Ti_p2[:,1], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], Ti_s3[:,1], boldlevel=boldlevel, color='green', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], Ti_d4[:,1], boldlevel=boldlevel, color='black', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s1[:,0], -Ti_s1[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_p2[:,0], -Ti_p2[:,2], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], -Ti_s3[:,2], boldlevel=boldlevel, color='green', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], -Ti_d4[:,2], boldlevel=boldlevel, color='black', figax=(fig,ax),
                   ylim=[-yscale,yscale],
                   xlabel='eV',
                   title='LDOS',
                   legendstrs=['s1', 'p2', 's3', 'd4'])


Out[57]:
(<matplotlib.figure.Figure at 0x10dbce550>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10cf70a58>)

In [44]:
boldlevel=2
yscale=0.4

# LDOS
fig,ax = QuickPlot.QuickPlot(Ti_s1[:,0], Ti_s1[:,3], boldlevel=boldlevel, color='blue')
QuickPlot.QuickPlot(Ti_p2[:,0], Ti_p2[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], Ti_s3[:,3], boldlevel=boldlevel, color='green', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], Ti_d4[:,3], boldlevel=boldlevel, color='black', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s1[:,0], -Ti_s1[:,4], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_p2[:,0], -Ti_p2[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], -Ti_s3[:,4], boldlevel=boldlevel, color='green', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], -Ti_d4[:,4], boldlevel=boldlevel, color='black', figax=(fig,ax),
                   ylim=[-yscale,yscale],
                   xlim=[0,30],
                   xlabel='eV',
                   title='pDOS',
                   legendstrs=['s1', 'p2', 's3', 'd4'])


Out[44]:
(<matplotlib.figure.Figure at 0x11b71ff28>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10df52978>)

In [43]:
TipDOSsum = Ti_s1[:,3] + Ti_s1[:,4] + \
            Ti_p2[:,3] + Ti_p2[:,4] + \
            Ti_s3[:,3] + Ti_s3[:,4] + \
            Ti_d4[:,3] + Ti_d4[:,4]
            
fig,ax = QuickPlot.QuickPlot(Ti_s1[:,0],TipDOSsum, boldlevel=boldlevel, color='blue')


TiLDOSsum = Ti_s1[:,1] + Ti_s1[:,2] + \
            Ti_p2[:,1] + Ti_p2[:,2] + \
            Ti_s3[:,1] + Ti_s3[:,2] + \
            Ti_d4[:,1] + Ti_d4[:,2]
            
QuickPlot.QuickPlot(Ti_s1[:,0], TiLDOSsum, boldlevel=boldlevel, color='red',
                    figax=(fig,ax),
                    legendstrs=['pDOS sum', 'LDOS sum'],
                    ylim=[0,2],
                    xlabel='eV')


Out[43]:
(<matplotlib.figure.Figure at 0x10df52160>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10df3a2b0>)

In [50]:
TipDOSdownsum = Ti_s1[:,4] + \
                Ti_p2[:,4] + \
                Ti_s3[:,4] + \
                Ti_d4[:,4]     

TipDOSupsum =   Ti_s1[:,3] + \
                Ti_p2[:,3] + \
                Ti_s3[:,3] + \
                Ti_d4[:,3]
            

fig,ax = QuickPlot.QuickPlot(Ti_s1[:,0], TipDOSdownsum, boldlevel=boldlevel, color='blue')
QuickPlot.QuickPlot(Ti_s1[:,0], TipDOSupsum, boldlevel=boldlevel, color='red',
                   figax=(fig,ax),
                   legendstrs=['up', 'down'],
                   title='pDOS sum',
                   xlabel='eV',
                   xlim=[0,30])


Out[50]:
(<matplotlib.figure.Figure at 0x10ce80b70>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10ce9ab00>)

In [86]:
fig,ax = QuickPlot.QuickPlot(Timag[:,0]-10.5, Timag[:,1], boldlevel=boldlevel, color='black')
QuickPlot.QuickPlot(Ti_d4[:,0], Ti_d4[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], Ti_d4[:,1], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], -Ti_d4[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_d4[:,0], -Ti_d4[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax),
                   legendstrs=['XAS', 'pDOS', 'LDOS'],
                   legendloc='lower right',
                   title='3d orbital contribution',
                   xlabel='eV',
                   xlim=[-10,30],
                   ylim=[-1,1])


Out[86]:
(<matplotlib.figure.Figure at 0x1162b4ac8>,
 <matplotlib.axes._subplots.AxesSubplot at 0x1162b9438>)

In [88]:
fig,ax = QuickPlot.QuickPlot(Timag[:,0]-10.5, Timag[:,1], boldlevel=boldlevel, color='black')
QuickPlot.QuickPlot(Ti_s3[:,0], Ti_s3[:,1], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], Ti_s3[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], -Ti_s3[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s3[:,0], -Ti_s3[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax),
                   legendstrs=['XAS', 'LDOS', 'pDOS'],
                   legendloc='lower right',
                   title='4s orbital contribution',
                   xlabel='eV',
                   xlim=[-10,30],           
                   ylim=[-1,1])


Out[88]:
(<matplotlib.figure.Figure at 0x11da03f28>,
 <matplotlib.axes._subplots.AxesSubplot at 0x11da2df28>)

In [89]:
fig,ax = QuickPlot.QuickPlot(Timag[:,0]-10.5, Timag[:,1], boldlevel=boldlevel, color='black')
QuickPlot.QuickPlot(Ti_p2[:,0], Ti_p2[:,1], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_p2[:,0], Ti_p2[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_p2[:,0], -Ti_p2[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_p2[:,0], -Ti_p2[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax),
                   legendstrs=['XAS', 'LDOS', 'pDOS'],
                   legendloc='lower right',
                   title='3p orbital contribution',
                   xlabel='eV',
                   xlim=[-10,30],           
                   ylim=[-1,1])


Out[89]:
(<matplotlib.figure.Figure at 0x119f6c5f8>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10d7ec6a0>)

In [67]:
fig,ax = QuickPlot.QuickPlot(Timag[:,0], Timag[:,1], boldlevel=boldlevel, color='black')
QuickPlot.QuickPlot(Ti_s1[:,0], Ti_s1[:,1], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s1[:,0], Ti_s1[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s1[:,0], -Ti_s1[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(Ti_s1[:,0], -Ti_s1[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax),
                   legendstrs=['XAS', 'LDOS', 'pDOS'],
                   legendloc='lower right',
                   title='3s orbital contribution',
                   xlabel='eV',
                   xlim=[0,30],           
                   ylim=[-1,1])


Out[67]:
(<matplotlib.figure.Figure at 0x10cdcd320>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10cdd7be0>)

In [80]:
pdostot = genfromtxt('Ti128_pdos/Ti128-pdos.pdos_tot', skip_header=1)

fig,ax = QuickPlot.QuickPlot(Timag[:,0]-10.5, Timag[:,1]*40, boldlevel=boldlevel, color='black')
QuickPlot.QuickPlot(pdostot[:,0], pdostot[:,1], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(pdostot[:,0], pdostot[:,3], boldlevel=boldlevel, color='red', figax=(fig,ax))

QuickPlot.QuickPlot(pdostot[:,0], -pdostot[:,2], boldlevel=boldlevel, color='blue', figax=(fig,ax))
QuickPlot.QuickPlot(pdostot[:,0], -pdostot[:,4], boldlevel=boldlevel, color='red', figax=(fig,ax),                   legendstrs=['XAS', 'LDOS', 'pDOS'],
                   legendloc='lower right',
                   title='3s orbital contribution',
                   xlabel='eV',
                   xlim=[0,30])


Out[80]:
(<matplotlib.figure.Figure at 0x10d44b128>,
 <matplotlib.axes._subplots.AxesSubplot at 0x10432acc0>)

In [ ]: