bragg: Bragg’s law calculations#

Bragg’s law calculations.

daxs.utils.bragg.calculate_wavelength(angle: float | Iterable[float], d_spacing: float) float | ndarray[tuple[int, ...], dtype[float64]][source]#

Calculate the wavelength [Å] for a scattering angle [degrees] and d-spacing [Å].

λ [Å] = 2 * d [Å] * sin(θ [rad])

daxs.utils.bragg.calculate_energy(angle: float | Iterable[float], d_spacing: float)[source]#

Calculate the energy [keV] for a scattering angle [degrees] and d-spacing [Å].

E [keV] = h [J s] * c [m s^-1] / e [C] / λ [Å] = [eV m / Å] = 1e7 [keV]

daxs.utils.bragg.calculate_scattering_angle(energy: float | Iterable[float], d_spacing: float) float | ndarray[tuple[int, ...], dtype[float64]][source]#

Calculate the angle [degrees] for a given energy [keV] and d-spacing [Å].