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

Re: [Orekit Users] CPython interface question



Hi Piyush,

As expected, the example works here, so should indeed be something with the wrapping with JCC. I do not remember experience this error but would recommend to upgrade JCC to latest version from svn/pypi (2.14).

Since some time I have been testing a new feature in JCC, non-flat namespace. Don't know if would affect your problem, but it gives a cleaner buildfile without problems of duplicate names, and  a import syntax close to the java original. 

For the non-flat namespace I have the buildfile:

python -m jcc \
--arch x86_64 \
--shared  \
--use_full_names \
--python orekit \
--version 6.0.0 \
--jar orekit-6.0-SNAPSHOT.jar \
--jar commons-math3-3.0.jar \
--package java.io \
--package java.io.InputStream \
--package java.util java.util.Arrays \
                    java.util.HashMap \
                    java.util.HashSet \
                    java.util.List \
                    java.util.ArrayList \
                    java.util.Collection \
                    java.util.Collections \
                    java.util.Date \
                    java.util.Map \
--package java.io java.io.StringReader \
                    java.io.InputStreamReader \
                    java.io.FileInputStream \
--package org.apache.commons.math3.geometry.euclidean.threed.Vector3D \
--reserved INFINITE \
--reserved ERROR \
--reserved OVERFLOW \
--reserved NO_DATA \
--build \
--install 


The import statements then for your example looks like:

import orekit
orekit.initVM()

from org.orekit.data import DataProvidersManager, ZipJarCrawler
from org.orekit.frames import FramesFactory
from org.orekit.bodies import OneAxisEllipsoid
from org.orekit.time import TimeScalesFactory, AbsoluteDate
from org.orekit.orbits import KeplerianOrbit
from org.orekit.utils import Constants
from org.orekit.propagation.analytical import KeplerianPropagator
from java.io import File


Best Regards
/Petrus



	

On 25 dec 2012, at 10:18, Piyush Agram <piyush@gps.caltech.edu> wrote:

> Hi Petrus,
>     the example on the wiki also fails on the same propagate step. Changing the propagator does not change this behavior. All the transforms and problem setup till the propagate step behave as expected as far as I can tell. Print statements result in reasonable values.  I have attached a simple python file derived from the example on the wiki that causes the failure.
> 
> Here are more details about the machine that I'm working on:
> 
> Ubuntu 12.04 64-bit with Python 2.7 and JCC 2.11-3 (Default obtained using yum). My build script did not use the --shared or --arch flag .
> 
> Linux piyush-blah 3.2.0-35-generic #55-Ubuntu SMP Wed Dec 5 17:42:16 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
> 
> Thanks,
> Piyush
> <simple_orekit.py>