Skip to content

Commit d6be2ab

Browse files
author
Meng Wu
committed
jdos.py
1 parent d05cd6e commit d6be2ab

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

jdos.py

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env python
2+
import numpy as np
3+
import io
4+
import os
5+
import sys
6+
7+
omega_threshold=4.09;
8+
file=io.open("./jdos_Si.dat","rb");
9+
rawdata=np.genfromtxt(file,comments='#');
10+
omega=np.zeros((len(rawdata)),dtype='float');
11+
jdos=np.zeros((len(rawdata)),dtype='float');
12+
omega[:]=rawdata[:,0]
13+
jdos[:]=rawdata[:,1]
14+
file.close()
15+
16+
omega_threshold_position=np.ravel(np.where(omega[:]==omega_threshold))[0];
17+
print("omega_threshold_position = ", omega_threshold_position)
18+
19+
# manually calculate the integral by summation \sum w_i eps_2(w_i) Delta w_i
20+
area=np.trapz(jdos[0:omega_threshold_position+1],omega[0:omega_threshold_position+1]);
21+
print("area = ", area);

0 commit comments

Comments
 (0)