xray_utils¶
X-ray scattering utility funcitons
diffractometer_twotheta(delta=0, gamma=0)
¶
Return the Bragg 2-theta angle for diffractometer detector rotations delta (vertical) and gamma (horizontal)
Source code in mmg_toolbox/utils/xray_utils.py
photon_energy(wavelength_a)
¶
Converts wavelength in A to energy in keV energy_kev = photon_energy(wavelength_a) Energy [keV] = h*c/L = 12.3984 / lambda [A]
Source code in mmg_toolbox/utils/xray_utils.py
photon_wavelength(energy_kev)
¶
Converts energy in keV to wavelength in A wavelength_a = photon_wavelength(energy_kev) lambda [A] = h*c/E = 12.3984 / E [keV]
Source code in mmg_toolbox/utils/xray_utils.py
polarisation_pi(delta=0, gamma=0)
¶
Returns the scattered polerisation vector in the Pi' channel
Source code in mmg_toolbox/utils/xray_utils.py
polarisation_sigma(delta=0, gamma=0)
¶
Returns the scattered polerisation vector in the sigma' channel
Source code in mmg_toolbox/utils/xray_utils.py
resolution2energy(res, twotheta=180.0)
¶
Calcualte the energy required to achieve a specific resolution at a given two-theta
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
res
|
measurement resolution in A (==d-spacing) |
required | |
twotheta
|
Bragg angle in Degrees |
180.0
|
Returns:
| Type | Description |
|---|---|
|
float |
Source code in mmg_toolbox/utils/xray_utils.py
wavevector(wavelength_a)
¶
wavevector_f(wavelength_a, delta=0, gamma=0)
¶
Returns a 3D wavevector for the final wavevector
Source code in mmg_toolbox/utils/xray_utils.py
wavevector_i(wavelength_a)
¶
wavevector_t(wavelength_a, delta=0, gamma=0)
¶
Returns the wavevector transfer in inverse-Angstroms Q = kf - ki
you_normal_vector(eta=0, chi=90, mu=0)
¶
Determine the normal vector using the You diffractometer angles you_normal_vector(0, 0, 0) = [1, 0, 0] you_normal_vector(0, 90, 0) = [0, 1, 0] you_normal_vector(90, 90, 0) = [0, 0, -1] you_normal_vector(0, 0, 90) = [0, 0, -1]
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
eta
|
angle (deg) along the x-axis |
0
|
|
mu
|
angle (deg) about the z-axis |
0
|
|
chi
|
angle deg) a |
90
|
Returns:
| Type | Description |
|---|---|
|
array |