[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] Cartesian Oribt with the Python wrapper



Hi Sébastien,

Thanks for the feedback, I will collect some more examples on the webpage! After the first "hurdle" of the java-python bridge and the start up stuff, it is possible to use the java documentation.

There are some more examples in the git repo that you may not have seen,
The example directory:
https://www.orekit.org/forge/projects/orekit-python-wrapper/repository/revisions/orekit-v8/show/examples

And lately I've added a bunch of tests for the conda build, these are largely translated from the java test suite:
https://www.orekit.org/forge/projects/orekit-python-wrapper/repository/revisions/orekit-v8/show/orekit-conda-recipe/test

The EventHandlerTest.py contains a creation of orbit from PVCoordinates, in summary:

Startup orekit for python:
import orekit
orekit.initVM()
from orekit.pyhelpers import  setup_orekit_curdir
setup_orekit_curdir()

The Vector3D class is from orekit 8.0 in the hipparchus module:

from org.hipparchus.geometry.euclidean.threed import Vector3D
from org.orekit.utils import PVCoordinates
from org.orekit.time import AbsoluteDate, TimeScalesFactory
from org.orekit.frames import FramesFactory
from org.orekit.orbits import KeplerianOrbit
from org.orekit.utils import Constants

initialDate = AbsoluteDate(2014, 01, 01, 23, 30, 00.000, TimeScalesFactory.getUTC())
inertialFrame = FramesFactory.getEME2000() # inertial frame for orbit definition
position  = Vector3D(-6142438.668, 3492467.560, -25767.25680)
velocity  = Vector3D(505.8479685, 942.7809215, 7435.922231)
pvCoordinates = PVCoordinates(position, velocity)
initialOrbit = KeplerianOrbit(pvCoordinates,
                                      inertialFrame,
                                      initialDate,
                                      Constants.WGS84_EARTH_MU)


and then you can 
print initialOrbit

keplerian parameters: {a: 7069220.381357356; e: 4.777348752674507E-4; i: 98.18525099174988; pa: 13.741082766403123; raan: 150.34825333049; v: -13.952173210297032;}

Regards
/Petrus


On Thu, Sep 29, 2016 at 10:19 PM, Fourest Sebastien <sebastien.fourest@cnes.fr> wrote:

Hello,

 

I can’t find out how to create a CartesianOrbit instance from two simple arrays Position and Velocity with the python wrapper. I think that I am supposed to create first two Vector3D objects, but I can’t see how to create them…

 

More generally, it would be very useful to have a manual, or some examples, of orekit code developed with python. There are a few ones on the wiki, but it is very limited, and I must say that trying to write a code from scratch is almost impossible…

 

Thanks a lot !

 

Sébastien Fourest




--
_____________________________________________
Petrus Hyvönen, Uppsala, Sweden
Mobile Phone/SMS:+46 73 803 19 00