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:
objectHolds the result of a kinematic diffraction pattern simulation.
- Parameters:
- coordinatesarray_like,
shape[n_points, 2] The x-y coordinates of points in reciprocal space.
- indicesarray_like,
shape[n_points, 3] The indices of the reciprocal lattice points that intersect the Ewald sphere.
- intensitiesarray_like,
shape[n_points, ] The intensity of the reciprocal lattice points.
- calibration
floatortupleoffloat,optional The x- and y-scales of the pattern, with respect to the original reciprocal angstrom coordinates.
- offset
tupleoffloat,optional The x-y offset of the pattern in reciprocal angstroms. Defaults to zero in each direction.
- coordinatesarray_like,
Attributes
ndarray : Coordinates converted into pixel space.
tuple of float : The x- and y-scales of the pattern, with respect to the original reciprocal angstrom coordinates.
ndarray : The coordinates of all unmasked points.
ndarray : If with_direct_beam is True, returns a True array for all points.
ndarray : 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