Bug fix. The excitation energy for our offline XPS is wrong in the xy files. Set it to 1253.6 eV during import

This commit is contained in:
bartels-rausch committed 2026-03-12 10:26:31 +01:00
1 parent 00d34110db
commit d7bc516442
1 file changed
+13
+13
View File
@@ -649,6 +649,19 @@ if ~isempty(TmpFileList{1})
globalWorkFunction = sscanf(strtrim(extractAfter(lineStr, '# Eff. Workfunction:')), '%f');
elseif startsWith(lineStr, '# Excitation Energy:')
globalExEnergy = sscanf(strtrim(extractAfter(lineStr, '# Excitation Energy:')), '%f');
% =========================================================================
% OFFLINE XPS BUG FIX (Mg vs Al Source)
% If the file lacks "Monochromator" in the header and the energy is
% incorrectly tagged as ~1453.6 or 1486.6, overwrite it to 1253.6 (Mg Ka).
% =========================================================================
if ~contains(headerText, 'Monochromator', 'IgnoreCase', true)
% Checking both 1453.6 (as requested) and 1486.61 (as seen in your file)
if (abs(globalExEnergy - 1453.6) < 1) || (abs(globalExEnergy - 1486.61) < 1)
globalExEnergy = 1253.6;
end
end
% =========================================================================
end
end
end