From e497ad30ac20359ee8c974bb4c3b4d240e0665e6 Mon Sep 17 00:00:00 2001 From: bt-juanfandino1234 Date: Wed, 26 May 2021 16:04:50 +0400 Subject: [PATCH] Added comments to the time of ephemeris check statements --- gpssim.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/gpssim.c b/gpssim.c index 84dcc93..0d49ca7 100644 --- a/gpssim.c +++ b/gpssim.c @@ -2009,6 +2009,10 @@ int main(int argc, char *argv[]) } else { + // Deviation from original gpssim.c. This statement is checking that the current receiver local time is + // within a longer time interval given by two hours before the minimum ephemeris time and two hours after the + // maximum ephemeris time. In the original implementation, the check was that the current receiver local time + // is within the miminum time of ephemeris and the maximum time of ephemeris if (fabs(subGpsTime(g0, gmin))>2*SECONDS_IN_HOUR && fabs(subGpsTime(gmax, g0))>2*SECONDS_IN_HOUR) { fprintf(stderr, "ERROR: Invalid start time.\n"); @@ -2042,6 +2046,8 @@ int main(int argc, char *argv[]) if (eph[i][sv].vflg == 1) { dt = subGpsTime(g0, eph[i][sv].toc); + // Test that ephemeris can be used by comparing the receiver local time with the time of clock from ephemeris data and observing + // the receiver local time is within a 4 hour interval from the time of clock from ephemeris if (dt>=-2*SECONDS_IN_HOUR && dt<2*SECONDS_IN_HOUR) { ieph = i;