constants

Constants

Elemental data

Tools for working with elemental constants.

BasicElement

Object to return basic elemental information

X-ray fluorescence data

The c library xraylib provides a programmatic interface to x-ray fluorescence constants. We provide dictionary-like wrapping classes to provide easy access to the data. For the most part users should access this data through the Element object which manages the creation and access to these objects.

XrayLibWrap

High-level interface to xraylib.

XrayLibWrap_Energy

This is an interface to wrap xraylib to perform calculation on fluorescence cross section, or other incident energy related quantity.

emission_line_search

Find elements which have an emission line near an energy

XrfElement

Object to return all the elemental information related to fluorescence

Powder Diffraction Standards

Module for xray scattering

calibration_standards

Mapping of known calibration standards and their reflections

PowderStandard

Class for providing safe access to powder calibration standards data.

Reflection

Namedtuple sub-class for scattering reflection information

HKL

Namedtuple sub-class miller indicies (HKL)

Converting \(2\theta\) between wavelengths

Given that

\[\frac{\lambda_c}{2 a} \sqrt{h^2 + k^2 + l^2} = \sin\left(\frac{2\theta_c}{2}\right)\]

If we multiply both sides by \(\frac{\lambda_n}{\lambda_c}\) then we have

\[ \begin{align}\begin{aligned}\frac{\lambda_n}{2 a} \sqrt{h^2 + k^2 + l^2} = \frac{\lambda_n}{\lambda_c} \sin\left(\frac{2\theta_c}{2}\right)\\\sin\left(\frac{2\theta_n}{2}\right) = \frac{\lambda_n}{\lambda_c} \sin\left(\frac{2\theta_c}{2}\right)\end{aligned}\end{align} \]

which solving for \(2\theta_n\) gives us

\[2\theta_n = 2 \arcsin\left(\frac{\lambda_n}{\lambda_c} \sin\left(\frac{2\theta_c}{2}\right)\right)\]