pub fn convert_gpstime_to_unixtime(
    gpstime_ms: u64,
    mwa_start_gpstime_ms: u64,
    mwa_start_unixtime_ms: u64
) -> u64
Expand description

Returns a UNIX time given a GPStime

NOTE: this method relies on the fact that metafits files have the following information, which we use to determine the UNIX vs GPS offset in seconds, which has already been corrected for leap seconds:assert_eq!

GOODTIME = the first UNIX time of “good” data (after receivers, beamformers, etc have settled down) QUACKTIM = the number of seconds added to the scheduled UNIX start time to skip “bad” data. GPSTIME = the GPS scheduled start time of an observation

Thus we can subtract QUACKTIM from GOODTIME to get the UNIX scheduled start time.assert_eq! Know things and that we have the GPSTIME for the same instant, we can compute and offset and use THAT to adjust any times in THIS OBSERVATION. NOTE: this only works because the telescope garauntees that we will never observe OVER a leap second change.

§Arguments

  • gpstime_ms - GPS time (in ms) you want to convert to UNIX timestamp

  • mwa_start_gps_time_ms - Scheduled GPS start time (in ms) of observation according to metafits.

  • mwa_start_unix_time_ms - Scheduled UNIX start time (in ms) according to the metafits (GOODTIM-QUACKTIM).

§Returns

  • The UNIX time (in ms) converted from the gpstime_ms.