def interpret_pixel_data(data, dc, pixel_array, invert=True):
<EOL>index_value = np.where(is_address_record(data))[<NUM_LIT:0>] + <NUM_LIT:1>  <EOL>index_value = index_value[is_value_record(data[index_value])]  <EOL>index_address = index_value - <NUM_LIT:1>  <EOL>address = get_address_record_address(data[index_address])<EOL>value = get_value_record(data[index_address + <NUM_LIT:1>])<EOL>address_split = np.array_split(address, np.where(np.diff(address.astype(np.int32)) < <NUM_LIT:0>)[<NUM_LIT:0>] + <NUM_LIT:1>)<EOL>value_split = np.array_split(value, np.where(np.diff(address.astype(np.int32)) < <NUM_LIT:0>)[<NUM_LIT:0>] + <NUM_LIT:1>)<EOL>if len(address_split) > <NUM_LIT:5>:<EOL><INDENT>pixel_array.mask[dc * <NUM_LIT:2>, :] = True<EOL>pixel_array.mask[dc * <NUM_LIT:2> + <NUM_LIT:1>, :] = True<EOL>logging.warning('<STR_LIT>', dc)<EOL>return<EOL><DEDENT>mask = np.empty_like(pixel_array.data)  <EOL>mask[:] = len(address_split)<EOL>for bit, (bit_address, bit_value) in enumerate(zip(address_split, value_split)):  <EOL><INDENT>if len(bit_address) == <NUM_LIT:0>:<EOL><INDENT>logging.warning('<STR_LIT>', dc)<EOL>continue<EOL><DEDENT>if len(bit_address) != <NUM_LIT>:<EOL><INDENT>logging.warning('<STR_LIT>', dc)<EOL><DEDENT>if (np.any(bit_address > <NUM_LIT>)):<EOL><INDENT>RuntimeError('<STR_LIT>', dc)<EOL><DEDENT>pixel = []<EOL>for i in bit_address:<EOL><INDENT>pixel.extend(range(i - <NUM_LIT:15>, i + <NUM_LIT:1>))<EOL><DEDENT>pixel = np.array(pixel)<EOL>value_new = bit_value.view(np.uint8)  <EOL>if invert:<EOL><INDENT>value_new = np.invert(value_new)  <EOL><DEDENT>value_new = np.insert(value_new[::<NUM_LIT:4>], np.arange(len(value_new[<NUM_LIT:1>::<NUM_LIT:4>])), value_new[<NUM_LIT:1>::<NUM_LIT:4>])  <EOL>value_bit = np.unpackbits(value_new, axis=<NUM_LIT:0>)<EOL>if len(address_split) == <NUM_LIT:5>:  <EOL><INDENT>bit_set = len(address_split) - bit - <NUM_LIT:1><EOL><DEDENT>else:<EOL><INDENT>bit_set = bit<EOL><DEDENT>pixel_array.data[dc * <NUM_LIT:2>, pixel[pixel >= <NUM_LIT>] - <NUM_LIT>] = np.bitwise_or(pixel_array.data[dc * <NUM_LIT:2>, pixel[pixel >= <NUM_LIT>] - <NUM_LIT>], np.left_shift(value_bit[pixel >= <NUM_LIT>], bit_set))<EOL>pixel_array.data[dc * <NUM_LIT:2> + <NUM_LIT:1>, pixel[pixel < <NUM_LIT>]] = np.bitwise_or(pixel_array.data[dc * <NUM_LIT:2> + <NUM_LIT:1>, pixel[pixel < <NUM_LIT>]], np.left_shift(value_bit[pixel < <NUM_LIT>], bit_set)[::-<NUM_LIT:1>])<EOL>mask[dc * <NUM_LIT:2>, pixel[pixel >= <NUM_LIT>] - <NUM_LIT>] = mask[dc * <NUM_LIT:2>, pixel[pixel >= <NUM_LIT>] - <NUM_LIT>] - <NUM_LIT:1><EOL>mask[dc * <NUM_LIT:2> + <NUM_LIT:1>, pixel[pixel < <NUM_LIT>]] = mask[dc * <NUM_LIT:2> + <NUM_LIT:1>, pixel[pixel < <NUM_LIT>]] - <NUM_LIT:1><EOL><DEDENT>pixel_array.mask[np.equal(mask, <NUM_LIT:0>)] = False<EOL>
Takes the pixel raw data and interprets them. This includes consistency checks and pixel/data matching.
    The data has to come from one double column only but can have more than one pixel bit (e.g. TDAC = 5 bit).

    Parameters
    ----------
    data : numpy.ndarray
        The raw data words.
    dc : int
        The double column where the data is from.
    pixel_array : numpy.ma.ndarray
        The masked numpy.ndarrays to be filled. The masked is set to zero for pixels with valid data.
    invert : boolean
        Invert the read pixel data.