TimestampFieldInfo

class lsst.ts.MTMount.field_info.TimestampFieldInfo

Bases: lsst.ts.MTMount.field_info.BaseFieldInfo

UTC timestamp field.

The str representation is ISO-8601, with “T” between the date and time. For example: “2020-02-27T14:48:27.469”. It will never have leap seconds (see notes).

Parameters:
name : str

Name of field. Must be a valid Python identifier.

doc : str, optional

Description of the field.

scale : str

One of “tai” or “utc”, where “utc” is an approximation without leap seconds (see notes).

default : True or None

If True then the current date is used as a default. If None then the date must be specified.

Notes

The time is not exactly UTC; it is a an approximation to UTC which has no leap seconds. On the day of a leap second the time time is uniformly stretched so there are the usual number of seconds in the day. Tekniker’s code only uses UTC time for unimportant message timestamps, and this avoids the risk of passing Tekniker’s code a timestamp value that it cannot handle.

Attributes Summary

default

Methods Summary

assert_value_ok(value)
str_from_value(value) Return a string representation of the value.
value_from_str(strval) Convert a string to a value of the correct type.

Attributes Documentation

default

Methods Documentation

assert_value_ok(value)
str_from_value(value)

Return a string representation of the value.

value_from_str(strval)

Convert a string to a value of the correct type.

Parameters:
strval : str

String representation of value.

Returns:
value : any

The parsed value.

Raises:
ValueError

If the value cannot be parsed.