hexrd.phase_transition.texture.uniform_odf module

Uniform Orientation Distribution Function (ODF)

Implements a constant ODF representing completely random texture where all orientations are equally likely. The uniform ODF has a constant value of 1 MRD (multiples of a random distribution), the standard normalization for texture analysis on SO(3).

class hexrd.phase_transition.texture.uniform_odf.UniformODF(crystal_symmetry: str | ndarray | None = None, sample_symmetry: str | ndarray | None = None)[source]

Bases: object

Uniform (random) orientation distribution function.

Represents a completely isotropic texture where all crystal orientations are equally likely. The value is constant at 1 MRD (multiples of a random distribution), the standard normalization where the uniform distribution serves as the reference density.

Parameters

crystal_symmetrystr or numpy.ndarray, optional

Crystal symmetry as a Laue group label (‘ci’, ‘c2h’, ‘d2h’, ‘c4h’, ‘d4h’, ‘s6’, ‘d3d’, ‘c6h’, ‘d6h’, ‘th’, ‘oh’) or a quaternion symmetry array. Validated but inert (the value is 1 MRD regardless); default None.

sample_symmetrystr or numpy.ndarray, optional

Sample symmetry as a label (‘triclinic’, ‘monoclinic’, ‘orthorhombic’) or a quaternion array. Validated but inert; default None.

Attributes

valuefloat

Constant ODF value = 1.0 (MRD)

crystal_symmetrystr or None

Crystal symmetry label, or None if unset or given as an array

sample_symmetrystr or None

Sample symmetry label, or None if unset or given as an array

Examples

>>> odf = UniformODF('d6h', 'triclinic')  # hexagonal crystal
>>> orientations = np.eye(3).reshape(1, 3, 3)
>>> values = odf.eval(orientations)
>>> print(values[0])  # 1.0
property crystal_symmetry: str | None

Crystal symmetry label, or None if unset or given as an array.

eval(orientations: ndarray) float | ndarray[source]

Evaluate uniform ODF at given orientations.

For a uniform ODF, all orientations return 1.0 MRD (multiples of a random distribution).

Parameters

orientationsarray_like

Orientation matrices. Can be: - Single 3x3 rotation matrix - Array of shape (N, 3, 3) for N orientations - Any shape ending in (3, 3) for rotation matrices

Returns

float or numpy.ndarray

ODF values, all equal to 1.0 (MRD). A scalar float for a single (3, 3) orientation; otherwise an array whose shape matches the leading dimensions of the input.

Examples

>>> odf = UniformODF('oh', 'triclinic')
>>>
>>> # Single orientation
>>> R = np.eye(3)
>>> value = odf.eval(R)  # scalar
>>>
>>> # Multiple orientations
>>> Rs = np.array([np.eye(3), np.eye(3)])  # shape (2, 3, 3)
>>> values = odf.eval(Rs)  # shape (2,)
property sample_symmetry: str | None

Sample symmetry label, or None if unset or given as an array.

property value: float

Constant ODF value in MRD.