From 4e2c28e8735a1f47660ae91b1b812ec6cfa43a9f Mon Sep 17 00:00:00 2001 From: Guillaume Demesy <guillaume.demesy@fresnel.fr> Date: Mon, 18 Nov 2019 13:11:23 +0100 Subject: [PATCH] postpro python --- DiffractionGratings/grating3D.pro | 8 ++++---- DiffractionGratings/grating3D_postplot.py | 11 +++++++++++ 2 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 DiffractionGratings/grating3D_postplot.py diff --git a/DiffractionGratings/grating3D.pro b/DiffractionGratings/grating3D.pro index d48a532..b3bbc00 100644 --- a/DiffractionGratings/grating3D.pro +++ b/DiffractionGratings/grating3D.pro @@ -392,10 +392,10 @@ PostOperation { EndIf EndIf // // For DEBUG - // Print [ epsr_xx , OnElementsOf Omega, File StrCat[myDir,"epsr_xx.pos"]; - // Print [ Ecm , OnElementsOf Omega_plot, File StrCat[myDir,"Ecm.pos"]; - // Print [ E1, OnElementsOf Omega_plot, File StrCat[myDir,"E1.pos"]; - // Print [ Damp_pml_top, OnElementsOf PMLtop, File StrCat[myDir,"Damp_pml_top.pos"]; + Print [ epsr_xx , OnElementsOf Omega, File StrCat[myDir,"epsr_xx.pos"]]; + // Print [ Ecm , OnElementsOf Omega_plot, File StrCat[myDir,"Ecm.pos"]]; + // Print [ E1, OnElementsOf Omega_plot, File StrCat[myDir,"E1.pos"]]; + // Print [ Damp_pml_top, OnElementsOf PMLtop, File StrCat[myDir,"Damp_pml_top.pos"]]; // For i In {0:nb_slice-1} // Print [ Etot , OnPlane { {-period_x/2+small_delta,-period_y/2+small_delta,zcut_sub~{i}} {-period_x/2+small_delta,period_y/2-small_delta,zcut_sub~{i}} {period_x/2-small_delta,-period_y/2+small_delta,zcut_sub~{i}} } {ninterv_integ,ninterv_integ} , File StrCat[myDir,> "./Views/Etot_XYcut.out",Format Table]; // Print [ Edif , OnPlane { {-period_x/2+small_delta,-period_y/2+small_delta,zcut_sup~{i}} {-period_x/2+small_delta,period_y/2-small_delta,zcut_sup~{i}} {period_x/2-small_delta,-period_y/2+small_delta,zcut_sup~{i}} } {ninterv_integ,ninterv_integ} , File StrCat[myDir,> "./Views/Edif_XYcut.out",Format Table]; diff --git a/DiffractionGratings/grating3D_postplot.py b/DiffractionGratings/grating3D_postplot.py new file mode 100644 index 0000000..8b362aa --- /dev/null +++ b/DiffractionGratings/grating3D_postplot.py @@ -0,0 +1,11 @@ +import numpy as np +Rnm = np.loadtxt('eff_r.txt')[:,1] +Tnm = np.loadtxt('eff_t.txt')[:,1] +Q = [np.loadtxt('temp-Q_L_%g.txt'%k)[1] for k in range(2,7)] +Q.append(np.loadtxt('temp-Q_scat.txt')[1]) +Q=np.array(Q) +TOT = Rnm.sum()+Tnm.sum()+Q.sum() +print('Rtot',Rnm.sum()) +print('Ttot',Tnm.sum()) +print('Atot',Q.sum()) +print('TOT ',TOT) \ No newline at end of file -- GitLab