TimeFITS

class astropy.time.TimeFITS(val1, val2, scale, precision, in_subfmt, out_subfmt, from_jd=False)[source] [edit on github]

Bases: astropy.time.TimeString

FITS format: “[±Y]YYYY-MM-DD[THH:MM:SS[.sss]][(SCALE[(REALIZATION)])]”.

ISOT with two extensions: - Can give signed five-digit year (mostly for negative years); - A possible time scale (and realization) appended in parentheses.

Note: FITS supports some deprecated names for timescales; these are translated to the formal names upon initialization. Furthermore, any specific realization information is stored only as long as the time scale is not changed.

The allowed subformats are:

  • ‘date_hms’: date + hours, mins, secs (and optional fractional secs)
  • ‘date’: date
  • ‘longdate_hms’: as ‘date_hms’, but with signed 5-digit year
  • ‘longdate’: as ‘date’, but with signed 5-digit year

See Rots et al., 2015, A&A 574:A36 (arXiv:1409.7583).

Attributes Summary

name
subfmts
value Convert times to strings, using signed 5 digit if necessary.

Methods Summary

format_string(str_fmt, **kwargs) Format time-string: append the scale to the normal ISOT format.
parse_string(timestr, subfmts) Read time and set scale according to trailing scale codes.

Attributes Documentation

name = u'fits'
subfmts = ((u'date_hms', <_sre.SRE_Pattern object at 0x2d0a200>, u'{year:04d}-{mon:02d}-{day:02d}T{hour:02d}:{min:02d}:{sec:02d}'), (u'date', <_sre.SRE_Pattern object at 0x2d08b00>, u'{year:04d}-{mon:02d}-{day:02d}'), (u'longdate_hms', <_sre.SRE_Pattern object at 0x2d0b1a0>, u'{year:+06d}-{mon:02d}-{day:02d}T{hour:02d}:{min:02d}:{sec:02d}'), (u'longdate', <_sre.SRE_Pattern object at 0x2d09010>, u'{year:+06d}-{mon:02d}-{day:02d}'))
value

Convert times to strings, using signed 5 digit if necessary.

Methods Documentation

format_string(str_fmt, **kwargs)[source] [edit on github]

Format time-string: append the scale to the normal ISOT format.

parse_string(timestr, subfmts)[source] [edit on github]

Read time and set scale according to trailing scale codes.