NotImplementedError when trying to use Orbit class


I am using the orekit python wrapper in Anaconda (Spider version=5.1.5, Python version=3.8.12). I am trying to generate an Orbit object in order to use it for numerical orbit determination.

Although the arguments seem to be correctly defined to me,

Out[2]: <TimeStampedPVCoordinates: {2022-02-28T01:01:01.000, P(7246501.833749097, -6629344.953026285, -379029.58411002025), V(239.41055302605602, 8.121210084076568, 5793.972294831995), A(-3.042118686204863, 2.7830331171467266, 0.15911856628444881)}>

Out[3]: <FactoryManagedFrame: EME2000>

Out[4]: 398600441800000.0

when I write

orbit = Orbit(pv, OrekitFrame, mu)

I receive the following error:

NotImplementedError: ('instantiating java class', <class 'org.orekit.orbits.Orbit'>)

I do not understand what I could be doing wrong, do you think I am making some silly mistake or could it be something related to the Java - Python interface?

Thank you again forum for your invaluable help.

Hi @marc,

In Java the Orbit class is abstract and its constructor protected.
So you cannot instantiate it like that (in Java and Python), you have to chose either CartesianOrbit, KeplerianOrbit, EquinoctialOrbit or CircularOrbit.

Given that your inputs are PVs I would recommend using

orbit = CartesianOrbit(pv, OrekitFrame, mu)

I admit that the error thrown by Python (probably from JCC?) is not super helpful.

Hope this helps,

Thank you a lot @MaximeJ. I just did as you said and it works perfectly.