Getting Access to KalmanEstimation from Kalman Filter results

Hi @aerow610,

I’ve seen you posted on the “Orekit Python Wrapper” Gitlab forge too.
So I don’t know if my answer will be redundant with Petrus’ one, or if you’ve solved your issue already.

As I said earlier I’m not an expert in Python so I’ll try my best :wink:

As Petrus suggested, I think you need to subclass the PythonKalmanObserver class.
Suppose you call it “MyKalmanObserver”.

In this class you define the function “evaluationPerformed” where you extract or print the data you need (spacecraft states, residuals etc.).

You should look up the examples on the forge, like the OrekitStepHandlerTest. You need to reproduce the sub-classing done at line 99 or line 148.

Once you’ve written “MyKalmanObserver”, you must instantiate it and pass it to the Kalman with “setObserver”.

Below is an example that I haven’t tested… It supposes you have a “KalmanEstimator” object defined in variable “my_filter”.

class MyObserver(PythonKalmanObserver):
    def evaluationPerformed(self, kalmanEstimation):
        print(kalmanEstimation.getCorrectedMeasurement().getObservedValue())

my_filter.setObserver(MyObserver())

I hope this will help you.
Maxime