Once again hi guys !
I’m trying to use a Kalman filter in order to estimate my initial orbit from noised measurements (Range, RangeRate, AngularAzEl).
I’d like to feed my estimator with one mesurement of each at each timestep but I have some difficulties whit the usage of the Kalman Filter with orekit. I don’t really understand how to builder the estimator and ho to feed it correclty.
Here is the function I created, is anybody who has the kindness to take a look and tell me what going on please ?
def performEKF(mesurementsFrame, initialOrbit, initialCOV):
# Init lists to get the evolution of the filter
listPropagators = np.array([])
listOrbits = np.array([])
listStates = np.array([])
listCOVmatrixes = np.array([])
# Init process noise matrix
Q = MatrixUtils.createRealDiagonalMatrix([1e-8, 1e-8, 1e-8, 1e-8, 1e-8, 1e-8])
# Init Keplerian Propagator Builder
integratorBuilder = DormandPrince853IntegratorBuilder(PROP_MIN_STEP, PROP_MAX_STEP, PROP_POS_TOLERANCE)
kepPropagatorBuilder = NumericalPropagatorBuilder(CartesianOrbit(orbitEstimate), integratorBuilder, PositionAngle.MEAN, estimator_position_scale)
# Build the Kalman filter
kalman = KalmanEstimatorBuilder().addPropagationConfiguration(kepPropagatorBuilder,
ConstantProcessNoise(initialCOV, Q)).estimatedMeasurementsParameters(ParameterDriversList()).build()
# Process filtering
for date, meas in mesurements.iterrows():
kalman.estimationStep(meas['rangeMes'])
kalman.estimationStep(meas['rangeRateMes'])
newPropagator = kalman.estimationStep(meas['angularAzElMes'])[0]
newEstimatedOrbit = newPropagator.getInitialState().getOrbit()
newEstimatedState = kalman.getPhysicalEstimatedState()
newCovMatrix = kalman.getPhysicalEstimatedCovarianceMatrix()
listPropagators = np.append(listPropagators, newPropagator)
listOrbits = np.append(listOrbits, newEstimatedOrbit)
listStates = np.append(listStates, newEstimatedState)
listCovmatrixes = np.append(listCovmatrixes, kalman.getPhysicalEstimatedCovarianceMatrix())
return listPropagators, listOrbits, listStates, listCovmatrixes