collecting the reflected light in a specific range of angles


I’m trying to collect the reflected light(in the farfield) in a specific range of angles, like collecting it in only a small cone instead of a complete sphere, should I use the farfieldexact command? but in this command I can only enter the (x,y,z) position of the plane that I want to calculate the farfield.

Thank you for your help



The farfield3dintegrate script command can be used to integrate the power to a specific cone of angles in the far field. This page includes some examples that could be helpful:



Thank you for your comment. The thing is I know that “farfield3dintegrate” command can be used for PML boundary conditions. But in my simulation I 'm using periodic boundary condition.


If you are using periodic boundaries, then you can use grating calculation script commands instead. The grating calculations are discussed here:

You can use these grating calculations to determine the grating order directions and the power going to each grating order. The Blaze grating example shows this for a 2D case:

And the grating order transmission example shows this for a 3D case (structure which is periodic in 2 directions):

Please take a look and let me know if you have questions about it!