de_twin.crystal.library.CrystalLibrary#

class de_twin.crystal.library.CrystalLibrary(phase, *, max_g_inv_nm=25.0, debye_waller_a2=0.0, scattering_params='lobato', cache_dir=None)[source]#

Bases: object

Reciprocal lattice + kinematic |F|^2 of one phase, computed once.

Parameters:
  • max_g_inv_nm (float)

  • debye_waller_a2 (float)

  • scattering_params (str)

  • cache_dir (str | None)

__init__(phase, *, max_g_inv_nm=25.0, debye_waller_a2=0.0, scattering_params='lobato', cache_dir=None)[source]#
Parameters:
  • max_g_inv_nm (float)

  • debye_waller_a2 (float)

  • scattering_params (str)

  • cache_dir (str | None)

Methods

__init__(phase, *[, max_g_inv_nm, ...])

excite(matrices, wavelength_nm, ...[, ...])

Excited reflections of each crystal->lab matrix (N, 3, 3) at thickness (N,) nm.

extinction_distance_nm(hkl, ht_kv, wavelength_nm)

geometry(matrices, wavelength_nm[, ...])

(owner, index, gx, gy, s) of the reflections near the Ewald sphere for each crystal->lab matrix (N, 3, 3) - the orientation-only part of excite(), sorted by owner.

intensity_at(idx, s, thickness_nm, ht_kv, ...)

Kinematic fraction (pi t / xi_g)^2 <sinc^2> of reflections idx at excitation errors s and thicknesses thickness_nm (all (K,)): the thickness-dependent part of excite(), element by element.

inv_xi(ht_kv, wavelength_nm)

pi / xi_g in 1/nm (xi_g: kinematic extinction distance).

rings(ht_kv, wavelength_nm)

(ring radius g [1/nm], orientation-averaged intensity per nm of thickness) per family.

template_library([resolution_deg, ht_kv, ...])

A diffsims Simulation2D over the reduced fundamental zone (orix get_sample_reduced_fundamental), i.e. an orientation-mapping template library in the twin's own convention (pyxem get_orientation).

inv_xi(ht_kv, wavelength_nm)[source]#

pi / xi_g in 1/nm (xi_g: kinematic extinction distance).

Parameters:
Return type:

ndarray

extinction_distance_nm(hkl, ht_kv, wavelength_nm)[source]#
Parameters:
Return type:

float

geometry(matrices, wavelength_nm, convergence_mrad=0.0)[source]#

(owner, index, gx, gy, s) of the reflections near the Ewald sphere for each crystal->lab matrix (N, 3, 3) - the orientation-only part of excite(), sorted by owner.

Parameters:
intensity_at(idx, s, thickness_nm, ht_kv, wavelength_nm, convergence_mrad=0.0)[source]#

Kinematic fraction (pi t / xi_g)^2 <sinc^2> of reflections idx at excitation errors s and thicknesses thickness_nm (all (K,)): the thickness-dependent part of excite(), element by element.

Parameters:
Return type:

ndarray

excite(matrices, wavelength_nm, thickness_nm, ht_kv, convergence_mrad=0.0, min_intensity=0.0)[source]#

Excited reflections of each crystal->lab matrix (N, 3, 3) at thickness (N,) nm.

thickness_nm may also be (N, T): every orientation at T thicknesses; intensity is then (K, T) and total (N, T) (min_intensity must be 0).

Parameters:
Return type:

Excitation

rings(ht_kv, wavelength_nm)[source]#

(ring radius g [1/nm], orientation-averaged intensity per nm of thickness) per family.

Parameters:
Return type:

tuple[ndarray, ndarray]

template_library(resolution_deg=1.0, ht_kv=200.0, max_excitation_error=0.05, **generator_options)[source]#

A diffsims Simulation2D over the reduced fundamental zone (orix get_sample_reduced_fundamental), i.e. an orientation-mapping template library in the twin’s own convention (pyxem get_orientation).

Parameters: