-
Notifications
You must be signed in to change notification settings - Fork 36
Open
Description
It would be nice if the popular index of refraction components
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-6def 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-6Should I make a pr for this?
Metadata
Metadata
Assignees
Labels
No labels