def _get_adjustment(mag, year, mmin, completeness_year, t_f, mag_inc=0.1):
    """
    If the magnitude is greater than the minimum in the completeness table
    and the year is greater than the corresponding completeness year then
    return the Weichert factor

    :param float mag:
        Magnitude of an earthquake

    :param float year:
        Year of earthquake

    :param np.ndarray completeness_table:
        Completeness table

    :param float mag_inc:
        Magnitude increment

    :param float t_f:
        Weichert adjustment factor

    :returns:
        Weichert adjustment factor is event is in complete part of catalogue
        (0.0 otherwise)
    """
    if len(completeness_year) == 1:
        if mag >= mmin and year >= completeness_year[0]:
            return 1.0
        else:
            return False
    kval = int((mag - mmin) / mag_inc) + 1
    if kval >= 1 and year >= completeness_year[kval - 1]:
        return t_f
    else:
        return False
