Custom BatchLSObserver with Python wrapper

I am using the Orekit Python wrapper to do Orbit Determination.
I would like to use a specific implementation of the interface BatchLSObserver.
Is it something that we can do with the Python wrapper ?
Many thanks

Hi @Anthony-C31

Welcome to the Orekit forum!

Did you try to use the PythonBatchLSObserver class? It is the Python wrapper’s equivalent of the BatchLSObserver Orekit class.

You can try something like:

class MyObserver(PythonBatchLSObserver):
    def evaluationPerformed(self, itCounts, 
           evCounts, orbits, orbParams, propParams, 
           measParams, provider, lspEval):
        # Do what you want

Best regards,

Thanks for your help.
I can’t find the class PythonBatchLSObserver. Which import shall I do to use it ?

Once the class is created, I suppose I’ll just have to use
Is that correct ?


That’s strange. Looking at the conda-forge package, I can see the PythonBatchLSObserver class in the org.orekit.estimation.leastsquares package.

Yes, it is


Unfortunately, I get this error when trying to set the Observer:


orekit.InvalidArgsError: (<class ‘org.orekit.estimation.leastsquares.BatchLSEstimator’>, ‘setObserver’, <class ‘main.od_observer’>)

Could you show me how do you implement and instanciate the observer?

Your reply made me think that I forgot to instantiate the class “od_observer”

I used
instead of

Seems to work now,
Thanks a lot

1 Like

Good :slight_smile: