##################################################################### # FDTD_sweep_plot_results.lsf # # Collects sweep results from GPW.fsp simulation file and plots # results. Also generates a plot comparing results with results from # MODE Solutions' end fire coupling simulations if data file is # present. # # Copyright 2016 Lumerical Solutions Inc. ##################################################################### # collect results from beam_position sweep and plot coupling efficiency beam_position=1; if (beam_position) { # plot results from parameter sweep beam_center_x=getsweepdata("beam_position","beam_center"); T=getsweepdata("beam_position","T"); plot(beam_center_x*1e9,T*100,"Beam position (nm)","Power (%)"); } # collect results from NA sweep and plot coupling efficiency NA_sweep=1; if (NA_sweep) { # plot results from parameter sweep NA=getsweepdata("NA","NA"); T=getsweepdata("NA","T"); plot(NA,T*100,"NA","Power (%)"); # save data to file, for comparison with MODE results FDTD_trans_vs_NA=T; FDTD_NA=NA; savedata("FDTD_transmission_vs_NA",FDTD_NA,FDTD_trans_vs_NA); } # if data file generated from MODE Solutions simulation of end fire coupling # is present, compare coupling efficiency with vertical coupling result compare_MODE_FDTD = fileexists("FDTD_transmission_vs_NA.ldf") & fileexists("MODE_transmission_vs_NA.ldf") ; if (compare_MODE_FDTD) { loaddata("FDTD_transmission_vs_NA"); loaddata("MODE_transmission_vs_NA"); plotxy(MODE_NA,100*MODE_trans_vs_NA,FDTD_NA,100*FDTD_trans_vs_NA,"NA","Power (%)"); legend("endfire coupling","vertical coupling"); } else { ?"Compare coupling efficiency skipped. Data files missing."; }