subtract_constant

laserbeamsize.background.subtract_constant(original: ndarray, background: float, iso_noise: bool = True) ndarray[source]

Return image with a constant value subtracted.

Subtract threshold from entire image. If iso_noise is False then negative values are set to zero.

The returned array is an array of float with the shape of original.

Parameters:
  • original – the image to work with

  • background – value to subtract every pixel

  • iso_noise – if True then allow negative pixel values

Returns:

image – 2D float array with constant background subtracted