epoch#

xrtpy.util.epoch = <Time object: scale='utc' format='iso' value=2006-09-22 21:36:00.000>#

Represent and manipulate times and dates for astronomy.

A Time object is initialized with one or more times in the val argument. The input times in val must conform to the specified format and must correspond to the specified time scale. The optional val2 time input should be supplied only for numeric input formats (e.g. JD) where very high precision (better than 64-bit precision) is required.

The allowed values for format can be listed with:

>>> list(Time.FORMATS)
['jd', 'mjd', 'decimalyear', 'unix', 'unix_tai', 'cxcsec', 'galexsec', 'gps',
 'plot_date', 'stardate', 'datetime', 'ymdhms', 'iso', 'isot', 'yday', 'datetime64',
 'fits', 'byear', 'jyear', 'byear_str', 'jyear_str']

See also: http://docs.astropy.org/en/stable/time/

Parameters:
  • val (sequence, ndarray, number, str, bytes, or Time object) – Value(s) to initialize the time or times. Bytes are decoded as ascii.

  • val2 (sequence, ndarray, or number; optional) – Value(s) to initialize the time or times. Only used for numerical input, to help preserve precision.

  • format (str, optional) – Format of input value(s), specifying how to interpret them (e.g., ISO, JD, or Unix time). By default, the same format will be used for output representation.

  • scale (str, optional) – Time scale of input value(s), must be one of the following: (‘tai’, ‘tcb’, ‘tcg’, ‘tdb’, ‘tt’, ‘ut1’, ‘utc’)

  • precision (int, optional) – Digits of precision in string representation of time

  • in_subfmt (str, optional) – Unix glob to select subformats for parsing input times

  • out_subfmt (str, optional) – Unix glob to select subformat for outputting times

  • location (EarthLocation or tuple, optional) – If given as an tuple, it should be able to initialize an an EarthLocation instance, i.e., either contain 3 items with units of length for geocentric coordinates, or contain a longitude, latitude, and an optional height for geodetic coordinates. Can be a single location, or one for each input time. If not given, assumed to be the center of the Earth for time scale transformations to and from the solar-system barycenter.

  • copy (bool, optional) – Make a copy of the input values