Contains the GPSTime class that represents time as GPS
'Copyright 2020 The Aerospace Corporation'

Parameters and Helper Functions

The following parameters are useful values that will be used regularly within this module.

This function is used to convert a time as a float into integer seconds and femtoseconds

The GPSTime Class

The primary class for this module is, unsurprisingly, the GPSTime class. This class has three public attributes, the week_number, seconds, and femtoseconds. The week number is the number of weeks since the start of the GPS epoch, 6 January 1980. The seconds and femtoseconds are the number of seconds and femtoseconds (1e-15) since the start of the GPS week (starting midnight Saturday night/Sunday morning).

The GPSTime class also has a property of time_of_week that returns the time of week as a float. Note that the floating point accuracy of time_of_week can be as low as tens of picoseconds (1e-12).

The GPSTime class can be save to and loaded from file using ruamel.yaml.

class GPSTime[source]

GPSTime(week_number:int, *args, **kwargs)

Time representation for GPS.

Attributes

week_number : int The number of weeks since the start of the GPS epoch, 6 Jan 1980. seconds : int The number of integer seconds into the week. The zero time is at midnight on Sunday morning, i.e. betwen Saturday and Sunday. Should be between 0 and 604800 because otherwise, the week number would be incorrect. femtoseconds : int The number of femtoseconds into the week. That is, this is the number of fractional seconds in the time of week with a scale factor of 1e15.

Raises

TypeError For various operators if not the selected types are not implemented. ValueError If an incorrect set of input arguments are provided to the constructor

Todo

.. todo:: Create a GPSTimeDelta class to handle adding/subtracting with increase accuracy.