def age_to_BP(age, age_unit):
    """
    Convert an age value into the equivalent in time Before Present(BP) where Present is 1950

    Returns
    ---------
    ageBP : number
    """
    ageBP = -1000000000.0
    if age_unit == 'Years AD (+/-)' or age_unit == 'Years Cal AD (+/-)':
        if age < 0:
            age = age + 1
        ageBP = 1950 - age
    elif age_unit == 'Years BP' or age_unit == 'Years Cal BP':
        ageBP = age
    elif age_unit == 'ka':
        ageBP = age * 1000
    elif age_unit == 'Ma':
        ageBP = age * 1000000.0
    elif age_unit == 'Ga':
        ageBP = age * 1000000000.0
    else:
        print('Age unit invalid. Age set to -1.0e9')
    return ageBP
