Question

I am trying to figure out why when a time object is converted to GPS time, it becomes an array rather than remaining as a Time object. Example:

from astropy.time import Time

times = Time([56701, 56702], format="mjd", scale="tdb")
times.gps

Out: array([  1.07628475e+09,   1.07637115e+09])

While conversion to other times gives:

times.utc
Out: <Time object: scale='utc' format='mjd' value=[ 56700.9992224  56701.9992224]>

Which I believe is the intended behaviour.

Was it helpful?

Solution

GPS is defined in astropy as a time format not a scale. There is some ambiguity here as discussed in #1879. In the end we decided to keep GPS as just a format, in which case the output of times.gps as a numpy array is the expected correct behavior.

There is a pull request #2091 which clarifies the situation with GPS time.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top