recip Module

This module is for functions and classes specific to reciprocal space calculations.

skxray.recip.hkl_to_q(hkl_arr)

This module compute the reciprocal space (q) values from known HKL array for each pixel of the detector for all the images

Parameters:

hkl_arr : ndarray

(Qx, Qy, Qz) - HKL array shape is [num_images * num_rows * num_columns][3]

Returns:

q_val : ndarray

Reciprocal values for each pixel for all images shape is [num_images * num_rows * num_columns]

skxray.recip.process_to_q(setting_angles, detector_size, pixel_size, calibrated_center, dist_sample, wavelength, ub, frame_mode=None)

This will compute the hkl values for all pixels in a shape specified by detector_size.

Parameters:

setting_angles : ndarray

six angles of all the images - Required shape is [num_images][6] and required type is something that can be cast to a 2D numpy array Angle order: delta, theta, chi, phi, mu, gamma (degrees)

detector_size : tuple

2 element tuple defining the number of pixels in the detector. Order is (num_columns, num_rows)

pixel_size : tuple

2 element tuple defining the size of each pixel in mm. Order is (column_pixel_size, row_pixel_size). If not in mm, must be in the same units as dist_sample

calibrated_center : tuple

2 element tuple defining the center of the detector in pixels. Order is (column_center, row_center)(x y)

dist_sample : float

distance from the sample to the detector (mm). If not in mm, must be in the same units as pixel_size

wavelength : float

wavelength of incident radiation (Angstroms)

ub : ndarray

UB matrix (orientation matrix) 3x3 matrix

frame_mode : str, optional

Frame mode defines the data collection mode and thus the desired output from this function. Defaults to hkl mode (frame_mode=4) ‘theta’ : Theta axis frame. ‘phi’ : Phi axis frame. ‘cart’ : Crystal cartesian frame. ‘hkl’ : Reciprocal lattice units frame. See the process_to_q.frame_mode attribute for an exact list of valid options.

Returns:

hkl : ndarray

(Qx, Qy, Qz) - HKL values shape is [num_images * num_rows * num_columns][3]

Notes

Six angles of an image: (delta, theta, chi, phi, mu, gamma ) These axes are defined according to the following references.

References: text [R1], text [R2]

[R1]M. Lohmeier and E.Vlieg, “Angle calculations for a six-circle surface x-ray diffractometer,” J. Appl. Cryst., vol 26, pp 706-716, 1993.
[R2]E. Vlieg, “A (2+3)-Type surface diffractometer: Mergence of the z-axis and (2+2)-Type geometries,” J. Appl. Cryst., vol 31, pp 198-203, 1998.