core.recip Module

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

skbeam.core.recip.calibrated_pixels_to_q(detector_size, pyfai_kwargs)

For a given detector and pyfai calibrated geometry give back the q value for each pixel in the detector.

Parameters
detector_sizetuple

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

pyfai_kwargs: dict

The dictionary of pyfai geometry kwargs, given by pyFAI’s calibration Ex: dist, poni1, poni2, rot1, rot2, rot3, splineFile, wavelength, detector, pixel1, pixel2

Returns
q_valndarray

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

skbeam.core.recip.gisaxs(incident_beam, reflected_beam, pixel_size, detector_size, dist_sample, wavelength, theta_i=0.0)

This function will provide scattering wave vector(q) components(x, y, z), q parallel and incident and reflected angles for grazing-incidence small angle X-ray scattering (GISAXS) geometry.

Parameters
incident_beamtuple

x and y co-ordinates of the incident beam in pixels

reflected_beamtuple

x and y co-ordinates of the reflected beam in pixels

pixel_sizetuple

pixel_size in um

detector_size: tuple

2 element tuple defining no. of pixels(size) in the detector X and Y direction

dist_samplefloat

sample to detector distance, in meters

wavelengthfloat

wavelength of the x-ray beam in Angstroms

theta_ifloat, optional

out of plane angle, default 0.0

Returns
namedtuple

gisaxs_output object is returned This gisaxs_output object contains, in this order:

  • alpha_i : float incident angle

  • theta_f : array out of plane angle shape (detector_size[0], detector_size[1])

  • alpha_f : array exit angle shape (detector_size[0], detector_size[1])

  • tilt_angle : float tilt angle

  • qx : array x component of the scattering wave vector shape (detector_size[0], detector_size[1])

  • qy : array y component of the scattering wave vector shape (detector_size[0], detector_size[1])

  • qz : array z component of the scattering wave vector shape (detector_size[0], detector_size[1])

  • qr : array q parallel component shape (detector_size[0], detector_size[1])

Notes

This implementation is based on published work. [1]

References

1

R. Lazzari, “IsGISAXS: a program for grazing-incidence small- angle X-ray scattering analysis of supported islands,” J. Appl. Cryst., vol 35, p 406-421, 2002.

class skbeam.core.recip.gisaxs_output(alpha_i, theta_f, alpha_f, tilt_angle, qx, qy, qz, qr)

Bases: tuple

property alpha_f

Alias for field number 2

property alpha_i

Alias for field number 0

property qr

Alias for field number 7

property qx

Alias for field number 4

property qy

Alias for field number 5

property qz

Alias for field number 6

property theta_f

Alias for field number 1

property tilt_angle

Alias for field number 3

skbeam.core.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_arrndarray

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

Returns
q_valndarray

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

skbeam.core.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_anglesndarray

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_sizetuple

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

pixel_sizetuple

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_centertuple

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

dist_samplefloat

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

wavelengthfloat

wavelength of incident radiation (Angstroms)

ubndarray

UB matrix (orientation matrix) 3x3 matrix

frame_modestr, 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
hklndarray

(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 [1], text [2]

1

M. Lohmeier and E.Vlieg, “Angle calculations for a six-circle surface x-ray diffractometer,” J. Appl. Cryst., vol 26, pp 706-716, 1993.

2

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.