Hello, I am trying to extract Earth’s ICRF position at a specific Julian Date on the TDB time scale. For validation, I am comparing my result with JPL Horizons. The problem is that I am unable to match the values exactly. From DE441 ephemerides Horizons produces the following state:
$$SOE
2460157.500000000 = A.D. 2023-Aug-01 00:00:00.0000 TDB [del_T= 69.183312 s]
XYZ : 9.262412495155303E+07 -1.097336742893849E+08 -4.753366571502377E+07 2.291818900912849E+01 1.678010135905066E+01 7.273858345769444E+00
sigmas: n.a. n.a. n.a. n.a. n.a. n.a.
$$EOE
I am using the default orekit-data package. It contains DE-441-ephemerides. To make sure that correct ephemerides are used, I create the earth CelestialBody in the following way:
JPLEphemeridesLoader earthLoader = new JPLEphemeridesLoader("lnxp1990.441", JPLEphemeridesLoader.EphemerisType.EARTH);
CelestialBody earth = earthLoader.loadCelestialBody("Earth");
I then create my AbsoluteDate in the following way:
TDBScale TDBscale = TimeScalesFactory.getTDB();
AbsoluteDate date = AbsoluteDate.createJDDate(2460157, Constants.JULIAN_DAY/2.0d, TDBscale);
I also create the ICRF frame like this:
CelestialBody centralBody = CelestialBodyFactory.getSolarSystemBarycenter();
Frame inertialFrame = centralBody.getInertiallyOrientedFrame();
Finally, I extract the PVCoordinates of earth at JDTDB 2460157.5 like follows:
earth.getPVCoordinates(date,inertialFrame)
I get the following result:
{2023-07-31T23:58:50.8167034179512,
P(9.262412495125844E10, -1.0973367428959982E11, -4.75336657151169E10),
V(22918.18900917888, 16780.101358989006, 7273.858345741602),
A(-0.003542073372692932, 0.0041202768855387335, 0.001782459856161173)}
There are a few discrepancies that I’m not able to resolve. First, the discrepancy in position coordinates, for example, the x coordinates differ by around 30 cm:
horizons: 92624124951.55303 m
orekit: 92624124951.25844 m
Secondly, there is a discrepancy in the AbsoluteDate, which, I suspect, could be causing the discrepancy in the position. If I extract the TDB date using
date.toString(TDBscale)
I get 2023-07-31T23:59:59.99998730725312, which is not exactly 2023-08-01T00:00:00.000 as I would expect and as also seen in the Horizons output. However, even if some error is introduced during conversion of JDTDB to the date time format, it seems strange that it would cause an error in the ephemeride readings, since the ephemerides directly require the JDTDB date as input.
In conclusion, I cannot figure out why the discrepancy is there, perhaps someone has an idea? Thanks in advance.