123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127 |
- import scattnlay
- from scattnlay import fieldnlay
- from scattnlay import scattnlay
- from fieldplot import fieldplot
- import numpy as np
- import cmath
- epsilon_Si = 13.64 + 0.047j
- epsilon_Ag = -28.05 + 1.525j
- index_Si = np.sqrt(epsilon_Si)
- index_Ag = np.sqrt(epsilon_Ag)
- print(index_Si)
- print(index_Ag)
- WL=800
- core_width = 17.74
- inner_width = 23.31
- outer_width = 22.95
- core_r = core_width
- inner_r = core_r+inner_width
- outer_r = inner_r+outer_width
- nm = 1.0
- x = np.ones((3), dtype = np.float64)
- x[0] = 2.0*np.pi*core_r/WL
- x[1] = 2.0*np.pi*inner_r/WL
- x[2] = 2.0*np.pi*outer_r/WL
- m = np.ones((3), dtype = np.complex128)
- m[0] = index_Si/nm
- m[1] = index_Ag/nm
- m[2] = index_Si/nm
- print "x =", x
- print "m =", m
- npts = 501
- factor=2.2
- flow_total = 21
- crossplane='XZ'
- field_to_plot='Eabs'
- comment='SiAgSi-absorber-flow'
- WL_units='nm'
- import matplotlib.pyplot as plt
- fig, axs = plt.subplots(1,1)
- fig.tight_layout()
- fieldplot(fig, axs, x,m, WL, comment, WL_units, crossplane, field_to_plot, npts, factor, flow_total,
- subplot_label=' ',is_flow_extend=False, outline_width=1.5)
- fig.subplots_adjust(hspace=0.3, wspace=-0.1)
- plt.savefig(comment+"-R"+str(int(round(x[-1]*WL/2.0/np.pi)))+"-"+crossplane+"-"
- +field_to_plot+".pdf",pad_inches=0.02, bbox_inches='tight')
- plt.draw()
- plt.clf()
- plt.close()
|