Advantageous methodologies are disclosed for embedding periodic patterns in optical waveguide elements such as optical fibers. Polarization independence in an elongated waist region of a coupler can be established by measuring polarization characteristics during fusion and elongation, and controlling the heating and stretching to impart a cross-sectional shape, such as a hybrid dumbbell-ellipsoid produces a polarization insensitive drop wavelength. Alternatively, or additionally, polarization dependence can be minimized by angular deformation of the elements along its light transmissive axis. In addition, an element of relatively low photosensitivity is held in an hydrogen or deuterium environment pressurized to about 1000 to 5000 psi. While the environment is pressurized, a scanning UV beam is transmitted through a photomask and impinges on the coupler waist. In writing the grating, the in-diffused gas is constantly replenished, enabling the grating to grow. Prior to writing the periodic pattern dimensional variations in the element which can affect spectral bandwidth are sensed by writing a test pattern in the element and then locally measuring the spectral properties of the test pattern progressively along the element and adjusting the local level of background index of refraction so that the modal index of refraction is substantially constant, minimizing imperfections in the precision of the wavelength pattern. The scanning writing beam, which can be of substantially larger cross-sectional dimensions than the waveguide element (which may be in the 4-10 micron range) is caused to track on the element despite positional imprecision and temporal shifting by using fluorescence induced in the elements to provide an error signal for positive correction. To apodize the grating in accordance with a selected function, a constant power beam is directed through a rotating half-wave plate and into a polarizing beam splitter, where it is divided into two beams having oppositely varying d.c. amplitude characteristics. One beam is varied by a periodic pattern, and the other beam is free of a periodic pattern. Alternately, a scanner toggles the constant intensity beam between the two beam paths in rapid succession, varying the duty cycle of toggling as the beams scan along the coupler waist to produce the desired apodization profile of the grating.