View Source SpaceDust.Time.GPS (Space Dust v0.3.0)
GPS Time.
GPS Time is a continuous time scale used by the Global Positioning System. It started at midnight UTC on January 6, 1980 (the GPS epoch) and does not include leap seconds.
GPS = TAI - 19 seconds
At the GPS epoch, GPS time was synchronized with UTC. Since then, leap seconds have been added to UTC but not to GPS time, so they have diverged.
GPS time is often expressed as a week number and seconds of week.
Internally stores time as fractional seconds since GPS epoch.
Summary
Functions
Add seconds to GPS time.
Get day of week (0 = Sunday).
Difference between two GPS times in seconds.
Create from Nx tensor.
Create from GPS week number and seconds of week.
Get the GPS epoch in Unix seconds.
Create a GPS time from GPS seconds (since GPS epoch).
Get seconds of week (0 to 604800).
Seconds per GPS week.
Get the GPS seconds value (since GPS epoch).
Convert to Nx tensor (GPS seconds since epoch).
Convert to GPS week number and seconds of week. Returns {week_number, seconds_of_week}.
Get GPS week number.
Types
@type t() :: %SpaceDust.Time.GPS{gps_seconds: float()}
Functions
Add seconds to GPS time.
Get day of week (0 = Sunday).
Difference between two GPS times in seconds.
@spec from_tensor(Nx.Tensor.t()) :: t()
Create from Nx tensor.
Create from GPS week number and seconds of week.
Get the GPS epoch in Unix seconds.
Create a GPS time from GPS seconds (since GPS epoch).
Get seconds of week (0 to 604800).
Seconds per GPS week.
Get the GPS seconds value (since GPS epoch).
@spec to_tensor(t()) :: Nx.Tensor.t()
Convert to Nx tensor (GPS seconds since epoch).
Convert to GPS week number and seconds of week. Returns {week_number, seconds_of_week}.
Get GPS week number.