ImageD11.grain module#

ImageD11.grain.e6_to_symm(e)#

Follows the eps convention from xfab eps = [e11, e12, e13, e22, e23, e33]

ImageD11.grain.export_to_vtp_paraview(grains, output_path, colour='npks')#

Export list of grains to vtp file for Paraview visualisation, with helpful arrays included. Thanks to Marilyn Sarkis for the idea.

class ImageD11.grain.grain(ubi, translation=None, **kwds)#

Bases: object

property B#
property Rod#

A Rodriguez vector. Length proportional to angle, direction is axis

property U#

The orientation matrix (U) from Busing and Levy

property UB#

The UB matrix from Busing and Levy columns are the reciprocal space lattice vectors

clear_cache()#
eps_grain(dzero_cell, m=0.5)#
dzero_cell can be another grain or cell parameters

[a,b,c,alpha,beta,gamma]

m is the exponent for the Seth-Hill finite strain tensors E = 1/2m (U^2m - I) (Negative m reverses the reference and lab systems).

Returns eps as a the 6 independent entries in the symmetric matrix

e11 e12 e13 e22 e23 e33

… in the grain reference system of dzero_cell

eps_grain_matrix(dzero_cell, m=0.5)#
dzero_cell can be another grain or cell parameters

[a,b,c,alpha,beta,gamma]

m is the exponent for the Seth-Hill finite strain tensors E = 1/2m (U^2m - I) (Negative m reverses the reference and lab systems).

Returns eps as a symmetric matrix … in the grain reference system of dzero_cell

eps_sample(dzero_cell, m=0.5)#
dzero_cell can be another grain or cell parameters:

[a,b,c,alpha,beta,gamma]

m is the exponent for the Seth-Hill finite strain tensors E = 1/2m (V^2m - I) (Negative m reverses the reference and lab systems).

Returns eps as a the 6 independent entries in the symmetric matrix

e11 e12 e13 e22 e23 e33

… in the sample system (z up, x along the beam at omega=0)

eps_sample_matrix(dzero_cell, m=0.5)#
dzero_cell can be another grain or cell parameters:

[a,b,c,alpha,beta,gamma]

m is the exponent for the Seth-Hill finite strain tensors E = 1/2m (V^2m - I) (Negative m reverses the reference and lab systems).

Returns eps as a symmetric matrix … in the sample system (z up, x along the beam at omega=0)

classmethod from_h5py_group(grain_group)#

Creates a grain object from an h5py group

get_ipf_colour(axis=array([0., 0., 1.]), key='tsl', backend='rgb_colors')#

IPF colour of the grain’s ubi, with the point group of the reference unitcell (ImageD11.unitcell.unitcell.get_ipf_colour_from_ubi), key is “tsl” or “hsv” backend “orix”: unitcell.get_ipf_colour_fast with the grain’s U

property mt#

Metric tensor

property orix_orien#
property orix_phase#

The orix phase for the grain, taken straight from the reference unitcell

property ref_unitcell#

The reference (strain-free) unitcell object for this grain

property rmt#

Reciprocal metric tensor

set_ubi(ubi)#

Update the orientation and clear cached values

to_h5py_group(parent_group, group_name)#

Creates a H5Py group for this grain. parent_group is the parent H5py Group group_name is the name of the H5py Group for this name Very useful for saving lists of grains to an H5 file. Uses require_group to modify existing data if present

property u#
property ub#
property unitcell#

a,b,c,alpha,beta,gamma

ImageD11.grain.read_grain_file(filename)#

read ubifile and return a list of ubi arrays

ImageD11.grain.read_grain_file_h5(filename, group_name='grains')#

Read list of grains from H5py file

ImageD11.grain.save_array(grp, name, ary)#
ImageD11.grain.symm_to_e6(m)#

Follows the eps convention from xfab eps = [e11, e12, e13, e22, e23, e33]

ImageD11.grain.write_grain_file(filename, list_of_grains)#
ImageD11.grain.write_grain_file_h5(filename, list_of_grains, group_name='grains')#

Write list of grains to H5py file.