neutronpy.crystal.Sample

class neutronpy.crystal.Sample(a, b, c, alpha, beta, gamma, u=None, v=None, mosaic=None, vmosaic=None, direct=1, width=None, height=None, depth=None, shape='rectangular', distance=None)[source]

Private class containing sample information.

Parameters:
a : float

Unit cell length in angstroms

b : float

Unit cell length in angstroms

c : float

Unit cell length in angstroms

alpha : float

Angle between b and c in degrees

beta : float

Angle between a and c in degrees

gamma : float

Angle between a and b in degrees

u : array_like

First orientation vector

v : array_like

Second orientation vector

mosaic : float, optional

Horizontal sample mosaic (FWHM) in arc minutes

vmosaic : float, optional

Vertical sample mosaic (FWHM) in arc minutes

direct : ±1, optional

Direction of the crystal (left or right, -1 or +1, respectively)

width : float, optional

Sample width in cm. Default: 1

height : float, optional

Sample height in cm. Default: 1

depth : float, optional

Sample thickness in cm. Default: 1

shape : str, optional

Sample shape type. Accepts ‘rectangular’ or ‘cylindrical’. Default: ‘rectangular’

distance : float, optional

Distance from source (used for Time of Flight resolution calculations). Default: None

Attributes:
a

First lattice constant in Angstrom

b

Second lattice constant in Angstrom

c

Third lattice constant in Angstrom

alpha

First lattice angle in degrees

beta

Second lattice angle in degrees

gamma

Third lattice angle in degrees

u

First orientation vector

v

Second orientation vector

mosaic
vmosaic
direct
width
height
depth
shape
astar

First inverse lattice constant in inverse Angstrom

bstar

Second inverse lattice constant in inverse Angstrom

cstar

Third inverse lattice constant in inverse Angstrom

alpha_rad

First lattice angle in radians

beta_rad

Second lattice angle in radians

gamma_rad

Third lattice angle in radians

alphastar

First inverse lattice angle in degrees

betastar

First inverse lattice angle in degrees

gammastar

First inverse lattice angle in degrees

alphastar_rad

First inverse lattice angle in radians

betastar_rad

Second inverse lattice angle in radians

gammastar_rad

Third inverse lattice angle in radians

abg_rad

Lattice angles in radians returned in list

reciprocal_abc

Reciprocal lattice constants in inverse Angstrom returned in list

reciprocal_abg

Reciprocal lattice angles in degrees returned in list

reciprocal_abg_rad

Reciprocal lattice angles in radians returned in list

lattice_type

Type of lattice determined by the provided lattice constants and angles

volume

Volume of the unit cell in Å3

reciprocal_volume

Volume of the reciprocal unit cell in (Å-1)3

G

Metric tensor of the real space lattice

Gstar

Metric tensor of the reciprocal lattice

Bmatrix

Cartesian basis matrix in reciprocal units such that

Umatrix

Rotation matrix that rotates the sample’s reference frame into the spectrometer’s

UBmatrix

Orientation matrix of the sample

Methods

get_d_spacing(hkl) Returns the d-spacing of a given reciprocal lattice vector.
get_q(hkl) Returns the magnitude of Q for a given reciprocal lattice vector in Å-1.
get_two_theta(hkl, wavelength) Returns the detector angle 2𝜃 for a given reciprocal lattice vector and incident wavelength.
get_angle_between_planes(v1, v2) Returns the angle \(\phi\) between two reciprocal lattice vectors (or planes as defined by the vectors normal to the plane).
get_phi(Q) Get out-of-plane scattering angle.