code for spectrograph control