refnx/util/general.py
def q2(omega, twotheta, phi, wavelength):
    """
    Convert angles and wavelength (lambda) to Q vector.

    Parameters
    ----------
    omega: float
        angle of incidence of beam (with respect to xy plane).
    twotheta: float
        angle between direct beam and the projection of the reflected beam onto
        xz plane.
    phi: float
        azimuthal angle between reflected beam and xz plane.
    wavelength: float

    Returns
    -------
    Qx, Qy, Qz : float, float, float
        Momentum transfer.

    Notes
    -----
    All angles are assumed to be in degrees.

    coordinate system:
    The beam is incident in the xz plane.
    x - along beam direction (in small angle approximation)
    y - transverse to beam direction, in plane of sample
    z - normal to sample plane.

    The xy plane is equivalent to the sample plane.
    """
    omega = np.radians(omega)
    twotheta = np.radians(twotheta)
    phi = np.radians(phi)

    qx = (
        2
        * np.pi
        / wavelength
        * (np.cos(twotheta - omega) * np.cos(phi) - np.cos(omega))
    )
    qy = 2 * np.pi / wavelength * np.cos(twotheta - omega) * np.sin(phi)
    qz = 2 * np.pi / wavelength * (np.sin(twotheta - omega) + np.sin(omega))

    return qx, qy, qz

    Convert angles and wavelength (lambda) to Q vector.

    Parameters
    ----------
    omega: float
        angle of incidence of beam (with respect to xy plane).
    twotheta: float
        angle between direct beam and the projection of the reflected beam onto
        xz plane.
    phi: float
        azimuthal angle between reflected beam and xz plane.
    wavelength: float

    Returns
    -------
    Qx, Qy, Qz : float, float, float
        Momentum transfer.

    Notes
    -----
    All angles are assumed to be in degrees.

    coordinate system:
    The beam is incident in the xz plane.
    x - along beam direction (in small angle approximation)
    y - transverse to beam direction, in plane of sample
    z - normal to sample plane.

    The xy plane is equivalent to the sample plane.
    
Convert angles and wavelength (lambda) to Q vector.
Parameters

float
angle of incidence of beam (with respect to xy plane).
twotheta: float
angle between direct beam and the projection of the reflected beam onto
xz plane.
phi: float
azimuthal angle between reflected beam and xz plane.
wavelength: float

Returns



Notes

All angles are assumed to be in degrees.

coordinate system:
The beam is incident in the xz plane.
x - along beam direction (in small angle approximation)
y - transverse to beam direction, in plane of sample
z - normal to sample plane.

The xy plane is equivalent to the sample plane.
Convert angles and wavelength ( lambda ) to Q vector . Parameters float angle of incidence of beam ( with respect to xy plane ) . twotheta : float angle between direct beam and the projection of the reflected beam onto xz plane . phi : float azimuthal angle between reflected beam and xz plane . wavelength : float Returns Notes All angles are assumed to be in degrees . coordinate system : The beam is incident in the xz plane . x - along beam direction ( in small angle approximation ) y - transverse to beam direction in plane of sample z - normal to sample plane . The xy plane is equivalent to the sample plane .
def q2(omega, twotheta, phi, wavelength):
    omega = np.radians(omega)
    twotheta = np.radians(twotheta)
    phi = np.radians(phi)
    qx = (
        2
        * np.pi
        / wavelength
        * (np.cos(twotheta - omega) * np.cos(phi) - np.cos(omega))
    )
    qy = 2 * np.pi / wavelength * np.cos(twotheta - omega) * np.sin(phi)
    qz = 2 * np.pi / wavelength * (np.sin(twotheta - omega) + np.sin(omega))
    return qx, qy, qz
def q2 ( omega , twotheta , phi , wavelength ) : omega = np . radians ( omega ) twotheta = np . radians ( twotheta ) phi = np . radians ( phi ) qx = ( 2 * np . pi / wavelength * ( np . cos ( twotheta - omega ) * np . cos ( phi ) - np . cos ( omega ) ) ) qy = 2 * np . pi / wavelength * np . cos ( twotheta - omega ) * np . sin ( phi ) qz = 2 * np . pi / wavelength * ( np . sin ( twotheta - omega ) + np . sin ( omega ) ) return qx , qy , qz
Convert angles and wavelength (lambda) to Q vector.
Convert angles and wavelength ( lambda ) to Q vector .
"""
    Convert angles and wavelength (lambda) to Q vector.

    Parameters
    ----------
    omega: float
        angle of incidence of beam (with respect to xy plane).
    twotheta: float
        angle between direct beam and the projection of the reflected beam onto
        xz plane.
    phi: float
        azimuthal angle between reflected beam and xz plane.
    wavelength: float

    Returns
    -------
    Qx, Qy, Qz : float, float, float
        Momentum transfer.

    Notes
    -----
    All angles are assumed to be in degrees.

    coordinate system:
    The beam is incident in the xz plane.
    x - along beam direction (in small angle approximation)
    y - transverse to beam direction, in plane of sample
    z - normal to sample plane.

    The xy plane is equivalent to the sample plane.
    """
omega
twotheta
phi
wavelength