A method of writing a diffraction grating into a photosensitive optical
transmission medium is disclosed, in which a first phase mask is used to
generate an interference pattern in a second phase mask substrate and
using photolithographic techniques. This produces a second phase mask,
which is then use to write a diffraction grating into a photosensitive
optical transmission medium. This method enables the line placement in a
phase mask to be improved by averaging out the line placement errors.