constrain_to_dynamic_range#

diffsims.pattern.detector_functions.constrain_to_dynamic_range(pattern, detector_max=None)[source]#

Force the values within pattern to lie between [0,detector_max]

Parameters:
patternnumpy.ndarray

The diffraction pattern at the detector after corruption

detector_maxfloat

The maximum allowed value at the detector

Returns:
within_range_pattern: numpy.ndarray

The pattern, with values >=0 and =< detector_max