update_mask

sofia_redux.toolkit.resampling.update_mask(weights, mask)[source]

Updates a mask, setting False values where weights are zero or non-finite.

Utility function update a boolean mask in place given weights. mask values where weights are zero or non-finite will be set to False, and the total number of True values is returned as output.

Parameters:
weightsnumpy.ndarray (N,)

The weight values.

masknumpy.ndarray of bool (N,)

The mask array to update in place.

Returns:
countsint

The number of True mask values following the update.