-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgv-DOSWeighted.py
More file actions
58 lines (51 loc) · 1.62 KB
/
gv-DOSWeighted.py
File metadata and controls
58 lines (51 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#########################################
#this code study the k gv[x] lifetime versue omeg scat_combine_bands_DOSW_addk.py
#########################################
import matplotlib.pyplot as plt
import matplotlib.pylab as pylab
import numpy as np
import math as m
import os
import sys
lib_path = os.path.abspath(os.path.join('./config'))
sys.path.append(lib_path)
import configPlot
import config
params = configPlot.params
pylab.rcParams.update(params)
case = sys.argv
if case[1] == '211cell':
configs = config.configs211cellGv
elif case[1] == '421cell':
configs = config.configs421cellGv
else:
configs = config.configs211cellGv
print('请输入2cell或者421cell,默认为2cell')
pathFile = configs['pathFile']
path_list=configs['path_list']
case_name_list=configs['case_name_list']
case_colors = configs['case_colors']
lineList=configs['line']
linewidthList=configs['linewidth']
ax_g = plt.subplot(1,1,1)
for i in range(len(path_list)):
path=path_list[i]
case_name=case_name_list[i]
color=case_colors[i]
line=lineList[i]
linewidth=linewidthList[i]
omega=np.loadtxt(path+'simplifiedOmega')
gv=np.loadtxt(path+'dosWeighedGv')
omegaTHZ=[x/(2*m.pi) for x in omega]
###########
# plot part
###########
ax_g.plot(omegaTHZ,gv,line ,color=color,linewidth=linewidth,label=case_name)
ax_g.legend(loc=0)
ax_g.set_xlim(0, 15.7)
# ax_g.set_ylim(-200, 1000)
ax_g.set_xticks([0, 5, 10, 15])
# ax_g.set_yticks([200])
ax_g.set_xlabel('Frequency' +'(THz)')
ax_g.set_ylabel('Group velocity' + ' <'+r'$v_g^2$'+'> '+'('+r'$ \mathrm{km}^2/ \mathrm{s}^2$'+')')
plt.savefig(pathFile + '/gv.png', bbox_inches='tight')