-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplot_mfss2.py
50 lines (37 loc) · 1.36 KB
/
plot_mfss2.py
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
import matplotlib
#matplotlib.use('PDF')
import matplotlib.pyplot as plt
from mfss_helper import *
import sys
jobdict = {'eqe':['eqe'],'plqy':['plqy'],'both':['eqe','plqy']}
inputfile = sys.argv[1]
jobname,exptfile,jobtyp,disr,Vol,shift,rate_dict,plot_title,plot_label = parse_input(inputfile)
#Vol = Vol**3
rates=get_rates(rate_dict,jobtyp)
jobs = jobdict['both']
exptfileprefix = exptfile.split('_')[0]
print(exptfileprefix)
exptfiles = [exptfileprefix + '_eqe.csv', exptfileprefix + '_plqy.csv']
for i,jobtyp in enumerate(jobs):
if type(exptfiles) == list:
exptfile = exptfiles[i]
else:
raise ValueError('Only one data file supplied, two jobs requested')
expt_x, expt_y, x_min, x_max, ef = read_file(exptfile)
mfss_x, mfss_y, mfss_eea, mfss_eca = mfss(rates,jobtyp,disr,Vol,shift)
if jobtyp == 'eqe':
mfss_y = 100*np.array(mfss_y)
expt_y = 100*np.array(expt_y)
plt.figure()
plt.semilogx(expt_x,expt_y,'.',label="Experiment")
plt.semilogx(mfss_x,mfss_y,label=plot_label)
plt.title(inputfile)
if jobtyp == 'eqe':
plt.xlabel("Current density (mA/cm^2)")
plt.ylabel("External Quantum Efficiency (%)")
if jobtyp == 'plqy':
plt.xlabel("Excitation density (cm^-3)")
plt.ylabel("rel. PLQY")
plt.legend()
plt.show()
#plt.savefig(jobname+'_'+jobtyp+".pdf")