########################################################################### # Scriptfile: fresnel1.lsf # # Description: This file analyses the data in fresnel1.fsp # # # Copyright 2008, Lumerical Solutions, Inc. ########################################################################### # get the index data and image the lens shape x = getdata("index","x"); y = getdata("index","y"); n = getdata("index","index_z"); image(x*1e3,y*1e6,real(n),"x (mm)","y (microns"); # get the near E field. Plot the amplitude and phase Ez = getdata("T","Ez"); x = getdata("T","x"); plot(x*1e3,abs(Ez),"x (mm)","|Ez|"); phase = unwrap(angle(Ez))*180/pi; phase = phase - phase(find(x,0)); plot(x*1e3,phase,"x (mm)","angle(Ez) (degrees)"); # do a far field projection onto a 2D surface to find the focal distance n_projection = 1.0; # air x1 = linspace(-2.5e-3,2.5e-3,51); y1 = linspace(-100e-3,-300e-3,51); Efar = farfieldexact2d("T",x1,y1,1,n_projection); Efar = sum(abs(Efar),3); image(x1*1e3,y1*1e3,Efar,"x (mm)","y (mm)"); plot(y1*1e3,Efar(find(x1,0),1:length(y1)),"y (mm)","|E|^2"); # calculate |E|^2 vs x for a high resolution plot at the focal plane x2 = linspace(-2.5e-3,2.5e-3,1000); y2 = -200e-3; Efar2 = farfieldexact2d("T",x2,y2,1,n_projection); Efar2 = sum(abs(Efar2),3); plot(x2*1e3,Efar2,"x (mm)","|E|^2 at focal plane");