pint.observatory.clock_file.read_tempo_clock_file

pint.observatory.clock_file.read_tempo_clock_file(filename, obscode=None, bogus_last_correction=False, process_includes=True, friendly_name=None, valid_beyond_ends=False)[source]

Read a TEMPO-format clock file.

This function can also be accessed through pint.observatory.clock_file.ClockFile.read() with the format="tempo2" argument.

All computations here are done as in tempo, with the exception of the ‘F’ flag (to disable interpolation), which is currently not implemented.

INCLUDE statements are processed.

Parameters:
  • filename (str or pathlib.Path or file-like) – The location to obtain the file from.

  • obscode (str or None) – If the obscode argument is set to an appropriate one-character tempo site code, only values for that site will be returned. If the obscode argument is None, the file is assumed to contain only clock corrections for the desired telescope, so all values found in the file will be returned but INCLUDEs will not be processed.

  • bogus_last_correction (bool) – If True, the last correction value in the file is a placeholder, normally far in the future, and not an actual measurement.

  • process_includes (bool) – If True, also read data from any INCLUDE statements. Requires the obscode argument to distinguish data from any other telescopes that might be in the same system of files.

  • friendly_name (str or None) – A human-readable name for this file, for use in error reporting. If not provided, will default to filename.

  • valid_beyond_ends (bool) – Whether to consider the file valid past the ends of the data it contains.