In-situ spectrometer