def find_dist_class(dist, dist_limit):
    """
    Decide the BAL class based on the input distance and the distance
    upper-limit for each BAL class.

    :param dist: `float` the horizontal distance from POI
    :param dist_limit: `list` the upper-limit for each BAL class

    :return: `int` the distance class defined in bal_database.py
    """

    if dist < dist_limit[0]:
        dist_class = 1
    elif dist < dist_limit[1]:
        dist_class = 2
    elif dist < dist_limit[2]:
        dist_class = 3
    elif dist < dist_limit[3]:
        dist_class = 4
    else:
        dist_class = 5

    return dist_class