def post_process_headways(avg_headway, number_of_trips_per_hour, trip_per_hr_threshold=.5,
                          reset_headway_if_low_trip_count=180):
    """Used to adjust headways if there are low trips per hour observed in the GTFS dataset.
    If the number of trips per hour is below the trip frequency interval, headways are changed to
    reset_headway_if_low_trip_count_value (defaults to 180 minutes)."""
    if number_of_trips_per_hour <= trip_per_hr_threshold:  # If Number of Trips Per Hour is less than .5, set to 180.
        avg_headway = reset_headway_if_low_trip_count
    return avg_headway