def correct_negative_bg(y_bg_rm, bg):
    """
    function to shift the bg and the y data with the bg removed up if there are negative values.
    :param y_bg_rm: the y data with bg removed
    :param bg: the bg as an np array
    :return:
    """
    y_min = y_bg_rm.min()
    if y_min < 0:
        y_bg_rm += abs(y_min)
        bg -= abs(y_min)
    return y_bg_rm, bg
