Simulation2D#
- class diffsims.simulations.Simulation2D(phases: Sequence[Phase], coordinates: DiffractingVector | Sequence[DiffractingVector] | Sequence[Sequence[DiffractingVector]], rotations: Rotation | Sequence[Rotation], simulation_generator: SimulationGenerator, reciprocal_radius: float = 1.0)[source]#
Bases:
objectHolds the result of a kinematic diffraction simulation for some phase and rotation. This class is iterable and can be used to iterate through simulations of different phases and rotations.
Attributes
Returns the number of rotations in the current phase
Returns True if the simulation has multiple phases
Returns True if the simulation has multiple rotations
Returns the number of phases in the simulation
Methods
Returns the coordinates of the current phase and rotation
Returns the current rotation matrix based on the phase and rotation index
Returns the diffraction data as a numpy array with two-dimensional Gaussians representing each diffracted peak.
Return the rotation and the phase index of the simulation
Simulation2D.plot([size_factor, ...])A quick-plot function for a simulation of spots
Simulation2D.plot_rotations(beam_direction)Plots the rotations of the current phase in stereographic projection
Flattens the simulations into polar coordinates for use in template matching.
Rotate, flip or shift patterns in-plane