1. A method, comprising: measuring spectral information for a sample with a measurement system and determining, based on the measured spectral information, probabilities that the sample corresponds to each of a plurality of candidates in a library of reference information; determining, based on the probabilities, whether sample identity information can be obtained by comparing the measured spectral information to the reference information; when the sample identity information cannot be obtained, adjusting a characteristic of the measurement system to increase a magnitude of one of the probabilities relative to the other probabilities, and repeating the steps of measuring spectral information, determining the probabilities, and determining whether the sample identity information can be obtained, until the sample identity information can be obtained; and using an electronic processor to compare the measured spectral information to the reference information to determine the sample identity information.