larch xray plugin - incorrect chantler data at edges
Hi, the larch xraydb plugin doesn't provide correct numbers for chantler f1 data around edges. Apparently this is due to incorrect interpolation in xray/xraydb.py in line 274. Below is a plot of "delta" from xraydb_plugin.xray_delta_beta() for Silicon which is terrribly wrong. The more correct "delta" as from chantler is shown in the following plot: --> I'd recommend to replace (line 274 in plugin xray/xraydb.py): out = UnivariateSpline(te, ty, s=smoothing)(energy) by a simple linear interpolation out = np.interp(energy, te, ty) The latter yields linear segments between chantler's data, but this is still better than the totally unphysical spline interpolation. Best regards, -- Johannes
Hi Johannes,
I guess I hadn't tested the Chantler results below about 1 keV, and
certainly not at 100 eV. To be clear, Chantler claims the error bars on
these value of "50 to 200%" below 200 eV. But the spline interpolation is
much, much worse than that!
Spline interpolation is definitely preferred at higher energies, and where
the grid of tabulated data is fine enough. But we should better explore
when that is valid, and/or automatically use linear interpolation below
some energy, and/or allow the user to select the interpolation order.
Anyway, thanks very much. We should make this better at all energy ranges.
--Matt
On Wed, Oct 14, 2015 at 1:11 AM, Dr. Johannes Zellner
Hi,
the larch xraydb plugin doesn't provide correct numbers for chantler f1 data around edges. Apparently this is due to incorrect interpolation in xray/xraydb.py in line 274. Below is a plot of "delta" from xraydb_plugin.xray_delta_beta() for Silicon which is terrribly wrong.
The more correct "delta" as from chantler is shown in the following plot:
--> I'd recommend to replace (line 274 in plugin xray/xraydb.py):
out = UnivariateSpline(te, ty, s=smoothing)(energy)
by a simple linear interpolation
out = np.interp(energy, te, ty)
The latter yields linear segments between chantler's data, but this is still better than the totally unphysical spline interpolation.
Best regards,
-- Johannes
_______________________________________________ Ifeffit mailing list Ifeffit@millenia.cars.aps.anl.gov http://millenia.cars.aps.anl.gov/mailman/listinfo/ifeffit
-- --Matt Newville <newville at cars.uchicago.edu> 630-252-0431
participants (2)
-
Dr. Johannes Zellner
-
Matt Newville