Skip to content
Snippets Groups Projects
Commit ea1139a7 authored by Guillaume Demesy's avatar Guillaume Demesy
Browse files

fix postplot names and figures

parent 4aba297b
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@ def dtrap_poy(fname_in,nx,ny):
return np.trapz(temp,y_export2D[0,:]) #[x_export2D,y_export2D,poy_y_grid_re] #
myDir = sys.argv[1]
str_FLAG_TOTAL = myDir[myDir.find('FLAG_TOTAL'):]
intpoyz_tot = abs(dtrap_poy(myDir+'/Poy_tot_gd.pos',50,50))
intpoyz_ref = abs(dtrap_poy(myDir+'/Poy_ref_gd.pos',50,50))
......@@ -44,7 +45,7 @@ Q=np.array(Q)
TOT1 = R1nm.real.sum()+T1nm.real.sum()+Q.sum()
TOT2 = R2nm.real.sum()+T2nm.real.sum()+Q.sum()
if myDir[6:]=='solarcell':
if 'nanowire_solarcell' in myDir:
print('cf pdf')
Nmax=2
tab_lambdas=np.loadtxt(myDir+'/temp_lambda_step.txt',ndmin=2)[:,8]
......@@ -55,26 +56,29 @@ if myDir[6:]=='solarcell':
Ttot = [T1nm[i].real.sum() for i in range(nb_lambdas)]
Abs_rods = Q[-1]
Abs_ITO = Q[0]
Abs_subs = Q[2]+Q[3]+Q[4]+Ttot
Abs_subs = Q[2]+Q[3]+Q[4]+Ttot
TOT = Rtot+Abs_rods+Abs_ITO+Abs_subs
pl.figure()
pl.plot(tab_lambdas,Abs_ITO,label='absorption ITO electrode')
pl.plot(tab_lambdas,Abs_rods,label='absorption in Si rods')
pl.plot(tab_lambdas,Abs_subs,label='absorption in Si subs')
pl.plot(tab_lambdas,Abs_rods,label='absorption in Silicon rods')
pl.plot(tab_lambdas,Abs_subs,label='absorption in Silicon subs')
pl.plot(tab_lambdas,Rtot,label='reflection')
pl.plot(tab_lambdas,TOT,label='total')
pl.legend()
pl.xlabel(r'$\lambda$ [nm]')
pl.ylabel('fraction of incident energy')
pl.savefig('fig_solar_balance.pdf')
elif myDir[6:]=='conv':
print('cf pdf')
elif 'convergence' in myDir:
pl.figure()
data_abs = np.loadtxt(myDir+'/temp-Q_scat.txt',ndmin=2)[:,1]
pl.plot(data_abs[0:int(len(data_abs)/2)],label='linear elements')
pl.plot(data_abs[int(len(data_abs)/2):] ,label='curved elements')
pl.xlabel('N / mesh size=$\lambda_0/N$')
pl.xlabel('Absorption$')
pl.legend()
pl.savefig('fig_convergence_absorption.pdf')
fname = 'fig_convergence_absorption_%s.pdf'%str_FLAG_TOTAL
pl.savefig(fname)
print('cf %s'%fname)
else:
print(colored_i('===> Computed from diffraction efficiencies with tangential components only'))
print(colored_R('Rtot1 = %.9f'%R1nm.real.sum()))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment