########################################################################## # Scriptfile: ap_array.lsf # # Description: This script calculates the transmission # and reflection vs wavelength # for the file ap_array.fsp. It also # creates plots of field profiles. # # Copyright 2012, Lumerical Solutions, Inc. ########################################################################### # calculate the transmission and reflection as a function of wavelength f = getdata("R","f"); lambda = c/f; T = transmission("T"); R = -transmission("R"); plot(lambda*1e9,R,T,R+T,"wavelength (nm)","T and R"); legend("R","T","R+T"); r=100e-9; period=400e-9; plot(lambda*1e9,T/(pi*r^2/period^2),"wavelength (nm)","T (normalized)","T normalized to pi*r^2/unit_cell_area)"); ngold=getfdtdindex("Au (Gold) - CRC",f,min(f),max(f)); plot(c/f*1e6, real(ngold),imag(ngold),"wavelength um"," n, k","index of gold simulated"); legend("n","k"); setplot("x min",c/f(1)*1e6); setplot("x max",c/f(length(f))*1e6); # look at the field profiles recorded at 495 nm, reflected surface E2_r = getelectric("profile_at_675nm_R"); E2_t = getelectric("profile_at_675nm_T"); E2_xz = getelectric("profile_at_675nm_xz_plane"); x = getdata("profile_at_675nm_R","x"); y = getdata("profile_at_675nm_R","y"); z = getdata("profile_at_675nm_xz_plane","z"); image(x*1e6,y*1e6,E2_r,"x (microns)","y (microns)","|E|^2 at reflected surface"); image(x*1e6,y*1e6,E2_t,"x (microns)","y (microns)","|E|^2 at transmitted surface"); image(x*1e6,z*1e6,E2_xz,"x (microns)","z (microns)","|E|^2 at y=0"); setplot("colorbar min",0); setplot("colorbar max",10);