diff --git a/DiffractionGratings/grating3D_data_half_ellipsoid.geo b/DiffractionGratings/grating3D_data_half_ellipsoid.geo
index 07906f9a4a7e90110c3362b25b98dbc1f7e359ef..12f3e2a5d64aa8190d4f22fa045371561cb9e520 100644
--- a/DiffractionGratings/grating3D_data_half_ellipsoid.geo
+++ b/DiffractionGratings/grating3D_data_half_ellipsoid.geo
@@ -11,8 +11,8 @@ DefineConstant[
     thetadeg      = {40   , Name StrCat[pp1,"/2theta0 [deg]"]},
     phideg        = {36   , Name StrCat[pp1,"/3phi0 [deg]"]},
     psideg        = {72   , Name StrCat[pp1,"/4psi0 [deg]"]},
-    period_x      = {250  , Name StrCat[pp2,"/1X period [nm]"]},
-    period_y      = {250  , Name StrCat[pp2,"/2Y period [nm]"]},
+    period_x      = {473  , Name StrCat[pp2,"/1X period [nm]"]},
+    period_y      = {322  , Name StrCat[pp2,"/2Y period [nm]"]},
     thick_L_1     = {50   , Name StrCat[pp2,"/3thickness layer 1 [nm] (superstrate)"]},
     thick_L_2     = {50   , Name StrCat[pp2,"/4thickness layer 2 [nm]"]},
     thick_L_3     = {100  , Name StrCat[pp2,"/5thickness layer 3 [nm]"]},
@@ -25,16 +25,16 @@ DefineConstant[
     rx            = {107  , Name StrCat[pp3,"/1rx"]},
     ry            = {47   , Name StrCat[pp3,"/2ry"]},
     rz            = {40   , Name StrCat[pp3,"/3rz"]},
-    flag_mat_scat = { 0   , Name StrCat[pp3,"/4Scatterer permittivity model"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
+    flag_mat_scat = { 4   , Name StrCat[pp3,"/4Scatterer permittivity model"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
     eps_re_Scat   = {-2.23, Name StrCat[pp3,"/7eps_re_Scat"]},
     eps_im_Scat   = { 3.89, Name StrCat[pp3,"/8eps_im_Scat"]},
 
     flag_mat_1    = { 0    , Name StrCat[pp4,"/1Layer 1"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
     flag_mat_2    = { 0    , Name StrCat[pp4,"/2Layer 2"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
     flag_mat_3    = { 0    , Name StrCat[pp4,"/3Layer 3"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
-    flag_mat_4    = { 0    , Name StrCat[pp4,"/4Layer 4"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
-    flag_mat_5    = { 0    , Name StrCat[pp4,"/5Layer 5"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
-    flag_mat_6    = { 0    , Name StrCat[pp4,"/6Layer 6"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
+    flag_mat_4    = { 1    , Name StrCat[pp4,"/4Layer 4"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
+    flag_mat_5    = { 1    , Name StrCat[pp4,"/5Layer 5"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
+    flag_mat_6    = { 1    , Name StrCat[pp4,"/6Layer 6"], Choices {0="Custom (Value Below)",1="SiO2",2="Ag (palik)",3="Al (palik)",4="Au (johnson)",5="Nb2O5",6="ZnSe",7="MgF2",8="TiO2",9="PMMA",10="Si",11="ITO",12="Cu (palik)"} },
     eps_re_L_1    = {1    , Name StrCat[pp4,"/layer 1: real part of relative permittivity"]},
     eps_im_L_1    = {0    , Name StrCat[pp4,"/layer 1: imag part of relative permittivity"]},
     eps_re_L_2    = {1    , Name StrCat[pp4,"/layer 2: real part of relative permittivity"]},
diff --git a/DiffractionGratings/grating3D_postplot_Mmatrix.py b/DiffractionGratings/grating3D_postplot_Mmatrix.py
index d3a0975feec718638789c90e8893e50e80e73ebd..e224f275fb73d3b4ab5e6b8a693b4c4f5a0c1c98 100644
--- a/DiffractionGratings/grating3D_postplot_Mmatrix.py
+++ b/DiffractionGratings/grating3D_postplot_Mmatrix.py
@@ -1,6 +1,7 @@
 import numpy as np
 import matplotlib.pyplot as plt
 import matplotlib as mpl
+import scipy.constants as scc
 plt.rcParams.update({"text.usetex": True, "font.family": "serif"})
 
 def add_colorbar(mappable):
@@ -22,10 +23,10 @@ def load_getdp_integral(fname):
     else:
         return temp[:,1]+1j*temp[:,2]
 
-nb_lam = 200
+nb_lam = 100
 nb_phi = 60
 FLAG_TOT = 0
-respath  = 'res_Matrix_nb_lam200_nb_phi59_total0/'
+respath  = 'res_Matrix_nb_lam100_nb_phi59_total0/'
 rpp = np.zeros((nb_lam,nb_phi),dtype=complex)
 rps = np.zeros((nb_lam,nb_phi),dtype=complex)
 rsp = np.zeros((nb_lam,nb_phi),dtype=complex)
@@ -44,6 +45,7 @@ Qscat_sin = np.zeros((nb_lam,nb_phi))
 
 tab_lam = np.linspace(350,1600,nb_lam)
 tab_phi = np.linspace(0,360,nb_phi)
+tab_hnu = 2*scc.pi*scc.c/(tab_lam*1e-9/scc.hbar*scc.eV)
 M = np.zeros((4,4,len(tab_lam),len(tab_phi)),dtype=complex)
 
 
@@ -138,15 +140,16 @@ for form in range(2):
 plt.savefig('BALANCE_FLAG_TOT%g.jpg'%FLAG_TOT)
 
 fig, axes = plt.subplots(4, 4, subplot_kw=dict(projection='polar') ,figsize=(12,12))
-flag_lam = True
-rlabel =  r"$\lambda_0$ (nm)"
-which_r =  tab_lam
+flag_lam = False
+rlabel = r"$\hbar \nu$" if not flag_lam else r"$\lambda_0$"
+which_r = tab_hnu if not flag_lam else tab_lam
 which_orig = 0  #if not flag_lam else 350
 for i in range(4):
     for j in range(4):
         ax=axes[i,j]
         if i!=0 or j!=0:
-            sm=ax.contourf(tab_phi*np.pi/180,which_r,M[i,j]/M[0,0],cmap=plt.cm.bwr,levels=30)
+            sm=ax.contourf(tab_phi*np.pi/180,which_r,M[i,j]/M[0,0],cmap=plt.cm.bwr,levels=30,vmin=-1,vmax=1)
+            # sm=ax.contourf(tab_phi*np.pi/180,which_r,M[i,j]/M[0,0],cmap=plt.cm.bwr,levels=30)
             ax.text(0. , 1. , r"$M_{%d%d}$"%(i+1,j+1) , fontsize=16 , transform=ax.transAxes)
             ax.set_xticks([])
             ax.set_yticks([])