def get_age(Rec, sitekey, keybase, Ages, DefaultAge):
    """
    finds the age record for a given site
    """
    site = Rec[sitekey]
    gotone = 0
    if len(Ages) > 0:
        for agerec in Ages:
            if agerec['er_site_name'] == site:
                if 'age' in list(agerec.keys()) and agerec['age'] != '':
                    Rec[keybase + 'age'] = agerec['age']
                    gotone = 1
                if 'age_unit' in list(agerec.keys()):
                    Rec[keybase + 'age_unit'] = agerec['age_unit']
                if 'age_sigma' in list(agerec.keys()):
                    Rec[keybase + 'age_sigma'] = agerec['age_sigma']
    if gotone == 0 and len(DefaultAge) > 1:
        sigma = 0.5 * (float(DefaultAge[1]) - float(DefaultAge[0]))
        age = float(DefaultAge[0]) + sigma
        Rec[keybase + 'age'] = '%10.4e' % age
        Rec[keybase + 'age_sigma'] = '%10.4e' % sigma
        Rec[keybase + 'age_unit'] = DefaultAge[2]
    return Rec
