nicer.yday_custom

An astropy time format for year and day-of-year strings.

Importing this module registers the yday_custom format with astropy.time.Time.

Classes

TimeYearDayTimeCustom(val1, val2, scale, ...)

Year, day-of-year and time as <YYYY>-<DOY>T<HH>:<MM>:<SS>.

class nicer.yday_custom.TimeYearDayTimeCustom(val1, val2, scale, precision, in_subfmt, out_subfmt, from_jd=False)[source]

Bases: TimeISO

Year, day-of-year and time as <YYYY>-<DOY>T<HH>:<MM>:<SS>.

The day of year (DOY) goes from 001 to 365 (366 in leap years). For example, 2000-001T00:00:00 is midnight on January 1, 2000. The allowed subformats are:

  • date_hms: date + hours, minutes, seconds

  • date_hm: date + hours, minutes

  • date: date only

name = 'yday_custom'
subfmts = (('date_hms', '%Y-%jT%H:%M:%S', '{year:d}-{yday:03d}T{hour:02d}:{min:02d}:{sec:02d}'), ('date_hm', '%Y-%jT%H:%M', '{year:d}-{yday:03d}T{hour:02d}:{min:02d}'), ('date', '%Y-%j', '{year:d}-{yday:03d}'))