phantom#

Phantom microstructures for testing: grains, misoriented cells and twins, on a reconstruction grid.

Functions

axis_angle(axis, angle_deg)

Rotation matrices about axes by angles (right-handed).

brownian_field(xy, step, scale, rms_deg, rng)

Sample a 2D Brownian random field of rotation vectors: increments grow like a random walk with distance.

polycrystal(n, step, radius, n_grains[, ...])

Make a disk-shaped polycrystal of grains with misoriented cells and twin lamellae.

random_rotations(n, rng)

Draw rotations uniformly over SO(3).

small_rotations(n, sigma_deg, rng)

Draw small rotations: rotation vectors with each component normal with standard deviation sigma_deg.

tensormap(ph, lattice_parameters, ...)

Turn a phantom from polycrystal() into a single-phase ImageD11 TensorMap, with its truth maps.

voronoi(xy, seeds)

Label points by their nearest seed.