Error when adding more than two measurements to estimator

Hello Orekit team,
I am doing a project on orbit determination based on ground telescope measurement. The orbit of an object crossing the field of view is not known and i used the TLE of the object to get a fitted orbit. To do that I add the entry and exit ra/dec coordinates to the estimator. My only problem is when I try to use multiple measurement (more than 2) I get the following error :

estimatedPropagatorArray = estimator.estimate()
                               ^^^^^^^^^^^^^^^^^^^^
orekit.JavaError: <super: <class 'JavaError'>, <JavaError object>>
    Java stacktrace:
org.orekit.errors.OrekitIllegalArgumentException: hyperbolic orbits cannot be instances of org.orekit.orbits.EquinoctialOrbit
        at org.orekit.orbits.EquinoctialOrbit.<init>(EquinoctialOrbit.java:296)
        at org.orekit.propagation.analytical.tle.generation.FixedPointTleGenerationAlgorithm.convert(FixedPointTleGenerationAlgorithm.java:305)
        at org.orekit.propagation.analytical.tle.generation.FixedPointTleGenerationAlgorithm.generate(FixedPointTleGenerationAlgorithm.java:142)
        at org.orekit.propagation.conversion.TLEPropagatorBuilder.buildPropagator(TLEPropagatorBuilder.java:129)
        at org.orekit.propagation.conversion.TLEPropagatorBuilder.buildPropagator(TLEPropagatorBuilder.java:44)
        at org.orekit.estimation.leastsquares.AbstractBatchLSModel.createPropagators(AbstractBatchLSModel.java:410)
        at org.orekit.estimation.leastsquares.AbstractBatchLSModel.value(AbstractBatchLSModel.java:275)
        at org.hipparchus.optim.nonlinear.vector.leastsquares.LeastSquaresFactory$LocalLeastSquaresProblem.evaluate(LeastSquaresFactory.java:440)
        at org.orekit.estimation.leastsquares.BatchLSEstimator$TappedLSProblem.evaluate(BatchLSEstimator.java:645)
        at org.hipparchus.optim.nonlinear.vector.leastsquares.GaussNewtonOptimizer.optimize(GaussNewtonOptimizer.java:163)
        at org.orekit.estimation.leastsquares.BatchLSEstimator.estimate(BatchLSEstimator.java:459)

This only happens when I add more than two measurement to my estimator. The measurements are in chronological order and the ra/dec values are getting bigger in time.

Here is the snippet code that I use to add the measurement:

satellite = ObservableSatellite(0)
sgma = 1e-5  # half a pixel
baseWeight = [1 / 2, 1 / 2]
sigma = [sgma, sgma]
inertialFrame = FramesFactory.getEME2000()

mes_start = AngularRaDec(
    station,
    inertialFrame,
    datetime_to_absolutedate(tcurr),
    [float(ra_entry), float(dec_entry)],
    sigma,
    baseWeight,
    satellite,
)
mes_end = AngularRaDec(
    station,
    inertialFrame,
    datetime_to_absolutedate(end),
    [float(ra_exit), float(dec_exit)],
    sigma,
    baseWeight,
    satellite,
)

mes_list = [mes_start, mes_end]

I would like to add more measurement to refine the estimation but I am stuck :frowning: I am a new user of orekit

First rough guess: are your angular measurements in radians?
Orekit uses SI units (almost) everywhere.

Yes, all my measurements are in radians. If it can help, I use the FixedPointTleGenerationAlgorithm and the TLE propagator.

Two measurements are indeed two few to estimate anything (as they are two-dimensional measurements, you just have 4 degrees of freedom which is insufficient to estimate an orbit).
You could try to put a lot of measurements at once (a few tens).

I am even puzzled you get a result when you use one measurement, I would have expected some linear algebra error somewhere like a singular matrix.

The error you see is that at some point the estimator attempted to test an orbit that was way too far from reality. We saw this for example with huge drag (satellite diving into atmosphere).

1 Like