###################################################################### # Scriptfile: sp_bullseye_analysis.lsf # # Description: # This file should be run after running the sp_bullseye.fsp simulation # file and generates plots of the transmission spectra through the # aperture and the field profile # # Copyright 2016, Lumerical Solutions, Inc. ###################################################################### # Get data from far field analysis group E2far_data=getresult("farfield_unpolarized","E2_far_unpol"); f=E2far_data.f; nf=length(f); ux=E2far_data.ux; uy=E2far_data.uy; na=length(ux); E2far=E2far_data.E2_far; # Plot transmission spectra at various collection angles theta_plot=linspace(0,20,6); ux_plot= sin(theta_plot*pi/180); uy_plot= 0; out_plot=matrix(6,nf); for (i=1:nf) { # interpolate to exact angles out_plot(1:6,i)= interp(pinch(E2far(1:na,1:na,i)) ,ux,uy, ux_plot,uy_plot); } plot(c/f*1e6, transpose(out_plot),"wavelength (um)","Intensity","Transmission at various collection angles"); legend("0","4","8","12","16","20"); # Plot field profile at freq with highest forward transmission # Assume peak intensity is at ux,uy=0 theta = 180/pi*asin(ux); f_max = find( E2far(na/2,na/2,1:nf) == max(E2far(na/2,na/2,1:nf)) ); image(ux,uy,E2far(1:na,1:na,f_max),"","","Far Field Projection","polar"); plot(theta,E2far(1:na,na/2,f_max),"theta","Intensity");