DiffractionSimulation#
- class diffsims.sims.diffraction_simulation.DiffractionSimulation(coordinates, indices=None, intensities=None, calibration=None, offset=(0.0, 0.0), with_direct_beam=False)[source]#
Bases:
object
Holds the result of a kinematic diffraction pattern simulation.
- Parameters:
coordinates (array-like, shape [n_points, 2]) – The x-y coordinates of points in reciprocal space.
indices (array-like, shape [n_points, 3]) – The indices of the reciprocal lattice points that intersect the Ewald sphere.
intensities (array-like, shape [n_points, ]) – The intensity of the reciprocal lattice points.
calibration (float or tuple of float, optional) – The x- and y-scales of the pattern, with respect to the original reciprocal angstrom coordinates.
offset (tuple of float, optional) – The x-y offset of the pattern in reciprocal angstroms. Defaults to zero in each direction.
Attributes
Coordinates converted into pixel space.
The x- and y-scales of the pattern, with respect to the original reciprocal angstrom coordinates.
The coordinates of all unmasked points.
If with_direct_beam is True, returns a True array for all points.
The intensities of all unmasked points.
Methods
DiffractionSimulation.extend
(other)Add the diffraction spots from another DiffractionSimulation
DiffractionSimulation.get_as_mask
(shape[, ...])Return the diffraction pattern as a binary mask of type bool
Returns the diffraction data as a numpy array with two-dimensional Gaussians representing each diffracted peak.
DiffractionSimulation.plot
([size_factor, ...])A quick-plot function for a simulation of spots
Rotate, flip or shift patterns in-plane