############################################### # script file: blaze_grating.lsf # # Calculates and plots the strengths of # each order for a grating # # Copyright 2010 Lumerical Solutions ############################################### # image the index profile image(getdata("index","x")*1e6, getdata("index","y")*1e6, getdata("index","index_z"), "x (um)", "y (um)","Index profile"); #monitors; select("grating_R"); select("grating_T"); set("make plots",0); runanalysis; m="grating_R"; theta=getdata(m,"theta"); R_grating=getdata(m,"T_grating"); R=getdata(m,"T"); plot(theta,R_grating, "angle (degrees)", "fraction of reflected power", "order strength", "plot points"); ?"Total reflection: " +num2str(R); ?"Reflection to each order: [theta(i), R(i)]"; ?num2str([theta, R_grating]);