The interference refractometer is potentially a valuable instrument for the measurement of gas concentrations, but its usefulness has been limited by the necessity to locate visually a pattern of light and dark bands in order to obtain the reading. The instrument is therefore liable to human error and is unsuitable for continuous monitoring. An improved design has been patented, in which this location process is automated by the use of a microprocessor and an array of light-sensitive diodes. To implement this improvement it was necessary to design an algorithm which would reliably locate the pattern. This paper describes the approaches which were considered and the successful algorithm. Some examples are given to illustrate the power of the final algorithm to locate patterns even after severe distortion.