Computer-controlled programmable monochromator with repetitive optical scanner for accurate peak detection and background correction