Orientation Reflection#
An orientation reflection is a peak intensity (typically an observation) due to diffraction from a specific orientation of a crystalline sample with respect to the incident radiation. The reflection occurs for a precise alignment of the sample’s crystalline planes and diffractometer axes with the incoming radiation.
The coordinates of two (or more) reflections are used to compute a sample’s \(UB\) orientation matrix. \(UB\) transforms between the sample’s crystallographic axes (reciprocal-space) and the diffractometer’s physical axes (real-space).
Each reflection is defined by:
full set of diffractometer angles - real axes
reciprocal-space coordinates - pseudo axes
wavelength of the incident radiation
Note that the engineering units for the pseudo axes are the reciprocal of the units of the wavelength (where angstroms is typical). The angles are reported in degrees.
Source Code Documentation#
Coordinates of a crystalline reflection.
Associates diffractometer angles (real-space) with crystalline reciprocal-space (pseudo) coordinates.
|
Coordinates real and pseudo axes. |
|
Custom exceptions from |
|
Dictionary of Reflections. |
Identifies an unused reflection in the ReflectionsDict. |
- class hklpy2.operations.reflection.Reflection(name: str, pseudos: dict, reals: dict, wavelength: float, geometry: str, pseudo_axis_names: list, real_axis_names: list, digits: int = 4)[source]#
Bases:
object
Coordinates real and pseudo axes.
Note
Internal use only.
It is expected this internal routine is called from a method of
Operations
, not directly by the user.Parameters
name
(str): Reference name for this reflection.pseudos
(dict): Unordered dictionary of pseudo-space axes and values.reals
(dict): Unordered dictionary of real-space axes and values.wavelength
(float): Wavelength of incident radiation.geometry
(str): Geometry name for this reflection.pseudo_names
([str]): Ordered list of pseudo names for this geometry.rnames
([str]): Ordered list of real names for this geometry.
Optional items (such as ‘azimuth’, ‘h1’, ‘h2’, zones, …) are not part of a “reflection”.
__eq__
(r2)Compare this reflection with another for equality.
_asdict
()Describe this reflection as a dictionary.
_fromdict
(config)Redefine this reflection from a (configuration) dictionary.
_validate_pseudos
(value)Raise Exception if pseudos do not match expectations.
_validate_reals
(value)Raise Exception if reals do not match expectations.
_validate_wavelength
(value)Raise exception if pseudos do not match expectations.
Ordered dictionary of diffractometer's reciprocal-space axes.
Ordered dictionary of diffractometer's real-space axes.
Wavelength of reflection.
- property name#
Sample name.
- property pseudos#
Ordered dictionary of diffractometer’s reciprocal-space axes.
Dictionary keys are the axis names, as defined by the diffractometer.
- property reals#
Ordered dictionary of diffractometer’s real-space axes.
Dictionary keys are the axis names, as defined by the diffractometer.
- property wavelength#
Wavelength of reflection.
- class hklpy2.operations.reflection.ReflectionsDict(*args, **kwargs)[source]#
Bases:
dict
Dictionary of Reflections.
_asdict
()Describe the reflections list as an ordered dictionary.
_fromdict
(config)Add or redefine reflections from a (configuration) dictionary.
_validate_reflection
(reflection, replace)Validate the new reflection.
add
(reflection[, replace])Add a single orientation reflection.
Ordered list of reflection names used for orientation.
prune
()Remove any undefined reflections from order list.
set_orientation_reflections
(reflections)Designate the order of the reflections to be used.
setor
(reflections)Common alias for
set_orientation_reflections()
.swap
()Swap the two named orientation reflections.
- _asdict()[source]#
Describe the reflections list as an ordered dictionary.
Order by reflections order.
- add(reflection: Reflection, replace: bool = False) None [source]#
Add a single orientation reflection.
- clear() None. Remove all items from D. #
- copy() a shallow copy of D #
- fromkeys(value=None, /)#
Create a new dictionary with keys from iterable and values set to value.
- get(key, default=None, /)#
Return the value for key if key is in the dictionary, else default.
- items() a set-like object providing a view on D's items #
- keys() a set-like object providing a view on D's keys #
- property order#
Ordered list of reflection names used for orientation.
- pop(k[, d]) v, remove specified key and return the corresponding value. #
If the key is not found, return the default if given; otherwise, raise a KeyError.
- popitem()#
Remove and return a (key, value) pair as a 2-tuple.
Pairs are returned in LIFO (last-in, first-out) order. Raises KeyError if the dict is empty.
- set_orientation_reflections(reflections: list[Reflection]) None [source]#
Designate the order of the reflections to be used.
Note
Raises
KeyError
if anyreflections
are not already defined.This method does not add any new reflections.
Parameters
reflections
([Reflection]) : List ofhklpy2.operations.reflection.Reflection
objects.
- setdefault(key, default=None, /)#
Insert key with a value of default if key is not in the dictionary.
Return the value for key if key is in the dictionary, else default.
- setor(reflections: list[Reflection]) None #
Common alias for
set_orientation_reflections()
.
- update([E, ]**F) None. Update D from dict/iterable E and F. #
If E is present and has a .keys() method, then does: for k in E: D[k] = E[k] If E is present and lacks a .keys() method, then does: for k, v in E: D[k] = v In either case, this is followed by: for k in F: D[k] = F[k]
- values() an object providing a view on D's values #
- hklpy2.operations.reflection.UNUSED_REFLECTION = 'unused'#
Identifies an unused reflection in the ReflectionsDict.