I tried to answer the question in the github issue github.com/pyxem/diffsims/issues/176
The reason it doesn't work is that the calibration parameter of the diffraction pattern is not set. A diffraction pattern in diffsims is represented by a list of
(x, y) coordinates in projected reciprocal space, and an associated intensities
I. Together they represent diffraction spots, and the main purpose of diffsims is to calculate
I in these patterns depending on the microscope conditions (like sample orientation, acceleration voltage, ...) and create libraries of these simulated patterns for template matching (comparing to experimental data). A diffraction pattern can exist "etherially" in reciprocal space coordinates, but to convert them to an image one needs to know the size of a pixel in reciprocal space units. By default, this value is 1 (see https://github.com/pyxem/diffsims/blob/3c2540e520f7c8a6a60d24ec9b88844c4d2c8f83/diffsims/sims/diffraction_simulation.py#L50), meaning that 1 pixel will correspond to 1 angstrom^-1. You are thus creating a diffraction pattern image where all the diffraction spots are all blurred together in the center. In a sense, you just needs to "magnify" the diffraction pattern by setting a different calibration. Before the line
dp= diffraction_pattern.get_diffraction_pattern(size=512, sigma=2)
you should add a line
diffraction_pattern.calibration = #some other value representing the number of angstrom^-1 / pixel
Hope this helps.
Also an important note: since diffraction patterns in diffsims are essentially a structured point cloud, an unprocessed pattern is basically a zero image with some bright pixels. When we collect real diffraction patterns in the microscope, spots have a finite size due to imperfect optics, thermal vibrations, finite sample and beam size, dynamic diffraction,... All these effects are not considered in diffsims, it only uses the kinematical approximation. To make the pattern appear more like experimental patterns, the bright pixels are simply blurred with a 2D gaussian. This is not representative of a physical process and just serves as a sanity check when judging the patterns.