123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164 |
- import scattnlay
- from scattnlay import fieldnlay
- from scattnlay import scattnlay
- import numpy as np
- import cmath
- from fieldplot import fieldplot
- def SetXM(design):
- """ design value:
- 1: AgSi - a1
- 2: SiAgSi - a1, b1
- 3: SiAgSi - a1, b2
- """
- epsilon_Si = 18.4631066585 + 0.6259727805j
- epsilon_Ag = -8.5014154589 + 0.7585845411j
- index_Si = np.sqrt(epsilon_Si)
- index_Ag = np.sqrt(epsilon_Ag)
- isSiAgSi=True
- isBulk = False
- if design==1:
-
- isSiAgSi=False
- WL=500
- core_width = 0.0
- inner_width = 31.93
- outer_width = 4.06
- elif design==2:
-
- WL=500
- core_width = 29.44
- inner_width = 10.33
- outer_width = 22.73
- elif design == 3:
-
- WL=500
- core_width = 5.27
- inner_width = 8.22
- outer_width = 67.91
- elif design==4:
- WL=800
- epsilon_Si = 13.64 + 0.047j
- epsilon_Ag = -28.05 + 1.525j
- core_width = 17.74
- inner_width = 23.31
- outer_width = 22.95
- elif design==5:
- WL=354
- core_r = WL/20.0
- epsilon_Ag = -2.0 + 0.28j
- index_Ag = np.sqrt(epsilon_Ag)
- x = np.array([2.0*np.pi*core_r/WL], dtype = np.float64)
- m = np.array((index_Ag), dtype = np.complex128)
- return x, m, WL
- elif design==6:
- WL=1052
- core_r = 140.0
-
- core_r = 204.2
- epsilon_Si = 12.7294053067+0.000835315166667j
- index_Si = np.sqrt(epsilon_Si)
- x = np.array([2.0*np.pi*core_r/WL], dtype = np.float64)
- m = np.array((index_Si), dtype = np.complex128)
- return x, m, WL
- core_r = core_width
- inner_r = core_r+inner_width
- outer_r = inner_r+outer_width
- nm = 1.0
- if isSiAgSi:
- x = 2.0*np.pi*np.array([core_r, inner_r, outer_r], dtype = np.float64)/WL
- m = np.array((index_Si, index_Ag, index_Si), dtype = np.complex128)/nm
- else:
-
- x = 2.0*np.pi*np.array([inner_r, outer_r], dtype = np.float64)/WL
- m = np.array((index_Ag, index_Si), dtype = np.complex128)/nm
- return x, m, WL
- design = 6
- comment='Si-flow'
- x, m, WL = SetXM(design)
- WL_units='nm'
- print "x =", x
- print "m =", m
- npts = 501
- factor=2.1
- flow_total = 39
- crossplane='XYZ'
- field_to_plot='Eabs'
- 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)
- 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()
|