The frame is not proper in tutorials TLEBasedOrbitDetermination

Hi,

Today I tried the TLEBasedOrbitDetermination, and finally figured out that it is wrong, which is corresponding to the frame.

The measurement Position don’t have a property referenceFrame like AngularRaDec, for commonly using, EME2000 is the default frame.

But for TLEBased, TEME is the default frame, mainly for TLEPropagator.

So in theoreticalEvaluation of Position, the frame of states[0] is TEME, and so the frame of pv and pv.getPosition() both are TEME.

Though, in readSp3 of AbstractOrbitDetermination, transformation is done, but the initialGuess.getFrame() is EME2000.

That is, the observed is in the frame of EME2000, but the estimatedValue is in the frame of TEME.

        // Measurements
        final List<ObservedMeasurement<?>> measurements = new ArrayList<>();
        for (final SP3Coordinate coordinates : ephemeris.getCoordinates()) {
            final AbsoluteDate date = coordinates.getDate();
            final PVCoordinates pvInertial = ephFrame.getTransformTo(initialGuess.getFrame(), date).transformPVCoordinates(coordinates);
            measurements.add(new Position(date, pvInertial.getPosition(), 1, 1, satellite));
        }

And in compareWithReference of TLEBasedOrbitDetermination, the reference position and velocity should be in the frame of EME2000, but the estimatedOrbit is in the frame of TEME, so as the estimatedOrbit.getPVCoordinates().

The patch is as followings (two modifications):

final PVCoordinates pvInertial = ephFrame.getTransformTo(initialGuess.getFrame(), date).transformPVCoordinates(coordinates);

==>

final PVCoordinates pvInertial = ephFrame.getTransformTo(FramesFactory.getTEME(), date).transformPVCoordinates(coordinates);
System.out.println("ΔP_final(m) = " + Vector3D.distance(refPos, estimatedOrbit.getPVCoordinates().getPosition()));

==>

System.out.println("ΔP_final(m) = " + Vector3D.distance(refPos, estimatedOrbit.getPVCoordinates(frame).getPosition()));

The correct output is as followings:

Input TLE:
1 32711U 08012A   16044.40566026 -.00000039  00000-0  00000+0 0  9991
2 32711  55.4362 301.3402 0091577 207.7302 151.8353  2.00563580 58013

iteration evaluations      ΔP(m)        ΔV(m/s)           RMS          nb Range    nb Range-rate  nb Angular     nb PV                        Px                      Py                      Pz                      Vx                      Vy                      Vz
     0          1                                 511.003584235565       0/0            0/0          0/0          0/0         13931962.174999300     -22865909.044731975            -6.225455448          1869.429512489          1120.737098643          3164.781379062
     1          2         911.048401  0.128906076  75.485468591314       0/0            0/0          0/0          0/0         13931521.729121314     -22866248.004540220          -728.113858094          1869.510166847          1120.639098994          3164.758846421
     2          3           0.013712  0.000002413  75.485183664449       0/0            0/0          0/0          0/0         13931521.722691838     -22866247.992519250          -728.112385653          1869.510165477          1120.639098733          3164.758844451

Estimated TLE:
1 32711U 08012A   16044.40566026 -.00000039  00000-0  00000-0 0  9992
2 32711  55.4358 301.3401 0091588 207.7163 151.8474  2.00563453 58017

Comparison with reference orbit from SP3 file
=============================================
Initial TLE from external provider:
date:2016-02-13T09:44:09.046464Z
frame:EME2000
ΔP_init(m) = 914.4273995963578
ΔV_init(m/s) = 0.1286721455911397
Estimated:
ΔP_final(m) = 59.62588130279602
ΔV_final(m/s) = 0.013449782312139313

Estimated orbit: Cartesian parameters: {P(1.3931521722670417E7, -2.2866247992540702E7, -728.112432160086), V(1869.510165478349, 1120.6390987299053, 3164.7588444503526)}
Estimated orbital parameters changes: 
   1 Px  -440.452307462692  (final value:   13931521.722691838000)
   2 Py  -338.947787273675  (final value:  -22866247.992519250000)
   3 Pz  -721.886930204866  (final value:  -728.112385652757)
   4 Vx  +0.080652987658  (final value:   1869.510165477021)
   5 Vy  -0.097999909381  (final value:   1120.639098733136)
   6 Vz  -0.022534610578  (final value:   3164.758844451251)
Estimated propagation parameters changes: 
Estimated measurements parameters changes: 
Number of iterations: 2
Number of evaluations: 3
wall clock run time (s): 1.415

Hi,

I did a too fast copy and past when writing the input file of the orbit determination. I used an existing file and I missed the update of the frame.

It’s fixed now in develop branch.

Thank you,
Bryan

OK.

I just noticed the doc of measurement Position.

“The measurement must be in the orbit propagation frame.”.