Xray scattering potentials¶
periodictable.xsf
¶
This module has one class and nine fuctions.
Xray
 Xray scattering properties for the elements.
The following attributes are added to each element:
Xray.sftable()
 Three column table of energy vs. scattering factors f1, f2.
Xray.scattering_factors()
 Returns f1, f2, the Xray scattering factors for the given wavelengths interpolated from sftable.
Xray.f0()
 Returns f0 for the given vector Q, with Q[i] in \([0, 24\pi]\) Å^{1}.
Xray.sld()
 Returns scattering length density (real, imaginary) for the given wavelengths or energies.
The following functions are available for Xray scatting information processing:
xray_wavelength()
 Finds Xray wavelength in angstroms given energy in keV.
xray_energy()
 Finds Xray energy in keV given wavelength in angstroms.
init()
 Initializes a periodic table with the Lawrence Berkeley Laboratory Center for XRay Optics xray scattering factors.
init_spectral_lines()
 Sets the K_alpha and K_beta1 wavelengths for select elements.
sld_table()
 Prints the xray SLD table for the given wavelength.
xray_sld()
 Computes xray scattering length densities for molecules.
index_of_refraction()
 Express xray scattering length density as an index of refraction
mirror_reflectivity()
 Xray reflectivity from a mirror made of a single compound.
xray_sld_from_atoms()
 The underlying scattering length density calculator. This works with a dictionary of atoms and quantities directly.
emission_table()
 Prints a table of emission lines.
 K_alpha, K_beta1 (Å):
 Xray emission lines for elements beyond neon, with \(K_\alpha = (2 K_{\alpha 1} + K_{\alpha 2})/3\).
 Xray scattering factors:
 LowEnergy Xray Interaction Coefficients: Photoabsorption, scattering and reflection for E in 30 to 30,000 eV, and Z in 1 to 92.
