1. A method of controlling polishing, comprising: polishing a substrate; receiving 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; measuring a sequence of spectra of light from the substrate while the substrate is being polished; generating a sequence of values of the characteristic of the selected spectral feature from the sequence of spectra, the generating including for at least some spectra from the sequence of spectra, generating 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, searching the modified wavelength range for the selected spectral feature, and determining a value of a characteristic of the selected spectral feature; and determining at least one of a polishing endpoint or an adjustment for a polishing rate based on the sequence of values.