morphogen.texture

Crystallographic textures: the orientations of the crystals of a polycrystal — measured (the maps of electron backscatter diffraction, morphogen.io.ebsd) or computed (the lattices that slip and twins turn along a loading path) —, their symmetries, their disorientations, and the figures that show them.

Orientations are Bunge Euler angles (phi1, Phi, phi2) in degrees, an array (n, 3), or the matrices g of morphogen.orientations.euler_to_matrix(), an array (n, 3, 3): crystal = g @ sample, the rows of g are the axes of the crystal in those of the sample. The axes of the crystal are those of morphogen.homogenization.crystal: the edges of the cube; for a hexagonal lattice, a_1 = [2 -1 -1 0] along the first axis and c along the third.

Symmetries. A crystal turned by a rotation S of its point group is the same crystal: g and S g are one orientation (symmetries(): 24 rotations of the cube, 12 of the hexagonal prism, and those of the nine other Laue classes).

Disorientation. The rotation that brings the axes of a crystal a onto those of a crystal b is g_b g_a^T; their disorientation is the smallest angle of the rotations S g_b g_a^T, S in the group (disorientation()): at most 62.8 degrees for cubic crystals, 93.8 for hexagonal ones. For two cubic crystals of random orientations its density is that of Mackenzie (1958) and Handscomb (1958) (mackenzie()): mean 40.7 degrees.

Pole figures. The normals of the planes {hkl} of a crystal, g^T n in the axes of the sample (poles()), are shown on a disc (project(): stereographic or equal-area projection of the upper hemisphere, the first axis of the sample to the right, the second upwards, the third towards the reader). Their density (pole_figure()) is in multiples of that of a random texture: each pole is spread by an axial von Mises-Fisher kernel of a given half-width, whose mean over the sphere is one, so that the mean of the density over the sphere is one for any texture.

Inverse pole figures. The direction of the crystal that lies along a direction of the sample (the axis of a tension), g d, is brought into the fundamental sector of the lattice by its symmetries (inverse_poles(): the triangle [001], [011], [111] of the cube; the sector between [0001], [2 -1 -1 0] and [1 0 -1 0] of the hexagonal lattice), and gives each crystal a colour (ipf_colours(): red, green and blue at these corners).

morphogen.texture.LATTICES = ('cubic', 'hexagonal')

The lattices whose planes and directions are known (pole figures, inverse pole figures)

morphogen.texture.CLASSES = ('cubic', 'hexagonal', 'tetragonal', 'trigonal', 'orthorhombic', 'monoclinic', 'triclinic', 'm-3', '6/m', '4/m', '-3')

the class of highest symmetry of each system by the name of the system (m-3m, 6/mmm, 4/mmm, -3m, mmm, 2/m and -1), the four others by their symbol

Type:

The eleven Laue classes (symmetries())

morphogen.texture.PROJECTIONS = ('stereographic', 'equal_area')

Projections of the hemisphere on the unit disc

morphogen.texture.IDEAL_RATIO = 1.632993161855452

The ratio c/a of a hexagonal lattice of close-packed spheres (the default of the planes and directions that depend on it)

morphogen.texture.symmetries(lattice: str = 'cubic') → ndarray[source]

The proper rotations of a Laue class, (m, 3, 3), in the axes of the crystal: 24 for "cubic" (m-3m), 12 for "hexagonal" (6/mmm), 8 for "tetragonal" (4/mmm), 6 for "trigonal" (-3m, the three-fold axis along the third axis, a two-fold one along the first), 4 for "orthorhombic" (mmm), 2 for "monoclinic" (2/m, the two-fold axis along the second axis) and the identity alone for "triclinic" (-1); 12 for "m-3" (the rotations of the tetrahedron), and the 6, 4 and 3 rotations about the third axis for "6/m", "4/m" and "-3".

morphogen.texture.disorientation(a, b, lattice: str = 'cubic') → ndarray[source]

The disorientations (degrees) of the crystals a and b of a lattice, pair by pair (as many of each, or one of the two alone: of every crystal from it): the smallest angle of the rotations that bring the one onto the other, over the symmetries of the lattice.

morphogen.texture.mean_orientation(orientations, lattice: str = 'cubic', weights=None)[source]

