Coherence changes in partially coherent beams transmitted by metal gratings