Spectroscope with diffraction grating