The mean orientation of crystals that are close to one another (the points of a grain) and their spread: the Euler angles (degrees) of the rotation nearest to the weighted sum of their matrices, each crystal taken as that of its symmetric equivalents which is nearest to the mean (three passes from the crystal of largest weight), and the weighted mean of their disorientations from it (degrees).

morphogen.texture.crystal_axes(indices, lattice: str = 'cubic', *, plane: bool = True, c_over_a: float | None = None) → ndarray[source]

The distinct axes of a family of planes {hkl} (their normals) or of directions <uvw> of a lattice, unit vectors (m, 3) in the axes of the crystal, one for each pair of opposite ones: Miller indices of the cube; Miller-Bravais indices (hkil) of the hexagonal lattice (or three: i = -h - k), of ratio c_over_a (IDEAL_RATIO by default).

morphogen.texture.poles(orientations, indices, lattice: str = 'cubic', *, plane: bool = True, c_over_a: float | None = None) → ndarray[source]

The axes of a family of planes or directions of each crystal in the axes of the sample, unit vectors (n, m, 3): g^T v for each axis v of crystal_axes().

morphogen.texture.project(directions, projection: str = 'stereographic') → ndarray[source]

The points of the unit disc of directions (..., 3) of the sample, folded onto the upper hemisphere (a direction and its opposite are one axis): the first axis of the sample to the right, the second upwards, the third at the centre. At the angle t from the third axis, the radius is tan(t / 2) ("stereographic": angles are kept) or sqrt(2) sin(t / 2) ("equal_area": areas are kept).

morphogen.texture.unproject(points, projection: str = 'stereographic') → ndarray[source]

The directions of the upper hemisphere of points (..., 2) of the unit disc (the inverse of project()).

morphogen.texture.axis_density(directions, axes, weights=None, halfwidth: float = 10.0) → ndarray[source]

The density of axes on the sphere (unit vectors (p, 3), a vector and its opposite being one axis, of weights that sum to one by default) at the directions (q, 3), in multiples of the uniform density: each axis spread by a kernel of half-width halfwidth degrees.

class morphogen.texture.PoleFigure(indices: tuple, lattice: str, plane: bool, projection: str, halfwidth: float, x: ndarray, density: ndarray)[source]

Bases: object

The density of the poles of a family of planes (or of directions) on the disc of a projection, in multiples of that of a random texture.

indices: tuple

The indices of the family, its lattice and whether they are those of planes

projection: str

The projection of the hemisphere, and the half-width (degrees) of the kernel

x: ndarray

The coordinates of the columns and of the rows of the grid, from -1 to 1

density: ndarray

density[i, j] at the point (x[i], x[j]) of the disc; NaN outside it

property maximum: float

The largest density of the figure.

at(direction) → float[source]

The density at the grid point of the disc nearest to a direction of the sample.

morphogen.texture.pole_figure(orientations, indices, lattice: str = 'cubic', *, weights=None, halfwidth: float = 10.0, resolution: int = 101, projection: str = 'equal_area', plane: bool = True, c_over_a: float | None = None) → PoleFigure[source]

The pole figure of a family of planes indices of crystals of a lattice (weights: the volume of each, equal by default): the density of their poles on a grid of resolution points across the disc of a projection, in multiples of that of a random texture, each pole spread by a kernel of half-width halfwidth degrees.

morphogen.texture.fundamental_directions(directions, lattice: str = 'cubic') → ndarray[source]

Directions of a crystal (n, 3) (in its axes) brought into the fundamental sector of the lattice by its symmetries and the inversion: unit vectors with 0 <= x <= y <= z for the cube (the triangle of [001], [011] and [111]); with z >= 0 and an azimuth between 0 ([2 -1 -1 0]) and 30 degrees ([1 0 -1 0]) for the hexagonal lattice.

morphogen.texture.inverse_poles(orientations, direction=(0.0, 0.0, 1.0), lattice: str = 'cubic') → ndarray[source]

The direction of each crystal that lies along a direction of the sample, g d, in the fundamental sector of the lattice (fundamental_directions()): unit vectors (n, 3) in the axes of the crystal.

morphogen.texture.direction_colours(directions, lattice: str = 'cubic') → ndarray[source]

