def gps_to_datetime(gps):
    """ conversion between GPS seconds and a python datetime object (taking into account leap seconds) """
    from radiotools import leapseconds
    from datetime import datetime, timedelta
    return leapseconds.gps_to_utc(datetime(1980, 1, 6) + timedelta(seconds=gps)
        )
