add_shot_noise#

diffsims.pattern.detector_functions.add_shot_noise(pattern, seed=None)[source]#

Applies shot noise to a pattern

Parameters:
  • pattern (numpy.ndarray) – The diffraction pattern at the detector

  • seed (int or None) – seed value for the random number generator

Returns:

shotted_pattern – A single sample of the pattern after accounting for shot noise

Return type:

numpy.ndarray

Notes

This function will (as it should) behave differently depending on the pattern intensity, so be mindful to put your intensities in physical units