Usage of PythonCelestialBody

I’m little confused about the usage of the PythonCelestialBody wrapper.
I’m trying to implement the testKepler in the Orekit suite test located in test/java/org/orekit/bodies/

My code is :

 import orekit
 from orekit.pyhelpers import setup_orekit_curdir


from org.hipparchus import *
from org.orekit.frames import *
from org.orekit.propagation import *
from org.orekit.time import *
from org.orekit.utils import *
from org.orekit.orbits import *
from org.orekit.bodies import *

earth =CelestialBodyFactory.getEarth()
sun = CelestialBodyFactory.getSun()
orbit = KeplerianOrbit(earth.getPVCoordinates(AbsoluteDate.J2000_EPOCH, sun.getInertiallyOrientedFrame()), 
    sun.getInertiallyOrientedFrame(), AbsoluteDate.J2000_EPOCH, sun.getGM())

which raised an error :

AttributeError: 'CelestialBody' object has no attribute 'getPVCoordinates'

I see that there is an additional PythonCelestialBody implementing the getPVCoordinates in the Orekit Python wrappers but I don’t know how to use it ?

Hi there,

Your problem is the same as here, please follow the same solution.