combflagstack

sofia_redux.spectroscopy.combflagstack.combflagstack(stack, nbits=8, axis=0)[source]

Combine bit-set flag arrays.

Parameters:
stackarray_like of int

(n_stack, mask_shape) The _stack of bit-set flag arrays to combine. The _stack can either be a _stack of spectra (n_spectrum, n_data) or a _stack of images (n_images, nrow, ncol).

nbitsint, optional

The number of bits that can potentially be set. This function assumes the bits are set sequentially, starting with the zeroth bit. So if nbits is 2, then it will check the 0th and 1st bit. The default is to check all eight bits.

axisint, optional

Axis along which to perform the combination.

Returns:
numpy.ndarray of int

The bit-set flag array that reflects the bit-set flags from all of the spectra or images.