The colours (n, 3) (red, green, blue, from 0 to 1) of directions of a crystal: red, green and blue at the corners of the fundamental sector — [001], [011] and [111] of the cube; [0001], [2 -1 -1 0] and [1 0 -1 0] of the hexagonal lattice — and their mixtures in between, the largest of the three brought to one.

morphogen.texture.ipf_colours(orientations, direction=(0.0, 0.0, 1.0), lattice: str = 'cubic') → ndarray[source]

The colours (n, 3) of crystals by the direction that they have along a direction of the sample (direction_colours() of g d): the colours of an inverse pole figure map.

morphogen.texture.SECTOR_CORNERS = {'cubic': (((0.0, 0.0, 1.0), '001'), ((0.0, 1.0, 1.0), '011'), ((1.0, 1.0, 1.0), '111')), 'hexagonal': (((0.0, 0.0, 1.0), '0001'), ((1.0, 0.0, 0.0), '2-1-10'), ((1.7320508075688772, 1.0, 0.0), '10-10'))}

The corners of the fundamental sector of a lattice (crystal directions), with their names: the colours red, green and blue of direction_colours()

morphogen.texture.sector_points(directions, lattice: str = 'cubic') → ndarray[source]

The points (n, 2) of the fundamental sector, as an inverse pole figure shows it (the stereographic projection about the third axis of the crystal), of directions of a crystal: [001] at the origin, [011] on the first axis and [111] above it for the cube; [0001] at the origin, [2 -1 -1 0] on the first axis and [1 0 -1 0] above it for the hexagonal lattice.

class morphogen.texture.InversePoleFigure(direction: tuple, lattice: str, halfwidth: float, x: ndarray, y: ndarray, density: ndarray)[source]

Bases: object

The density of the directions of the crystals that lie along a direction of the sample, on the fundamental sector of the lattice (the plane of sector_points()), in multiples of that of a random texture.

direction: tuple

The direction of the sample, the lattice and the half-width (degrees) of the kernel

x: ndarray

The coordinates of the columns and of the rows of the grid

density: ndarray

density[i, j] at the point (x[i], y[j]); NaN outside the sector

property maximum: float

The largest density of the figure.

at(direction) → float[source]

The density at the grid point of the sector nearest to a direction of the crystal.

morphogen.texture.inverse_pole_figure(orientations, direction=(0.0, 0.0, 1.0), lattice: str = 'cubic', *, weights=None, halfwidth: float = 10.0, resolution: int = 101) → InversePoleFigure[source]

The inverse pole figure of a direction of the sample (the axis of a tension): the density of the directions g d of the crystals (weights: the volume of each, equal by default) with all their equivalents by the symmetries of the lattice, on a grid of resolution points across the fundamental sector, in multiples of that of a random texture, each direction spread by a kernel of half-width halfwidth degrees.

morphogen.texture.MACKENZIE_ANGLES = (45.0, 60.0, 60.722386809643446, 62.799429619838094)

The angles (degrees) at which the density of Mackenzie changes its expression, and the largest disorientation of two cubic crystals

morphogen.texture.mackenzie(angles) → ndarray[source]

The density, per degree, of the disorientation of two cubic crystals of random orientations (Mackenzie 1958; Handscomb 1958) at angles (degrees): (2/15) (1 - cos t) up to 45 degrees — 24 times the density of the angle of a random rotation —, then less, as the rotations leave the fundamental zone through its faces {100} (45 degrees) and {111} (60 degrees), its edges (60.72) and its corners (62.80, the largest disorientation). Its mean is 40.74 degrees.

morphogen.texture.boundary_disorientations(labels, orientations, lattice: str = 'cubic')[source]

The disorientations across the boundaries of the grains of an image of labels (2D or 3D; negative labels: no grain) whose grains have the given orientations: the pairs of neighbouring grains (b, 2), the number of faces of pixels (voxels) that each pair shares, and its disorientation (degrees).

morphogen.texture.sample_texture(rng: Generator, orientations, n: int, *, weights=None, spread: float = 0.0) → ndarray[source]

n orientations (Euler angles, degrees) drawn from a measured texture: each is one of the given crystals, drawn with its weight (the area of a grain of a map; equal by default), then turned about a random axis by an angle of the half-normal law of standard deviation spread degrees (0: the measured orientations themselves). The crystals of a synthetic polycrystal then have the texture of the map.