# Ideal binary grating

Hi,

in order to learn more about Lumerical FDTD, I’ve chosen a very simple example with an analytical solution: a binary square-wave grating.

Theory says that this kind of grating has only odd number transmission orders for normal illumination. So far, I think I have managed to do well and now I can see n=+/-1 orders. Also I have managed to do a surface plot in the way I need it:
image(th,f,Pz) # where th is the angle over the x-axis of the monitor, f is frequency and Pz is the z-component of the Poynting vector.

Now I want to do this same plot for the far-field. I cannot make it 2D, since later I plan to break the symmetry. Can you please tell me which commands I need to obtain a matrix such as Pz for the far-field?

At the end of this post, you can find attached my model along with the script I’m using to plot the results.