-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathplot_data_statistics.py
More file actions
33 lines (23 loc) · 872 Bytes
/
Copy pathplot_data_statistics.py
File metadata and controls
33 lines (23 loc) · 872 Bytes
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
from read_json import *
import sys
from pylab import *
import numpy as np
mset = read_json(sys.argv[1])
volerror = []
for atoms in mset:
if atoms.exptvol is not None:
volerror.append((atoms.calcvol - atoms.exptvol) / atoms.exptvol * 100)
print np.mean(volerror), np.min(volerror), np.max(volerror)
fig = figure(figsize=(7.5,5.2))
hist(volerror, 50)
xlabel("Error in calculated volume [%]", fontsize=18)
ylabel("Number of ICSD entries", fontsize=18)
savefig('volume_error.pdf', bbox_inches='tight')
#################################################
Eref = attribute_tolist(mset, attr="Eref")
fig = figure(figsize=(7.5,5.2))
hist(Eref, 50)
xlabel("Cohesive Energy [eV]", fontsize=18)
ylabel("Number of ICSD entries", fontsize=18)
savefig('hist_Ecoh.pdf', bbox_inches='tight')
#show()