pint.toa.TOA

class pint.toa.TOA(MJD, error=0.0, obs='Barycenter', freq=inf, scale=None, flags=None, **kwargs)[source]

Bases: object

A time of arrival (TOA) class.

This is a class for representing a single pulse arrival time measurement. It carries both the time - which needs careful handling as we often need more precision than python floats can provide - and a collection of additional data necessary to work with the data. These are often obtained by reading .tim files produced by pulsar data analysis software, but they can also be constructed as python objects.

Parameters:
  • MJD (astropy.time.Time, float, or tuple of floats) – The time of the TOA, which can be expressed as an astropy Time, a floating point MJD (64 or 80 bit precision), or a tuple of (MJD1,MJD2) whose sum is the full precision MJD (usually the integer and fractional part of the MJD)

  • error (astropy.units.Quantity or float) – The uncertainty on the TOA; if it’s a float it is assumed to be in microseconds

  • obs (str) – The observatory code for the TOA

  • freq (float or astropy.units.Quantity) – Frequency corresponding to the TOA. Either a Quantity with frequency units, or a number for which MHz is assumed.

  • scale (str) – Time scale for the TOA time. Defaults to the timescale appropriate to the site, but can be overridden

  • flags (dict) – Flags associated with the TOA. If flags is not provided, any additional keyword arguments are interpreted as flags.

Variables:

Notes

MJDs will be stored in astropy.time.Time format, and can be passed as a double (not recommended), a string, a tuple of component parts (usually day and fraction of day). error is the TOA uncertainty in microseconds obs is the observatory name as defined by the Observatory class freq is the observatory-centric frequency in MHz other keyword/value pairs can be specified as needed

It is VERY important that all astropy.Time() objects are created with precision=9. This is ensured in the code and is checked for any Time object passed to the TOA constructor.

A discussion of times and clock corrections in PINT is available here: https://github.com/nanograv/PINT/wiki/Clock-Corrections-and-Timescales-in-PINT

Observatory codes are (semi-)standardized short strings describing particular observatories. PINT needs to know considerable additional information about the observatory, including its precise position and clock correction details.

Examples

Constructing a TOA object:

>>> a = TOA((54567, 0.876876876876876), 4.5, freq=1400.0,
...         obs="GBT", backend="GUPPI")
>>> print a
54567.876876876876876:  4.500 us error from 'GBT' at 1400.0000 MHz {'backend': 'GUPPI'}

Methods

as_line([format, name, dm])

Format TOA as a line for a .tim file.

as_line(format='Tempo2', name=None, dm=<Quantity 0. dmu>)[source]

Format TOA as a line for a .tim file.