1. A computer program product, tangibly embodied in a machine readable storage device, comprising instructions for causing a processor to: receive an identification of a selected spectral feature, a wavelength range having a width, and a characteristic of the selected spectral feature to monitor during polishing; receive a sequence of spectra of light from a substrate while the substrate is being polished; generate a sequence of values of the characteristic of the selected spectral feature from the sequence of spectra, wherein the instructions to generate the sequence of values include instructions to, for at least some spectra from the sequence of spectra, generate a modified wavelength range based on a position of the spectral feature within a previous wavelength range used for a previous spectrum in the sequence of spectra, search the modified wavelength range for the selected spectral feature, and determine a value of the characteristic of the selected spectral feature; and determine at least one of a polishing endpoint or an adjustment for a polishing rate based on the sequence of values.