The design of optical spectrometers