PulsarMJD special time format.

MJDs seem simple but if you want to use them with the UTC time scale you have to deal with the fact that every so often a UTC day is either 86401 or 86399 seconds long. astropy.time.Time has a policy on how to interpret MJDs in UTC, and in that time scale all times can be expressed in MJD, but the rate at which MJDs advance is not one day per 86400 SI seconds. (This technique, when applied to UNIX time, is called a “leap_smear” and is used by all Google APIs.) This is not how (some? all?) observatories construct the MJDs they record; observatories record times by converting UNIX time to MJDs in a way that ignores leap seconds; this means that there is more than one time that will produce the same MJD on a leap second day. (Observatories usually use a maser to keep very accurate time, but this is used only to identify the beginnings of seconds; NTP is used to determine which second to record.) We therefore introduce the “pulsar_mjd” time format to capture the way in which our data actually occurs.

An MJD expressed in the “pulsar_mjd” time scale will never occur during a leap second. No negative leap seconds have yet been inserted, that is, all days have been either 86400 or 86401 seconds long. If a negative leap second does occur, it is not totally clear what will happen if an MJD is provided that corresponds to a nonexistent time.

This is not a theoretical consideration: at least one pulsar observer was observing the sky at the moment a leap second was introduced.



Return a numpy long double scalar form different type of data

day_frac(val1, val2[, factor, divisor])

Return the sum of val1 and val2 as two float64s.


Convert Fortran-format floating-point strings.

jds_to_mjds(jd1, jd2)

jds_to_mjds_pulsar(jd1, jd2)


Convert numpy longdouble to string.

mjds_to_jds(mjd1, mjd2)

mjds_to_jds_pulsar(mjd1, mjd2)

mjds_to_str(mjd1, mjd2)


Return a astropy.units.Quantity containing a numpy long double scalar from a different dtype

safe_kind_conversion(values, dtype)


Split float64 in two aligned parts.


Return a long double from the input string.


time_from_longdouble(t[, scale, format])

time_from_mjd_string(s[, scale, format])

Returns an astropy Time object generated from a MJD string input.


Return an astropy Time value as MJD in longdouble


Print an MJD time with lots of digits.

two_product(a, b)

Multiple a and b exactly, returning the result as two float64s.

two_sum(a, b)

Add a and b exactly, returning the result as two float64s.


MJDLong(val1, val2, scale, precision, ...[, ...])

Support conversion of MJDs to and from extended precision.

MJDString(val1, val2, scale, precision, ...)

Support full-accuracy reading and writing of MJDs in string form.

PulsarMJD(val1, val2, scale, precision, ...)

Change handling of days with leap seconds.

PulsarMJDLong(val1, val2, scale, precision, ...)

Support conversion of pulsar MJDs to and from extended precision.

PulsarMJDString(val1, val2, scale, ...[, ...])

Support full-accuracy reading and writing of pulsar MJDs in string form.