add_dead_pixels#

diffsims.pattern.detector_functions.add_dead_pixels(pattern, n=None, fraction=None, seed=None)[source]#

Adds randomly placed dead pixels onto a pattern

Parameters:
patternnumpy.ndarray

The diffraction pattern at the detector

nint

The number of dead pixels, defaults to None

fractionfloat

The fraction of dead pixels, defaults to None

seedint or None

seed value for the random number generator

Returns:
corrupted_patternnumpy.ndarray

The pattern, with dead pixels included