Hi, The data in question also had energies that were not in strictly increasing order and had many visible spikes and dropouts in the mu(E) data that could certainly confuse the 'find the maximum of the first derivative' algorithm. But that being said, I could not reproduce Dave's problem, even with the data out of order and with dropouts. Exporting the xmu data, I got e0's that were very close to one another:
read_data(gadowee.xmu, group=gad, type=xmu) pre_edge(gad.energy, gad.xmu, find_e0=1) pre_edge: energy data appears out of order print e0 10374.0000
read_data(gamo.xmu, group=gam, type=xmu) pre_edge(gam.energy, gam.xmu, find_e0=1) pre_edge: energy data appears out of order print e0 10374.0900
I don't know why athena got to a different answer, or how to force it to re-determine e0. It would not be difficult to interpolate the data onto a very fine energy grid (say, 0.05eV) and do a multi-point derivative measurement to get a slightly more robust measure of E0. I'd stress the 'slightly' not because of the issue of stating that the max in the 1st derivative is the Fermi level, but because of the problem of dropouts and glitches, as the data here contains. --Matt PS: Whether the max of the 1st derivative is a measure of the Fermi energy is a whole other story.