def METHOD_NAME(lens_light, x_grid, y_grid, center_x=0, center_y=0):
    """
    :param lens_light: array of surface brightness
    :param x_grid: x-axis coordinates
    :param y_grid: y-axis coordinates
    :param center_x: center of light
    :param center_y: center of light
    :return:
    """
    lens_light[lens_light < 0] = 0
    total_flux_2 = np.sum(lens_light) / 2.0
    r_max = np.max(np.sqrt((x_grid - center_x) ** 2 + (y_grid - center_y) ** 2))
    for i in range(1000):
        r = i / 500.0 * r_max
        mask = mask_util.mask_azimuthal(x_grid, y_grid, center_x, center_y, r)
        flux_enclosed = np.sum(np.array(lens_light) * mask)
        if flux_enclosed > total_flux_2:
            return r
    return -1