Loading normalized spherical harmonics for the moon

I would like to set up a Holmes Featherstone attraction model for the moon but I notice there are parameters missing for the provided file found at:
http://icgem.gfz-potsdam.de/home
when compared to the default Eigen 6s Earth model that Orekit uses. I copied the set up as the wrappers were private and it is throwing an error when propagating that the math integrator constantly needs a smaller minimum step size. Could this be due to the missing parameters or is it maybe due to another property of the file?

Dear @FrankMason,

What missing parameters are you talking about ?
Are they the time varying coefficients found in the Earth gravity field models (the gfct, trnd, asin, acos etc.) ?
If yes I think it should be fine.

Could you please post the Moon file you want to use and a piece of code that reproduce your error ?
It’s hard to help you further without this.

If the format of the file or its content was wrong you would have had an exception thrown prior to propagation I think. So my guess is that it comes from somewhere else in your code. But again it’s hard to tell without the code :wink:

Maxime

Thank you for your fast response!
The Eigen file has:

key    L    M         C                  S           sigma C    sigma S   t0[yyyymmdd]
                                                                          period[y]
end_of_head ===========================================================================
gfc    0    0  1.00000000000e+00 0.000000000000e+00 0.0000e+00 0.0000e+00

whereas the file I am trying to read has:

key    L    M         C                  S
end_of_head ===========================================================================
gfc    0    0   -1.091875031945817e-03    0.000000000000000e+00

it only contains the type gfc.

and I changed only one line ( to add || tab.length == 5) in the ICGEMFormatReader to read:

else {
					if (((tab.length == 7 || tab.length == 5) && GFC.equals(tab[0])) || (tab.length == 8 && GFCT.equals(tab[0]))) {

Hi Frank,

Could you upload a sample code showing the error for us ?
And also tell us the name of the file you downloaded from ICGEM website ?
So we can try your code and see where the bug is.

The gfc are the constant coefficients for the gravity field.
The missing ones in your Moon file are time varying components.
It is normal that they are missing and it should not be a problem for Orekit to read them. Actually I just did a quick tryout and it works.

Cheers,
Maxime

Hi Frank,

The GL0660B model (http://icgem.gfz-potsdam.de/getmodel/gfc/b4f8182e0e0a2112fc3720a2fb5d10f885e4aed39652b8ba8e9d3c2a8645c29c/GL0660B.gfc) I have been using does have sigma C and sigma S columns, so 7 columns in total.

The following piece of code works for me for instance:

GravityFieldFactory.clearPotentialCoefficientsReaders();
ICGEMFormatReader potentialCoefficientsReader = new ICGEMFormatReader("GL0660B.gfc", false);
GravityFieldFactory.addPotentialCoefficientsReader(potentialCoefficientsReader);
NormalizedSphericalHarmonicsProvider moonHarmonicsProvider = GravityFieldFactory.getNormalizedProvider(64, 64);
ForceModel moonForceModel = new HolmesFeatherstoneAttractionModel(
                CelestialBodyFactory.getMoon().getInertiallyOrientedFrame(), moonHarmonicsProvider);

Cheers
Clément

Thank you both for your help. Could you give me an example of an orbit where this has worked for you?

Thanks

This has worked for a NumericalPropagator using a DormandPrince853Integrator for a Moon orbit, with minimum step size 0.01 second and maximum step size 300 seconds if I remember correctly.

ok thank you for this.

to just be clear, for the line in the ICGEMFormatReader which reads:

rescale(1.0 / Constants.JULIAN_YEAR, normalized, cArrayTrend, sArrayTrend, wantNormalized, cArrayTrend, sArrayTrend);

will this still work for the moon? I am unsure how this scale factor of Julian year works?

thanks