Accurate determination of the onset wavelength (λonset) in optical spectroscopy