thanks for your reply. I didn't get the answer and I still need your help to solve this problem. I tried to follow the second link ''Defining a beam using a pupil function'' but I couldn't. Also, our source is a plane wave, not a gaussian source. Another point, the source in the ''pupil_function_beam.fsp'' file is still has one angle. Is it possible to clarify more please?