pint.observatory.find_clock_file

pint.observatory.find_clock_file(name, format, bogus_last_correction=False, url_base=None, clock_dir=None, valid_beyond_ends=False)[source]

Locate and return a ClockFile in one of several places.

PINT looks for clock files in three places, in order:

  1. The directory $PINT_CLOCK_OVERRIDE

  2. The global clock correction repository on the Internet (or a locally cached copy)

  3. The directory pint.config.runtimefile('.')

The first place the file is found is the one use; this allows you to force PINT to use your own files in place of those in the global repository.

Parameters:
  • name (str) – The name of the file, for example time_ao.dat.

  • format ("tempo" or "tempo2") – The format of the file; this also determines where in the global repository to look for it.

  • bogus_last_correction (bool) – Whether the file contains a far-future value to help other programs’ interpolation cope.

  • url_base (str or None) – Override the usual location to look for global clock corrections (mostly useful for testing)

  • clock_dir (str or pathlib.Path or None) – If None or “PINT”, use the above procedure; if “TEMPO” or “TEMPO2” use those programs’ customary locations; if a path, look there specifically.

  • valid_beyond_ends (bool) – If False, emit a warning or exception when evaluating the clock file past the ends of the data it contains.

Return type:

ClockFile