Loading the GRGM1200B lunar gravity model

Hi all,

I have recently started to learn Orekit. I am using the Python interface. Thanks a lot for the very nice documentation, which has been really helpful in getting started.

I have however been stuck for a while while trying to load the lunar GRGM1200B gravity model (PGDA - New GRAIL model and a look at crustal density). My current attempt at loading it looks like this:

import org.orekit.forces.gravity.potential as orekit_grav_potential

orekit_grav_potential.GravityFieldFactory.clearPotentialCoefficientsReaders()
moonFileReader = orekit_grav_potential.PythonPotentialCoefficientsReader("/my/path/to/sha.grgm1200b_sigma", True)
orekit_grav_potential.GravityFieldFactory.addPotentialCoefficientsReader(moonFileReader)
gravityProvider = GravityFieldFactory.getNormalizedProvider(300, 300)
gravityProvider.getMu()

However, this fails to correctly load the gravity field model.
Having checked the documentation, it seems to me the provided format for GRGM1200B is not amongst the standard file formats.

I guess a way around might be to convert it to another format before loading it in Orekit, but I was wondering if there was an easier solution that I’m missing?

Thanks a lot in advance

Hi @Rafa

Welcome to the Orekit forum!

In my opinion, the simpliest, and most durable solution is to implement the parser and to add it to Orekit :slight_smile:

Best regards,
Bryan

@bcazabonne thanks a lot for your reply! That sounds like a good idea. I’m happy to do that. I have checked the contribution guidelines here and tried to sign in using my Github account, but it is telling me my account is blocked and requires approval from my Gitlab administrator. Do you know by any chance how could I possibly solve this?

Thanks a lot in advance!

Best wishes,

Rafa

Hi @Rafa

I’m happy to read that you are motivated to contribute the parser :slight_smile:
I just approved your account! You can now login to the Gitlab.

Could you first open a feature request here? After that, the contribution guide you are following is very well written and helpful.

Do not hesitate if you have any question.

Best regards,
Bryan

Thanks a lot for the very prompt reply! Just opened the feature request :slight_smile:

Glad to be able to contribute even if only ever so slightly! Just to confirm, I guess the process would be to first contribute a parser in Java, and later provide integration of it in the Python interface right?

1 Like

Hello Rafa,

The python integration will be done through the Python wrapper so once it is implemented in Java, your job will be done :slight_smile: !

Cheers,
Vincent