Note
For custom tables, use init()
and
init_spectral_lines()
to set the data.
Emission line tables¶
Data for the \(K_\alpha\) and \(K_\beta\) lines comes from [#Deslattes2003], with the full tables available at http://www.nist.gov/pml/data/xraytrans/index.cfm. Experimental Values are used, truncated to 4 digits of precision to correspond to the values for the subset of elements previously defined in the periodictable package.
Xray f1 and f2 tables¶
The data for the tables is stored in the periodictable/xsf
.
directory. The following information is from periodictable/xsf/read.me
,
with minor formatting changes:
These
[*.nff]
files were used to generate the tables published in reference [1]. The files contain three columns of data:Energy(eV), f_1, f_2,where f_1 and f_2 are the atomic (forward) scattering factors. There are 500+ points on a uniform logarithmic mesh with points added 0.1 eV above and below “sharp” absorption edges. The tabulated values of f_1 contain a relativistic, energy independent, correction given by:
\[Z^* = Z  (Z/82.5)^{2.37}\]Note
Below 29 eV f_1 is set equal to 9999.
The atomic photoabsorption cross section, \(\mu_a\), may be readily obtained from the values of \(f_2\) using the relation:
\[\mu_a = 2 r_e \lambda f_2\]where \(r_e\) is the classical electron radius, and \(\lambda\) is the wavelength. The index of refraction for a material with N atoms per unit volume is calculated by:
\[n = 1  N r_e \lambda^2 (f_1 + i f_2)/(2 \pi).\]These (semiempirical) atomic scattering factors are based upon photoabsorption measurements of elements in their elemental state. The basic assumption is that condensed matter may be modeled as a collection of noninteracting atoms. This assumption is in general a good one for energies sufficiently far from absorption thresholds. In the threshold regions, the specific chemical state is important and direct experimental measurements must be made.
These tables are based on a compilation of the available experimental measurements and theoretical calculations. For many elements there is little or no published data and in such cases it was necessary to rely on theoretical calculations and interpolations across Z. In order to improve the accuracy in the future considerably more experimental measurements are needed.
Note that the following elements have been updated since the publication of Ref. [1] in July 1993. Check http://henke.lbl.gov/optical_constants/update.html for more recent updates.
Element Updated Energy Range (eV) Mg Jan 2011 101300 Zr Apr 2010 201000 La Jun 2007 14440 Gd Jun 2007 12450 Sc Apr 2006 501300 Ti Aug 2004 20150 Ru Aug 2004 401300 W Aug 2004 35250 Mo Aug 2004 2560 Be Aug 2004 40250 Mo Nov 1997 10930 Fe Oct 1995 600800 Si Jun 1995 30500 Au Jul 1994 20006500 Mg,Al,Si Jan 1994 30200 Li Nov 1994 200030000
 Data available at:
[1]  (1, 2) B. L. Henke, E. M. Gullikson, and J. C. Davis. “Xray interactions: photoabsorption, scattering, transmission, and reflection at E=5030000 eV, Z=192”, Atomic Data and Nuclear Data Tables 54 no.2, 181342 (July 1993). 
[2]  R. D. Deslattes, E. G. Kessler, Jr., P. Indelicato, L. de Billy, E. Lindroth, and J. Anton. Rev. Mod. Phys. 75, 3599 (2003). 

class
periodictable.xsf.
Xray
(element)¶ Bases:
object
Xray scattering properties for the elements. Refer help(periodictable.xsf) from command prompt for details.

f0
(Q)¶ Isotropic Xray scattering factors f0 for the input Q.
Parameters:  Q : float or vector in \([0, 24\pi]\)  Å^{1}
Xray scattering properties for the elements.
Returns:  f0 : float
Values outside the valid range return NaN.
Note
f0 is often given as a function of \(\sin(\theta)/\lambda\) whereas we are using \(Q = 4 \pi \sin(\theta)/\lambda\), or in terms of energy \(Q = 4 \pi \sin(\theta) E/(h c)\).
 Reference:
 D. Wassmaier, A. Kerfel, Acta Crystallogr. A51 (1995) 416. http://dx.doi.org/10.1107/S0108767394013292

scattering_factors
(energy=None, wavelength=None)¶ Xray scattering factors f’, f’‘.
Parameters:  energy : float or vector  keV
Xray energy.
Returns:  scattering_factors : (float, float)
Values outside the range return NaN.
Values are found from linear interpolation within the Henke Xray scattering factors database at the Lawrence Berkeley Laboratory Center for Xray Optics.

sld
(wavelength=None, energy=None)¶ X ray scattering length density.
Parameters:  wavelength : float or vector  Å
Wavelength of the Xray.
 energy : float or vector  keV
Energy of the Xray (if wavelength not specified).
Returns:  sld : (float, float)  Å^{2}
(real, imaginary) Xray scattering length density.
Raises: TypeError : neither wavelength nor energy was specified.
The scattering length density is \(r_e N (f_1 + i f_2)\). where \(r_e\) is the electron radius and \(N\) is the number density. The number density is \(N = \rho_m/m N_A\), with mass density \(\rho_m\) molar mass \(m\) and Avogadro’s number \(N_A\).
The constants are available directly:
\(r_e\) = periodictable.xsf.electron_radius
\(N_A\) = periodictable.constants.avogadro_number
Data comes from the Henke Xray scattering factors database at the Lawrence Berkeley Laboratory Center for Xray Optics.

scattering_factors_units
= ['', '']¶

sftable
¶ Xray scattering factor table (E,f1,f2)

sftable_units
= ['eV', '', '']¶

sld_units
= ['1e6/Ang^2', '1e6/Ang^2']¶


periodictable.xsf.
init
(table, reload=False)¶

periodictable.xsf.
init_spectral_lines
(table)¶ Sets the K_alpha and K_beta1 wavelengths for select elements

periodictable.xsf.
xray_energy
(wavelength)¶ Convert Xray wavelength to energy.
Parameters: wavelength : float or vector  Å Returns: energy : float or vector  keV Wavelength can be converted to energy using
\[E = h c / \lambda\]where:
\(h\) = planck’s constant in eV·s
\(c\) = speed of light in m/s

periodictable.xsf.
xray_wavelength
(energy)¶ Convert Xray energy to wavelength.
Parameters: energy : float or vector  keV Returns: wavelength : float  Å Energy can be converted to wavelength using
\[\lambda = h c / E\]where:
\(h\) = planck’s constant in eV·s
\(c\) = speed of light in m/s

periodictable.xsf.
xray_sld
(compound, density=None, natural_density=None, wavelength=None, energy=None)¶ Compute xray scattering length densities for molecules.
Parameters:  compound : Formula initializer
Chemical formula.
 density : float  g·cm^{3}
Mass density of the compound, or None for default.
 natural_density : float  g·cm^{3}
Mass density of the compound at naturally occurring isotope abundance.
 wavelength : float or vector  Å
Wavelength of the Xray.
 energy : float or vector  keV
Energy of the Xray, if wavelength is not specified.
Returns:  sld : (float, float)  10^{6}Å^{2}
(real, imaginary) scattering length density.
Raises: AssertionError : density or wavelength/energy is missing.

periodictable.xsf.
xray_sld_from_atoms
(*args, **kw)¶ Deprecated since version 0.91:
xray_sld()
now accepts a dictionary of {atom: count} directly.

periodictable.xsf.
emission_table
(table=None)¶ Prints a table of emission lines.
Parameters:  table : PeriodicTable
The default periodictable unless a specific table has been requested.
Returns: None
Example
>>> emission_table() # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE El Kalpha Kbeta1 Ne 14.6102 14.4522 Na 11.9103 11.5752 Mg 9.8902 9.5211 Al 8.3402 7.9601 Si 7.1263 6.7531 ...

periodictable.xsf.
sld_table
(wavelength=None, table=None)¶ Prints the xray SLD table for the given wavelength.
Parameters:  wavelength = Cu Kalpha : float  Å
Xray wavelength.
 table : PeriodicTable
The default periodictable unless a specific table has been requested.
Returns: None
Example
>>> sld_table() # doctest: +ELLIPSIS, +NORMALIZE_WHITESPACE Xray scattering length density for 1.5418 Ang El rho irho H 1.19 0.00 He 1.03 0.00 Li 3.92 0.00 Be 13.93 0.01 B 18.40 0.01 C 18.71 0.03 N 6.88 0.02 O 9.74 0.04 F 12.16 0.07 Ne 10.26 0.09 Na 7.98 0.09 Mg 14.78 0.22 ...

periodictable.xsf.
plot_xsf
(el)¶ Plots the xray scattering factors for the given element.
Parameters: el : Element Returns: None

periodictable.xsf.
index_of_refraction
(compound, density=None, natural_density=None, energy=None, wavelength=None)¶ Calculates the index of refraction for a given compound
Parameters:  compound : Formula initializer
Chemical formula.
 density : float  g·cm^{3}
Mass density of the compound, or None for default.
 natural_density : float  g·cm^{3}
Mass density of the compound at naturally occurring isotope abundance.
 wavelength : float or vector  Å
Wavelength of the Xray.
 energy : float or vector  keV
Energy of the Xray, if wavelength is not specified.
Returns:  n : float or vector  unitless
index of refraction of the material at the given energy
Notes: Formula taken from http://xdb.lbl.gov (section 1.7) and checked against http://henke.lbl.gov/optical_constants/getdb2.html

periodictable.xsf.
mirror_reflectivity
(compound, density=None, natural_density=None, energy=None, wavelength=None, angle=None, roughness=0)¶ Calculates reflectivity of a thick mirror as function of energy and angle
Parameters:  compound : Formula initializer
Chemical formula.
 density : float  g·cm^{3}
Mass density of the compound, or None for default.
 natural_density : float  g·cm^{3}
Mass density of the compound at naturally occurring isotope abundance.
 roughness : float  Å
Highspatialfrequency surface roughness.
 wavelength : float or vector  Å
Wavelength of the Xray.
 energy : float or vector  keV
Energy of the Xray, if wavelength is not specified.
 angle : vector  °
Incident beam angles.
Returns:  reflectivity : matrix
matrix of reflectivity as function of (angle, energy)
Notes: Formula taken from http://xdb.lbl.gov (section 4.2) and checked against http://henke.lbl.gov/optical_constants/mirror2.html