TileUpdater in Python

Dear all,

I have been working with Orekit quite a while and I wanted to start trying Rugged for Earth observation applications. I would like to implement a tileUpdater to Noaa’s GLOBE DEM like in this example here: An example of tileUpdater to Noaa's GLOBE DEM.

The problem is that I have experience with Orekit but always using the Python wrapper, not in Java… I saw here:

that @yzokras imports a PythonTileUpdater to perform the subclassing of TileUpdater like with other classes to use them in Python, but I am not sure how to do the same.

Is there anything I need to know or can you show me a way to do it?

Thank you!

Any help? :sweat_smile:

Hi @Checa ,

I am not sure I understand your question, but reading your question I got to review the Rugged that was part of the Orekit python package, and it was not updated properly for the python wrapper 12.0 release. Now there is a build-1 soon on the servers that contains an updated Rugged package with the Python additional classes.

To get further help I think you need to specify more your question?

Hi @petrus.hyvonen , thanks for answering!
Basically, what I am looking for is for the class “PythonTileUpdater” in order to create my own
“TileUpdater” class.

I just brought the post of @yzokras because I saw in his code the line where he imported it:

from org.orekit.rugged.raster import PythonTileUpdater

but I get the error: cannot import name ‘PythonTileUpdater’ from ‘org.orekit.rugged.raster’.

Thank you again

Hi @Checa ,

Now with the updated 12.0.1 build 1 it should work using conda packages. It was a problem with rugged wrappers in the previous 12 versions.

Regards

Hi @petrus.hyvonen ,

Got it, thank you!

Regards

Hi @petrus.hyvonen again,

It works! But now I am facing a different problem. I saw that in the new version of Orekit the TimeStampedPVCoordinates class has no attribute interpolate, and same with Vector3D and normalize.

So when I build the RuggedBuilder() I get this error:

java.lang.NoSuchMethodError: org.orekit.utils.TimeStampedPVCoordinates.interpolate

and when I get the LOS using los = lineSensor.getLOS(firstLineDate, int(1)) I get the following error too:

java.lang.NoSuchMethodError: org.hipparchus.geometry.euclidean.threed.Vector3D.normalize()

Should I make a different post for this?

Regards

Hi again, sorry for posting again here, but I would like to know if there is a way to use RuggedBuilder().build as I’m currently facing the errors I’ve mentioned in the comments.

Thank you in advance.

Hi,

The normalize is part of an inherited interface and may need to be casted to be accessible, see
https://hipparchus.org/apidocs/org/hipparchus/geometry/euclidean/threed/Vector3D.html

so the cast should be to Vector.cast_ and import before from org.hipparchus.geometry Vector

org.orekit.utils.TimeStampedPVCoordinates does not seem to have a method “interpolate” - org.orekit.utils.TimeStampedPVCoordinates

https://www.orekit.org/site-orekit-latest/apidocs/org/orekit/utils/TimeStampedPVCoordinates.html

Hi,

Please Checa, could it be possible to give us some code snippets. It seems that you use JAVA class through Python bindings where inheritence is not straightforward. As mentionned by @petrus.hyvonen some cast are needed

Hi,
Thank you both for you answer.
@petrus.hyvonen. Exactly, org.orekit.utils.TimeStampedPVCoordinates does not seem to have a method “interpolate”. That’s why I do not know why I receive the error: “java.lang.NoSuchMethodError: org.orekit.utils.TimeStampedPVCoordinates.interpolate” when I call the method “build” of the ruggedBuilder.

@jonathan.guinet I basically followed the tutorial of direct location. And when I build the rugged builder:

rugged_builder = RuggedBuilder()
rugged_builder.setAlgorithm(demAlgoId)
rugged_builder.setDigitalElevationModel(demTileUpdater, nbTiles)
rugged_builder.setEllipsoid(EllipsoidId.WGS84, BodyRotatingFrameId.ITRF)
rugged_builder.setTimeSpan(
    acquisitionStartDate, acquisitionStopDate, tStep, timeTolerance
)
rugged_builder.setTrajectory(
    InertialFrameId.EME2000,
    satellitePVList,
    nbPVPoints,
    CartesianDerivativesFilter.USE_P,
    satelliteQList,
    nbQPoints,
    AngularDerivativesFilter.USE_R,
)
rugged_builder.addLineSensor(lineSensor)
rugged = rugged_builder.build()

I receive the error mentioned before.

Also, when I do:

firstLineDate = lineSensor.getDate(0.0)
los = lineSensor.getLOS(firstLineDate, 0)

I receive the error: java.lang.NoSuchMethodError: org.hipparchus.geometry.euclidean.threed.Vector3D.normalize()

So I do not know how to perform the casting since it is not straight forward like other cases.

Thank you in advance

Hello, @petrus.hyvonen !

I am facing the same issue in Python. I have the most recent version of Orekit and I also can’t find the PythonTileUpdater.

I already created a different environment, downgraded, upgraded in order to test the issues, and it still persists on Orekit version: 12.1.2.

Yesterday, I posted in the forum (Set Digital Elevation Model on Rugged Builder) where I was capable of importing it once, but I got with an error NotImplementedError: ('instantiating java class', <class 'tu2.DEMTileUpdater'>). Yet, I could not reproduce this later, only with the TileUpdater function.

Is it possible that there still is an issue with the library, or am I missing something?

Hi, thanks for the report, I can confirm it is not working in the current version, the Python classes are missing. Will look into it coming days.

2 Likes

A new build #2 is currently in the pipeline and should be available in some 10’s mins, this new should contain the missing Python wrapper classes.

2 Likes