It would be nice if the popular index of refraction components $\delta$ and $\beta$ could be added as functions to the xsf module. They could be modeled from the index of refraction function.
Proposed addition:
def delta(compound, *, density=None, natural_density=None,
energy=None, wavelength=None):
"""
Calculates the δ component of the index of refraction for a given compound
...
"""
if energy is not None:
wavelength = xray_wavelength(energy)
assert wavelength is not None, "scattering calculation needs energy or wavelength"
f1, f2 = xray_sld(compound,
density=density, natural_density=natural_density,
wavelength=wavelength)
return wavelength**2/(2*pi)*(f1)*1e-6
def beta(compound, *, density=None, natural_density=None,
energy=None, wavelength=None):
"""
Calculates the β component of the index of refraction for a given compound
...
"""
if energy is not None:
wavelength = xray_wavelength(energy)
assert wavelength is not None, "scattering calculation needs energy or wavelength"
f1, f2 = xray_sld(compound,
density=density, natural_density=natural_density,
wavelength=wavelength)
return -wavelength**2/(2*pi)*(f2)*1e-6
Should I make a pr for this?
It would be nice if the popular index of refraction components$\delta$ and $\beta$ could be added as functions to the xsf module. They could be modeled from the index of refraction function.
Proposed addition:
Should I make a pr for this?