validate

erfa.leap_seconds.validate(table)[source]

Validate a leap-second table.

Parameters:
tablearray_like

Must have ‘year’, ‘month’, and ‘tai_utc’ entries. If a ‘day’ entry is present, it will be checked that it is always 1. If table has an ‘expires’ attribute, it will be interpreted as an expiration date.

Returns:
arrayndarray

Structures array with ‘year’, ‘month’, ‘tai_utc’.

expires: datetime or None

Possible expiration date inferred from the table. None if not present or if not a datetime or Time instance and not parsable as a ‘dd month yyyy’ string.

Raises:
ValueError

If the leap seconds in the table are not on the 1st of January or July, or if the sorted TAI-UTC do not increase in increments of 1.