| |
- builtins.object
-
- CrystalOrientation
- Orientation
class CrystalOrientation(builtins.object) |
|
CrystalOrientation(lattice_parameters=(), *args, **kwargs)
CrystalOrientation Class
Define an orientation matrix in the diffractometer frame
Diffractometer frame according to Fig. 1, H. You, J. Appl. Cryst 32 (1999), 614-623
z-axis : axis parallel to the phi rotation axis when all angles 0 (towards wall (+x) in lab frame)
x-axis : vector normal to phi axis where phi=0 (toward ceiling (+y) in lab frame)
y-axis : vector normal to x,z axes (parallel to beam (+z) in lab frame) |
|
Methods defined here:
- __init__(self, lattice_parameters=(), *args, **kwargs)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self)
- Return repr(self).
- __str__(self)
- Return str(self).
- bmatrix(self)
- Return the B matrix from Busing & Levy in the diffractometer frame
- diff6circle2hkl(self, phi=0, chi=0, eta=0, mu=0, delta=0, gamma=0, energy_kev=None, wavelength=1.0)
- Return [h,k,l] position of diffractometer axes at given energy
:param phi: float sample angle in degrees
:param chi: float sample angle in degrees
:param eta: float sample angle in degrees
:param mu: float sample angle in degrees
:param delta: float detector angle in degrees
:param gamma: float detector angle in degrees
:param energy_kev: float energy in KeV
:param wavelength: float wavelength in A
:return: [h,k,l]
- lp(self)
- Return tuple of lattice parameters in angstroms and degrees
- lp_star(self)
- Return tuple of reciprocal lattice parameters in inverse-angstroms and degrees
- realspace(self, uvw)
- Generate vector in real space from uvw = [u*a, v*b, w*c]
- reciprocal_unit_vectors(self)
- Return unit vectors in recirpocal space [a*, b*, c*]
- recspace(self, hkl)
- Generate vector in reciprocal space from hkl = [h*a*, k*b*, l*c*]
- set_latt(self, a=None, b=None, c=None, alpha=None, beta=None, gamma=None)
- Set or change lattice parameters
- ubmatrix(self)
- Return UB matrix from Busing & Levy in the diffractometer frame
- unit_vectors(self)
- Return real space unit vectors [a, b, c]
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Orientation(builtins.object) |
|
Orientation(umatrix=None, rotation=None, labframe=None)
CrystalOrientation Class
Contains [3*3] matrices to control the orientation of a crystal in space
The crystal is initially defined in the "Diffractometer Frame"
"umatrix" controls the initial alignment of the cell with respect to this frame
"rotation" rotates the cell as if on a diffractometer
"labframe" is a transformation matrix from the "Diffractometer Frame" to a frame of your choice
E.G.
o = Orientation()
o.orient(a_axis=[1,0,0], c_axis=[0,0,1])
o.rotate_6circle(chi=90, eta=20)
o.set_lab_i16()
o([0,0,1])
returns > [ 0. , 0.9397, -0.342 ]
--- The Diffractometer Frame ---
Diffractometer frame according to Fig. 1, H. You, J. Appl. Cryst 32 (1999), 614-623
z-axis : axis parallel to the phi rotation axis when all angles 0 (towards wall (+x) in lab frame)
x-axis : vector normal to phi axis where phi=0 (toward ceiling (+y) in lab frame)
y-axis : vector normal to x,z axes (parallel to beam (+z) in lab frame) |
|
Methods defined here:
- __call__(self, vec)
- Call self as a function.
- __init__(self, umatrix=None, rotation=None, labframe=None)
- Initialize self. See help(type(self)) for accurate signature.
- __repr__(self)
- Return repr(self).
- __str__(self)
- Return str(self).
- clear(self)
- Clear orientation
- diff6circle(self, delta=0, gamma=0, energy_kev=None, wavelength=1.0)
- Calcualte wavevector in diffractometer axis using detector angles
:param delta: float angle in degrees in vertical direction (about diff-z)
:param gamma: float angle in degrees in horizontal direction (about diff-x)
:param energy_kev: float energy in KeV
:param wavelength: float wavelength in A
:param lab: [3*3] lab transformation matrix
:return: q[1*3], ki[1*3], kf[1*3]
- orient(self, a_axis=None, b_axis=None, c_axis=None)
- Set orientation matrix from directions of crystal axes
- random_orientation(self, a_axis=None, b_axis=None, c_axis=None)
- Set a random orientation matrix
- rotate_6circle(self, phi=0, chi=0, eta=0, mu=0)
- Set rotation matrix using 6-circle diffractometer axes
- set_lab(self, lab)
- Set transformation matrix between diffractometer and lab
- set_lab_i16(self)
- Set lab transformation matrix for beamline I16 at Diamond Light Source
- set_r(self, rotation)
- Set rotation matrix in diffractometer frame
- set_u(self, umatrix)
- Set oritenation matrix in diffractometer frame
- vector(self, vec)
- Return vector transformed by orientation, rotation and lab transformation
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
| |