add_shot_noise#

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

Applies shot noise to a pattern

Parameters:
patternnumpy.ndarray

The diffraction pattern at the detector

seedint or None

seed value for the random number generator

Returns:
shotted_patternnumpy.ndarray

A single sample of the pattern after accounting for shot noise

Notes

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