def mask_images(image_array, correct_mask):
    """
    Apply mask
    :param image_array: input image
    :param correct_mask: 1 for unmasked (visible pixels), 0 for mask
    :return: masked image
    """

    for i in range(len(image_array[:,0,0,0])):
        image_array[i,:,:,0] = image_array[i,:,:,0]*correct_mask

    return image_array