39. A system, comprising: a radiation source configured to direct incident radiation to a sample; a detector configured to measure radiation from the sample; and an electronic processor configured to: determine spectral information for the sample from the measured radiation; determine, based on the spectral information, probabilities that the sample corresponds to each of a plurality of candidates in a library of reference information; determine, 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, adjust a characteristic of the system to increase a magnitude of one of the probabilities relative to the other probabilities, and repeat the steps of measuring radiation, determining spectral information, determining the probabilities, and determining whether sample identity information can be obtained, until the sample identity information can be obtained; and compare the spectral information to the reference information to determine the sample identity information.
39. A system, comprising: a radiation source configured to direct incident radiation to a sample; a detector configured to measure radiation from the sample; and an electronic processor configured to: determine spectral information for the sample from the measured radiation; determine, based on the spectral information, probabilities that the sample corresponds to each of a plurality of candidates in a library of reference information; determine, 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, adjust a characteristic of the system to increase a magnitude of one of the probabilities relative to the other probabilities, and repeat the steps of measuring radiation, determining spectral information, determining the probabilities, and determining whether sample identity information can be obtained, until the sample identity information can be obtained; and compare the spectral information to the reference information to determine the sample identity information. 46. The system of claim 39 , wherein the characteristic of the system comprises at least one of a temperature of the detector, a gain of the detector, and a position of the detector relative to a position of the sample.