def unixtime2mjd(unixtime):
    """
    Converts a UNIX time stamp in Modified Julian Day

    Input:  time in UNIX seconds
    Output: time in MJD (fraction of a day)

    """

    # unixtime gives seconds passed since "The Epoch": 1.1.1970 00:00
    # MJD at that time was 40587.0

    result = 40587.0 + unixtime / (24. * 60. * 60.)
    return result