get_diffraction_pattern#

DiffractionSimulation.get_diffraction_pattern(shape=(512, 512), sigma=10, direct_beam_position=None, in_plane_angle=0, mirrored=False)[source]#

Returns the diffraction data as a numpy array with two-dimensional Gaussians representing each diffracted peak. Should only be used for qualitative work.

Parameters:
shapetuple of ints

The size of a side length (in pixels)

sigmafloat

Standard deviation of the Gaussian function to be plotted (in pixels).

direct_beam_position: 2-tuple of ints, optional

The (x,y) coordinate in pixels of the direct beam. Defaults to the center of the image.

in_plane_angle: float, optional

In plane rotation of the pattern in degrees

mirrored: bool, optional

Whether the pattern should be flipped over the x-axis, corresponding to the inverted orientation

Returns:
diffraction-patternnumpy.array

The simulated electron diffraction pattern, normalised.

Notes

If don’t know the exact calibration of your diffraction signal using 1e-2 produces reasonably good patterns when the lattice parameters are on the order of 0.5nm and a the default size and sigma are used.