test_time_conversions module

Test timing conversions between reference frames.

test_time_conversions.leapseconds_table()[source]

Table with reference for when leapseconds were added

Returns:

leapseconds_ref_table – Array of reference times and leap seconds for validation

Return type:

np.ndarray

test_time_conversions.test_array_conversions()[source]

Test array conversions between time types.

test_time_conversions.test_datetime_to_gps_millis()[source]

Test UTC datetime to milliseconds since GPS epoch conversion and back

Datetime to GPS milliseconds conversion was obtained using an online convertor [7].

References

test_time_conversions.test_datetime_to_tow()[source]

Test that datetime conversion to GPS or UTC secs does not fail.

Verified by using an online gps time calculator [1].

References

test_time_conversions.test_datetime_to_unix_millis()[source]

Test UTC datetime to milliseconds since UNIX epoch conversion and back

Datetime to UNIX milliseconds conversion was obtained using an online convertor [6].

References

test_time_conversions.test_get_leap_seconds(check_leapseconds)[source]

Test to validate leap seconds based on input time.

Parameters:

check_leapseconds (np.ndarray) – Array of times at which leap seconds changed and changed values

test_time_conversions.test_gps_datetime_to_gps_millis()[source]

Test conversion of GPS datetime to GPS millis.

test_time_conversions.test_gps_unix_millis()[source]

Test milliseconds since GPS epoch to milliseconds since UNIX epoch.

Given UTC time, milliseconds since the UNIX epoch were calculated from an online calculator [8]. The UTC time was converted to seconds (and hence milliseconds) since GPS epoch using another online calculator [9].

References

test_time_conversions.test_gps_unix_millis_vect()[source]

Test vectorized version of unix_to_gps_millis and gps_to_unix_millis.

Notes

Test based on the test implemented in test_gps_unix_millis

test_time_conversions.test_millis_since_gps_epoch_to_tow()[source]

Test milliseconds since gps epoch to time of week.

Test that conversion from milliseconds since GPS epoch to GPS or UTC seconds of the week does not fail.

Given a UTC time epoch, an online GPS Time converter [2] provides seconds since GPS epoch while a GPS Time calculator [3] gives GPS seconds of the week.

References

test_time_conversions.test_tow_to_unix_millis()[source]

Test TOW to milliseconds since Unix epoch and back.

Given UTC time, milli seconds since the UNIX epoch were calculated from an online calculator [4]. The UTC time was converted to GPS time and TOW using another online calculator [5].

References

test_time_conversions.test_tz_conversion()[source]

Checking internal timezone conversions to UTC

Checks that when timezone information is None or attribute doesn’t exist, the timezone is changed to UTC. Also checks that if time is in non-UTC frame of reference, the time is converted to UTC before being returned.

test_time_conversions.test_zero_arrays()[source]

Test zero array conversions between time types.