def make_pixel_mask(steps, shift, default=<NUM_LIT:0>, value=<NUM_LIT:1>, enable_columns=None, mask=None):
shape = (<NUM_LIT>, <NUM_LIT>)<EOL>mask_array = np.full(shape, default, dtype=np.uint8)<EOL>if enable_columns:<EOL><INDENT>odd_columns = [odd - <NUM_LIT:1> for odd in enable_columns if odd % <NUM_LIT:2> != <NUM_LIT:0>]<EOL>even_columns = [even - <NUM_LIT:1> for even in enable_columns if even % <NUM_LIT:2> == <NUM_LIT:0>]<EOL><DEDENT>else:<EOL><INDENT>odd_columns = range(<NUM_LIT:0>, <NUM_LIT>, <NUM_LIT:2>)<EOL>even_columns = range(<NUM_LIT:1>, <NUM_LIT>, <NUM_LIT:2>)<EOL><DEDENT>odd_rows = np.arange(shift % steps, <NUM_LIT>, steps)<EOL>even_row_offset = ((steps // <NUM_LIT:2>) + shift) % steps  <EOL>even_rows = np.arange(even_row_offset, <NUM_LIT>, steps)<EOL>if odd_columns:<EOL><INDENT>odd_col_rows = itertools.product(odd_columns, odd_rows)  <EOL>for odd_col_row in odd_col_rows:<EOL><INDENT>mask_array[odd_col_row[<NUM_LIT:0>], odd_col_row[<NUM_LIT:1>]] = value  <EOL><DEDENT><DEDENT>if even_columns:<EOL><INDENT>even_col_rows = itertools.product(even_columns, even_rows)<EOL>for even_col_row in even_col_rows:<EOL><INDENT>mask_array[even_col_row[<NUM_LIT:0>], even_col_row[<NUM_LIT:1>]] = value<EOL><DEDENT><DEDENT>if mask is not None:<EOL><INDENT>mask_array = np.ma.array(mask_array, mask=mask, fill_value=default)<EOL>mask_array = mask_array.filled()<EOL><DEDENT>return mask_array<EOL>
Generate pixel mask.

    Parameters
    ----------
    steps : int
        Number of mask steps, e.g. steps=3 (every third pixel is enabled), steps=336 (one pixel per column), steps=672 (one pixel per double column).
    shift : int
        Shift mask by given value to the bottom (towards higher row numbers). From 0 to (steps - 1).
    default : int
        Value of pixels that are not selected by the mask.
    value : int
        Value of pixels that are selected by the mask.
    enable_columns : list
        List of columns where the shift mask will be applied. List elements can range from 1 to 80.
    mask : array_like
        Additional mask. Must be convertible to an array of booleans with the same shape as mask array. True indicates a masked (i.e. invalid) data. Masked pixels will be set to default value.

    Returns
    -------
    mask_array : numpy.ndarray
        Mask array.

    Usage
    -----
    shift_mask = 'enable'
    steps = 3 # three step mask
    for mask_step in range(steps):
        commands = []
        commands.extend(self.register.get_commands("ConfMode"))
        mask_array = make_pixel_mask(steps=steps, step=mask_step)
        self.register.set_pixel_register_value(shift_mask, mask_array)
        commands.extend(self.register.get_commands("WrFrontEnd", same_mask_for_all_dc=True, name=shift_mask))
        self.register_utils.send_commands(commands)
        # do something here