Unlocking the secrets of kernels using near-infrared spectroscopy