skxray.core.q_to_twotheta

skxray.core.q_to_twotheta(q, wavelength)

Helper function to convert \(q\) + \(\lambda\) to \(2\theta\). The point of this function is to prevent fat-fingered typos.

By definition the relationship is:

..math

\sin\left(\frac{2\theta}{2}

ight) = frac{lambda q}{4 pi}

thus

..math

2\theta_n = 2 \arcsin\left(\frac{\lambda q}{4 \pi}\right
Parameters:

q : array

An array of \(q\) values

wavelength : float

Wavelength of the incoming x-rays

Returns:

two_theta : array

An array of \(2\theta\) values