def rescale_value(value, current_limits, new_limits):
    """
    Given a value and the limits, rescales the value to the new limits
        input:
            value : float variable containing the value
            current_limits : a tuple containing the lower and upper limits 
                             of the value
            new_limits : a tuple containing the desired lower and upper 
                             limits.
    """
    old_range = current_limits[1] - current_limits[0]
    new_range = new_limits[1] - new_limits[0]

    return (value-current_limits[0]) / old_range * new_range \
            + new_limits[0]