pint.toa.format_toa_line

pint.toa.format_toa_line(toatime, toaerr, freq, obs, dm=<Quantity 0. dmu>, name='unk', flags={}, format='Princeton', alias_translation=None)[source]

Format TOA line for writing

Parameters:
  • toatime (astropy.time.Time) – Time object containing TOA arrival time

  • toaerr (astropy.units.Quantity) – TOA error as a Quantity with units

  • freq (astropy.units.Quantity) – Frequency as a Quantity with units (NB: value of np.inf is allowed)

  • obs (pint.observatory.Observatory) – Observatory object

  • dm (astropy.units.Quantity) – DM for the TOA as a Quantity with units (not printed if 0.0 pc/cm^3)

  • name (str) – Name to embed in TOA line (conventionally the data file name)

  • format (str) – (Princeton | Tempo2)

  • flags (dict) – Any Tempo2 flags to append to the TOA line

  • alias_translation (dict or None) – Translate observatory names by looking them up in this dictionary; this may be necessary to convert observatory names into something TEMPO can understand, or to cope with different setups using different names for the same observatory or the same name for different observatories. There is a dictionary tempo_aliases available to use names as compatible with TEMPO as possible.

Returns:

out – Formatted TOA line

Return type:

str

Note

This implementation does not undo things like TIME statements; when used by pint.toa.TOAs.write_TOA_file() these commands are not emitted either.

Princeton format:

columns  item
1-1     Observatory (one-character code) '@' is barycenter
2-2     must be blank
16-24   Observing frequency (MHz)
25-44   TOA (decimal point must be in column 30 or column 31)
45-53   TOA uncertainty (microseconds)
69-78   DM correction (pc cm^-3)

Tempo2 format:

  • First line of file should be “FORMAT 1

  • TOA format is name freq sat satErr siteID <flags>