LIGOTimeGPS¶
- class ligotimegps.LIGOTimeGPS(seconds: LIGOTimeGPSLike | SupportsFloat | str | bytes = 0, nanoseconds: float = 0)¶
Bases:
objectAn object for storing times with nanosecond resolution.
Internally the time is represented as a signed integer
gpsSecondspart and an unsigned integergpsNanosecondspart. The actual time is always constructed by adding the nanoseconds to the seconds. So -0.5 s is represented by setting seconds = -1, and nanoseconds to 500000000.- Parameters:
Examples
>>> LIGOTimeGPS(100.5) LIGOTimeGPS(100, 500000000) >>> LIGOTimeGPS("100.5") LIGOTimeGPS(100, 500000000) >>> LIGOTimeGPS(100, 500000000) LIGOTimeGPS(100, 500000000) >>> LIGOTimeGPS(0, 100500000000) LIGOTimeGPS(100, 500000000) >>> LIGOTimeGPS(100.2, 300000000) LIGOTimeGPS(100, 500000000) >>> LIGOTimeGPS("0.000000001") LIGOTimeGPS(0, 1) >>> LIGOTimeGPS("0.0000000012") LIGOTimeGPS(0, 1) >>> LIGOTimeGPS("0.0000000018") LIGOTimeGPS(0, 2) >>> LIGOTimeGPS("-0.8") LIGOTimeGPS(-1, 200000000) >>> LIGOTimeGPS("-1.2") LIGOTimeGPS(-2, 800000000)
Attributes Summary
residual nanoseconds
Seconds since 0h UTC 6 Jan 1980
Methods Summary
ns()Convert a
LIGOTimeGPSto a count of nanoseconds as an int.Attributes Documentation
- gpsNanoSeconds¶
residual nanoseconds
- gpsSeconds¶
Seconds since 0h UTC 6 Jan 1980
Methods Documentation
- ns() int¶
Convert a
LIGOTimeGPSto a count of nanoseconds as an int.When running python2.7 on Windows this is returned as
numpy.longto guarantee long-ness.Examples
>>> LIGOTimeGPS(100.5).ns() 100500000000