Some of you (Buse, Seward and Moy), have reported to me at one time or another that something wasn't being calculated correctly when a sample contained duplicate elements where the duplicate elements consisted of different x-rays. For example, Fe Ka and Fe Ll in the same sample.
Normal samples and even samples with duplicate elements work fine when those duplicate elements have the same x-ray, for example 3 spectrometers tuned to Ti Ka. But when the duplicate elements have different x-rays (or keVs), I found myself tweaking this and that in order to get the std k-factor loading code to work properly. The problem is due to the fact that when one has duplicate elements in the sample, you don't want to the matrix correction using std k-factors where the element concentration was duplicated in the standard.
This weekend I decided to "grab the bull by the horns", are re-write the std k-factors loading code to clean things up and deal with this properly. I first cleaned up the normal sample code by loading the sample parameters and then applying any missing elements from the standard database. I then added each element concentration in, but only once for a proper std k-factor calculation. Duplicate elements with the same x-ray are automatically handled because they've already been calculated!
For samples with duplicate elements with different x-rays (or keVs), I wrote entirely new code that loads the sample, then converts all elements to non-analyzed elements, then loops through each analyzed element in the sample one at a time, and loads first the standard concentrations that are not the current element, then loads just the concentration for that specific element, and the actual x-ray (and keV) for that element.
That way we can calculate std k-factors for any combination of elements, x-rays and keVs, but at the cost of calling the physics routines several times. Because this method is a little slower, I kept the code for normal samples in there.
https://github.com/openmicroanalysis/calczafI'm going to try some tests, for example Au La and Au Ma in the NIST Au-Cu standards, next week myself, but please contact me if you have any questions.
john