SP3Parser returns start time slightly different from the one in the SP3 file

I have been trying to use the SP3Parser to read my SP3 file. However, after parsing the file, the start time returned by the parser is not exactly the same as the one specified in the file.

data_source = OrekitDataSource("test.sp3")

orekit_sp3_parser = sp3.SP3Parser()
sp3 = orekit_sp3_parser.parse(data_source)
print(sp3.getEphemeris(1).getStart())

The output is:

2022-08-31T23:59:42.000Z

But in the SP3 file, the start time is:

2022 9 1 0 0 0.00000

Does anyone know why this discrepancy occurs? Am I missing something or doing something wrong?

The problem you see it that when you print the start time without specifying a time scale, it will use UTC, whereas the SP3 file are generally time stamped in GNSS scale (mostly GPS), which in 2022 was 18 seconds away from UTC.

In the SP3 header, the time system is in the first line that starts with “%c”. It generally only contains a long series of “ccc” fields, which means everything is set to default, which is GPS. In some cases (see example-c-1.sp3 in the test resources), it defines the time system in characters 9 to 12 of this line (in this example, the line reads “%c G cc GPS ccc cccc cccc…”), so it is also GPS here. In the example-d-3.sp3 test resource files, you would see UTC as the time system used.

1 Like