Abstract: A temperature-compensated optical grating is fed an optical probe signal of a predetermined wavelength. An optical detector having a plurality of apertures for receiving an optical signal is positioned to detect a probe light signal from the grating and to detect the deflection of the probe light signal from a preferred location. The detector provides an indication of the deflection to a controller which operates a temperature adjustment device, such as a fan or thermoelectric cooler to adjust the temperature of the grating in a direction which reduces the deflection.