Re-computed estimated measurements

Hi @Serrof,

I’m also stuck with this issue. Have you solved it? Especially for the satellite ajisai with TimeSpanDragForce.

Here is my pseudo-code (python):
(1) measurement_list = read_crd(…);
(2) estimatedPropagators = estimator.estimate();
(3) estProp = estimatedPropagators[0];
(4) estimatedMeasurements = estimator.getLastEstimations().values()
(5) evaluation_list = evaluate_measurement(measurement_list, estProp);

The method evaluate_measurement is quite similar to ResidualsHandler.

Then I see, the residuals of re-computed by (5) are quite different with the residuals computed from estimatedMeasurements by (4).

Additionally, it is better to use Ephemeris mode.

    generator = estProp.getEphemerisGenerator()
    estProp.propagate(absdateStart, datePredEnd)
    ephProp = generator.getGeneratedEphemeris()

The two attachment are pngs of residials. ‘resid_’ is the raw one, ‘qc_est_’ is the result of re-compute.

Hi there,

No I never formally manage to retrieve the exact residuals of the last step. However by recomputing some “by hand” I noticed that as expected with sufficiently tight convergence tolerance for the estimator, the state is basically the same for the last two iterations, and so are the residuals consequently.
Do you specify the mass in your propagation builder? I know it can be a source of discrepancy between estimation and independent repropagation as was my case above

Best,
Romain.

Hi @Serrof,

I used the estimated propagator returned by the estimator.estimate(), not re-build a new one. The mass is set in the propagator builder, which is used for the estimation. So I think the mass should be set properly. I’ll check it.
Also I’ll try to re-build a new one with the estimated state and other estimated parameters.
Thanks.

Best,
lirw

Hi,

I was thinking again on this and I can think of two sources of discrepancy:

  1. Precompensation: the dates when the states are interpolated in the batch LS are pre-compensated with an offset coming from previous iteration.
    Meaning:
  • At iteration 0 the date of the state is initially the date of the measurement, the spacecraft state is interpolated at this date and then corrected for light-time delay within a loop using shiftedBys
  • The date found for the corrected state is then registered and used in the next iteration
  • At iteration 1 the interpolator uses the corrected date, so the state position evaluation is closer to the emitting position and the light-time correction is smaller. Thus the evaluation is “better” because it relies more on the interpolator and less on shiftedBys
    → When we try to recompute the residuals we’ve lost this pre-compensation, so we rely on shiftedBys for light time correction and it can introduce differences
  1. Interpolation itself: when recomputing the residuals if one do not use the exact same propagator/integrator/handler then the interpolation of the states may be different.
    For example, if one propagates measurement by measurement to get the estimated measurement value, then the spacecraft state value (and thus the estimated measurement) is different than the one interpolated inside the MeasurementStepHandler during the batch LS OD.

Best,
Maxime

Hi, @MaximeJ

Thank you so much for reply. I’ll check the two sources carefully.

I checked the two I mentioned before.
(1) The mass of the estimated propagator returned by the estimator.estimate() is already set properly, which is the value set for propagator builder used by estimator.
(2) I tried re-build a new propagator with the estimated orbit and other estimated parameters, the residual is same as the estimated propagator.

ps: Both propagator are used in ephemeris mode firstly, rather than propagated measurement by measurement. Formerly, the re-computed residuals are wired by propagating measurement by measurement. If ephemeris mode is used, the residual is much acceptable.

    estimatedPropagators = estimator.estimate()
    estProp = estimatedPropagators[0]

    # New a propagatorBuilder similar to the one used in the estimator,
    # except the orbit is the estimated orbit.
    estOrbit = estProp.getInitialState().getOrbit()
    propagatorBuilderConfig = NumericalPropagatorBuilderConfig(estOrbit)
    propagatorBuilder = propagatorBuilderConfig.configure(cfg)

    # update the estimated parameters. Here are Cds for ajisai.
    propagatorParameterDriversList = propagatorBuilder.getPropagationParametersDrivers()
    for name in ['Cd0', 'Cd1', 'Cd2']:
        value = estPropagatorParameterDriversList.findByName(name).getValue()
        propagatorParameterDriversList.findByName(name).setValue(value)

    normalizedParameters = propagatorBuilder.getSelectedNormalizedParameters()
    print(normalizedParameters)
    prop = propagatorBuilder.buildPropagator(normalizedParameters)

    # Enter ephemeris mode, 6 days after the od epoch.
    # Data between absdateOd and absdateEnd (3 days later) are used to estimated the orbit.
    # And it is predicted for extractor 3 days.
    absdateStart = absdateOd
    absdateEnd = absdateOd.shiftedBy(3 * Constants.JULIAN_DAY)
    datePredEnd = absdateEnd.shiftedBy(3 * Constants.JULIAN_DAY)
    generator = prop.getEphemerisGenerator()
    prop.propagate(absdateStart, datePredEnd)
    ephProp = generator.getGeneratedEphemeris()