Diffraction grating illuminated by partially coherent beam