Functions to preprocess spectroscopic data and conduct (representative) sample selection/calibration sampling.