######################################################### # file: plasmon_plot.lsf # # Description: # This file will plot various field components of # the mode, for comparison with the berini paper # # Copyright 2003-2013, Lumerical Solutions, Inc. ######################################################### closeall; # close any existing figure windows m="MODE::data::mode1"; # mode name phase =0; # phase shift in degrees, use 180 to match berini phase=exp(1i*phase*pi/180); # get required data E = getresult(m,'E'); H = getresult(m,'H'); x = E.x; y = E.y; Ex=E.Ex*phase; Ey=E.Ey*phase; Ez=E.Ez*phase; Hx=H.Hx*phase; Hy=H.Hy*phase; Hz=H.Hz*phase; E2=E.E2; # create field component plots image(x*1e6,y*1e6,real(Ex),"x (um)","y (um)","Re(Ex)"); setplot("colorbar max",5e-2); setplot("colorbar min",-5e-2); image(x*1e6,y*1e6,real(Ey),"x (um)","y (um)","Re(Ey)"); setplot("colorbar max",.5); setplot("colorbar min",-.22); image(x*1e6,y*1e6,imag(Ez),"x (um)","y (um)","Im(Ez)"); setplot("colorbar max",5e-2); setplot("colorbar min",-5e-2); image(x*1e6,y*1e6,real(Hx),"x (um)","y (um)","Re(Hx)"); image(x*1e6,y*1e6,real(Hy),"x (um)","y (um)","Re(Hy)"); image(x*1e6,y*1e6,imag(Hz),"x (um)","y (um)","Im(Hz)"); image(x*1e6,y*1e6,E2,"x (um)","y (um)","E^2"); setplot("colorbar max",1e-2); setplot("colorbar min",0); image(x*1e6,y*1e6,E2,"x (um)","y (um)","E^2");#amplified setplot("colorbar max",1.e-2); setplot("colorbar min",0); setplot("x max",.55); setplot("x min",.45); setplot("y max",.1); setplot("y min",0); # create line plots along surfaces xi=find(x,500e-9); yi=find(y,50e-9); plot(x*1e6,log10(E2(1:length(x),yi)),"x (um)","log10(E^2)","line plot at y=50nm"); plot(y*1e6, log10(E2(xi,1:length(y))),"y (um)","log10(E^2)","line plot at x=500nm");