monochromator code