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

DiffractionSimulation.calibrated_coordinates

Coordinates converted into pixel space.

DiffractionSimulation.calibration

The x- and y-scales of the pattern, with respect to the original reciprocal angstrom coordinates.

DiffractionSimulation.coordinates

The coordinates of all unmasked points.

DiffractionSimulation.direct_beam_mask

If with_direct_beam is True, returns a True array for all points.

DiffractionSimulation.indices

DiffractionSimulation.intensities

The intensities of all unmasked points.

DiffractionSimulation.size

Methods

DiffractionSimulation.deepcopy()

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

DiffractionSimulation.get_diffraction_pattern([...])

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

DiffractionSimulation.rotate_shift_coordinates(angle)

Rotate, flip or shift patterns in-plane