Get Gravitational Potential (Scalar Value) from GravityField

Hi All, :smiley:

I would like to be able to get values of the gravitational potential (scalar) at some ECEF coordinate.

I have so far only been able to retrieve acceleration as follows:

pv = [6878137, 6878137, 6878137,0,0,0]
utc = TimeScalesFactory.getUTC()
Epoch_date = AbsoluteDate(2020, 1, 18, 23, 59, 42.0, utc)

gravityProvider = GravityFieldFactory.getNormalizedProvider(4, 4)
gravityfield = HolmesFeatherstoneAttractionModel(FramesFactory.getITRF(IERSConventions.IERS_2010, False), gravityProvider)

grav_parameters = ForceModel.cast_(gravityfield).getParameters()
grav_acc = gravityfield.acceleration(state, grav_parameters)

print(f"grav field {grav_acc}")

grav field {0.0005050566; 0.000516695; -0.0009966635}

I have been looking at the documentation pertaining to the GravityFieldFactory class but so far cannot see anything that might return the value of the potential energy. I presume it must be calculated in the backend somewhere, I’m just not sure how to expose it through the python bindings. Do I need to write some custom plugin?

Thanks a lot for any help!

Charles

Hello @charlesc,

I think the method you’re looking for is
HolmesFeatherstoneAttractionModel::value(…)
.
Am I right?

Cheers,
Maxime

1 Like

yes! Thank you!!

Just in case anyone wants to see how to use it I simply use:

grav_pot = gravityfield.value(Epoch_date, position, MU)
3 Likes