########################################################################### # Scriptfile: profile_data_extract.lsf # # Description: # This file will extract field profile and write it to fld file. # The fld file will be imported into a custom soruce set in transducer.fsp # # Copyright 2012, Lumerical Solutions, Inc. ########################################################################### z_expanded=getresult("taper_output","E, H, P expanded along z"); ze_E=pinch(z_expanded.E); xx=pinch(z_expanded.x); yy=pinch(z_expanded.y); zz=pinch(z_expanded.z); # x <= yy, y <= zz, z <= xx x=yy; y=zz; Ex=pinch(ze_E(1:length(yy),1:length(zz),2)); Ey=pinch(ze_E(1:length(yy),1:length(zz),3)); Ez=pinch(ze_E(1:length(yy),1:length(zz),1)); lambda = 650e-9; refractive_index = 1; z = 0; # this is z z-normal source # now we creat a 2d surface X = meshgridx(x,y); Y = meshgridy(x,y); # don't modify the following commands dx = x(2)-x(1); dy = y(2)-y(1); # fill in the variables needed for createsource.lsf include_H = 0; # 1: H fields are defined, 0: H fields defined from E fields wavelength = lambda; power = 1; index = refractive_index; # x <= yy, y <= zz, z <= xx axis1 = 2; # x axis axis2 = 3; # y axis min1 = x(1)-dx/2; max1 = x(length(x)) + dx/2; min2 = y(1)-dy/2; max2 = y(length(y)) + dy/2; depth = z; n1 = length(x); n2 = length(y); sourcefilename = "td_sourcefile"; #create the source by calling td_usr_create_fld.lsf td_usr_create_fld;