def get_threshold(data_vals):
    """
    Find a reasonable threshold to use based on the data values
    """
    pend_len, time_vals, sens_vals = data_vals
    max_value = sens_vals.max()
    min_value = sens_vals.min()
    threshold = 0.5*(max_value + min_value)
    return threshold