CBDModel#

class cbclib.CBDModel(basis, sample, setup, transform=None, shape=None)[source]#

Prediction model for Convergent Beam Diffraction (CBD) pattern. The method uses the geometrical schematic of CBD diffraction in the reciprocal space [CBM] to predict a CBD pattern for the given crystalline sample.

Parameters
  • basis (Basis) – Unit cell basis vectors.

  • sample (Sample) – Sample position and orientation.

  • setup (ScanSetup) – Experimental setup.

  • transform (Optional[Transform]) – Any of the image transform objects.

  • shape (Optional[Tuple[int, int]]) – Shape of the detector pixel grid.

References

CBM

Ho, Joseph X et al. “Convergent-beam method in macromolecular crystallography”, Acta crystallographica Section D, Biological crystallography vol. 58, Pt. 12 (2002): 2087-95, https://doi.org/10.1107/s0907444902017511.

filter_hkl(hkl)[source]#

Return a set of reciprocal lattice points that lie in the region of reciprocal space involved in diffraction.

Parameters

hkl (ndarray) – Set of input Miller indices.

Return type

ndarray

Returns

A set of Miller indices.

generate_streaks(hkl, width, hkl_index=False)[source]#

Generate a CBD pattern. Return a set of streaks in cbclib.Streaks container.

Parameters
  • hkl (ndarray) – Set of Miller indices.

  • width (float) – Width of diffraction streaks in pixels.

  • hkl_index (bool) – Save hkl indices in the streaks container if True.

Return type

Streaks

Returns

A set of streaks, that constitute the predicted CBD pattern.

pattern_dataframe(hkl, width, profile='gauss', hkl_index=False)[source]#

Predict a CBD pattern and return in the pandas.DataFrame format.

Parameters
  • hkl (ndarray) – Set of reciprocal lattice point to use for prediction.

  • width (float) – Difrraction streak width in pixels of a predicted pattern.

  • profile (str) –

    Line width profiles. The following keyword values are allowed:

    • tophat : Top-hat (rectangular) function profile.

    • linear : Linear (triangular) function profile.

    • quad : Quadratic (parabola) function profile.

    • gauss : Gaussian function profile.

  • hkl_index (bool) – Save hkl indices in the streaks container if True.

Return type

DataFrame

Returns

A pattern in pandas.DataFrame format.