Discrepancy in Satellite Position Calculations

Hello,

I am using the SGP4 model in Orekit to calculate satellite positions based on TLE data. However, I have noticed significant discrepancies between my results and the satellite positions generated by STK using the “From TLE File” method and “Fixed Position & Velocity” report. The differences are typically in the range of several kilometers, and in some cases, up to tens of kilometers.

I am unsure where I might be going wrong in the implementation. Below is the code I am using to compute the satellite positions. I would appreciate any insights into potential issues or suggestions for improvements.

public static Point3D ComputeEcef(string line1, string line2, DateTime time)
{
    TLE tle = new TLE(line1, line2);
    var localPropagator = TLEPropagator.selectExtrapolator(tle);
    var localTeme = FramesFactory.getTEME();
    var localItrf = FramesFactory.getITRF(IERSConventions.IERS_2010, true);
    var date = ToAbsoluteDate(time);

    var state = localPropagator.propagate(date);
    var pvInECI = state.getPVCoordinates(localTeme);
    var transform = localTeme.getTransformTo(localItrf, date);
    var pvInECEF = transform.transformPVCoordinates(pvInECI);
    var pos = pvInECEF.getPosition();
    var vel = pvInECEF.getVelocity();
    Point3D position = new Point3D(pos.getX(), pos.getY(), pos.getZ());

    return position;
}

Thank you in advance for your help!

the Java code should work well, while i would suggest that actually you can get the pvInECEF directly,

var state = localPropagator.propagate(date);
var pvInECEF = state.getPVCoordinates(localItrf);

Just make a check if the output from STK is in the same frame as ITRF.