scippneutron.conversion.beamline.scattering_angles_with_gravity#

scippneutron.conversion.beamline.scattering_angles_with_gravity(incident_beam, scattered_beam, wavelength, gravity)[source]#

Compute scattering angles theta and phi using gravity.

With the definitions of the unit vectors in Coordinate system, we have the components of the scattered beam \(b_2\) in the beam-aligned coordinate system:

\[\begin{split}x_d &= b_2 \cdot \hat{e}_x \\ y_d &= b_2 \cdot \hat{e}_y \\ z_d &= b_2 \cdot \hat{e}_z\end{split}\]

\(b_2\) points from the sample to the detector that detected the neutron. The neutron left the sample in the direction of a vector \(b'_2\). This vector defines the scattering angles \(2\theta\) and \(\phi\). Taking gravity into account, we have \(b'_2 \neq b_2\). Solving the equations of motion gives the following for the components of \(b'_2\):

\[\begin{split}x'_d &= x_d \\ y'_d &= y_d + \delta_y \\ z'_d &= z_d\end{split}\]

Where \(|g|\) is the strength of gravity, \(m_n\) is the neutron mass, \(h\) is the Planck constant, \(\lambda\) is the wavelength, and

\[\delta_y = \frac{|g| m_n^2}{2 h^2} L_2^{\prime\, 2} \lambda^2\]

This gives the gravity-corrected scattering angles:

\[\begin{split}2\theta &= \sphericalangle(b_1, b_2 + \delta_y \hat{e}_y) \\ \mathsf{tan}(\phi) &= \frac{y'_d}{x_d}\end{split}\]

where \(\sphericalangle\) is the angle between two vectors as implemented by two_theta(). When \(b_1\) is orthogonal to gravity, we can equivalently use

\[\mathsf{tan}(2\theta) = \frac{\sqrt{x_d^2 + y_d^{\prime\, 2}}}{z_d}\]

This equation allowed for a more efficient implementation.

Attention

The above equation for \(y'_d\) contains \(L_2^{\prime\, 2} = |b'_2|\) which in turn depends on \(y'_d\). Solving this equation for \(y'_d\) is too difficult. Instead, we approximate \(L'_2 \approx L_2\). The impact of this approximation on \(2\theta\) is of the order of \(10^{-6}\) or less for beamlines at ESS. This is within the expected statistical uncertainties and can be ignored.

See two_theta gravity correction for details.

Parameters:
  • incident_beam (Variable) – Beam from source to sample. Expects dtype=vector3.

  • scattered_beam (Variable) – Beam from sample to detector. Expects dtype=vector3.

  • wavelength (Variable) – Wavelength of neutrons.

  • gravity (Variable) – Gravity vector.

Returns:

SphericalCoordinates – A dict containing the polar scattering angle 'two_theta' and the azimuthal angle 'phi'.

See also

scattering_angle_in_yz_plane

Ignores the x component when computing theta. This is used in reflectometry.