tai_from_utc¶
-
lsst.ts.utils.tai_from_utc(utc: Union[float, str,
astropy.time.Time], format: Optional[str] = 'unix') float¶ Return TAI in unix seconds, given UTC or any
astropy.time.Time.Warning: smears time evenly on the day before a leap second. See Leap Second Smearing for details.
Because of the smearing, this function should only be used for scalar measures of UTC, such as unix seconds, Julian Date or Modified Julian Date. It should not be used for ISO-formatted date strings.
- Parameters
- utc
float,strorastropy.time.Time UTC time in the specified format.
- format
strorNone Format of the UTC time, as an
astropy.timeformat name, orNoneto have astropy guess. Ignored ifutcis an instance ofastropy.time.Time.
- utc
- Returns
- tai_unix
float TAI time in unix seconds.
- tai_unix
- Raises
- ValueError
If the date is earlier than 1972 (which is before integer leap seconds) or within one day of the expiration date of the leap second table (which is automatically updated).
Notes
This function uses a leap second table that is automatically updated in the background (though updates are very infrequent).