123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- from scattnlay import fieldnlay, scattnlay
- from fieldplot import fieldplot
- import numpy as np
- import cmath
- WL=500
- core_r = 50.0
- epsilon_Ag = 4.0
- index_Ag = np.sqrt(epsilon_Ag)
- nm = 1.0
- x = 2.0*np.pi*np.array([core_r/4.0*3.0, core_r], dtype = np.float64)/WL
- m = np.array((index_Ag, index_Ag), dtype = np.complex128)/nm
- print "x =", x
- print "m =", m
- comment='bulk-Ag-flow'
- WL_units='nm'
- npts = 151
- factor=2.1
- flow_total = 9
- crossplane='XY'
- 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()
|