apply_flag

ska_sdp_func_python.visibility.operations.apply_flag(x: ndarray, flags: ndarray)

Mask an array by applying a binary flag set via element-wise multiplication.

This function computes the product of the input array and the inverse of the flags. It assumes flags are binary (0 or 1), where 1 represents a value to be suppressed (set to 0).

Parameters

xnumpy.ndarray

The input data array containing values to be filtered.

flagsnumpy.ndarray

A binary array of the same shape as x. Elements marked with 1 will result in a 0 in the output array.

Returns

numpy.ndarray

The masked array where elements corresponding to a 1 in flags are zeroed out.