Open facusapienza21 opened 3 years ago
The gps2dyr function using format='gps'
returns TAI time, not GPS time. The format
argument governs how time is represented, whereas the scale
argument is what converts between time standards. astropy Time objects do not have GPS as a scale option; the astropy documentation provides a table showing the scale
and reference date for specific format
options.
TAI is always 19 seconds ahead of GPS (and 19 + # of leap seconds ahead of UTC), so to get to a GPS time epoch in astropy Time objects, you have to use (Time(time, format='gps')-TimeDelta(19, format='sec')).datetime
The following two functions can be used to compute a time object given the seconds in GPS, that is, the total seconds since 1980-06-01 00:00. The first function uses the package astropy and the second datetime.
However, we can see that they result in different times from the same timestamp (in this case, 0 seconds should match with 1980-06-01 00:00):