[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Orekit Users] Orekit Multiple Gravity Models
- To: orekit-users@orekit.org
- Subject: Re: [Orekit Users] Orekit Multiple Gravity Models
- From: MAISONOBE Luc <luc.maisonobe@c-s.fr>
- Date: Wed, 18 Jul 2018 09:46:11 +0200
- In-reply-to: <CABTK3V6HRe8TK685+r-=Pd7bHsAsxCAjs2yUqcohvWTqXedikA@mail.gmail.com>
- User-agent: Internet Messaging Program (IMP) H5 (6.2.3)
Chris N <chris.nebelecky@gmail.com> a écrit :
Hi all,
Hi Chris,
I am trying to generate an application that permits the comparison of
multiple gravity models on the propagated position of a satellite. I have
found where I can add multiple data files to the orekit-data directory, but
I do not see a way to select the model to use. Specifically, through the
GravityFieldFactory class I see that there is a list of potential
coefficients readers which presumably will read in the coefficients from
more than one model. However, through the getNormalizedProvider() method it
does not appear there is a way to select which of the providers (models) to
use. Is there a work around or other way to do this so that the model to
use can be explicitly chosen?
If you need several gravity models, you should load them directly instead
of delegating to the GravityFieldFactory, which merely just wraps all
supported formats in one place. The factory helps simple configuration
as users just drop the model they prefer in their Orekit data and the
factory will find it, trying all readers it knows about.
In your case, you must know beforehand the fields you want to load, both
their format and their names. Then you should something like:
PotentialCoefficientsReader reader1 =
new ICGEMFormatReader(nameOfFile1, true);
DataProvidersManager.getInstance().feed(reader1.getSupportedNames(),
reader1);
NormalizedSphericalHarmonicsProvider field1 =
new WrappingNormalizedProvider(reader1.getProvider(true, degree, order));
PotentialCoefficientsReader reader2 =
new ICGEMFormatReader(nameOfFile2, true);
DataProvidersManager.getInstance().feed(reader2.getSupportedNames(),
reader2);
NormalizedSphericalHarmonicsProvider field2 =
new WrappingNormalizedProvider(reader2.getProvider(true, degree, order));
Here, I used ICGEMFormatReader for both gravity fields, but you make mix
file formats if you want.
Beware! This will not compile directly because the WrappingNormalizedProvider
class is package privat and has a package private constructor, you need
to either change it to public and recompile the Orekit library, or simply
copy the class in you application and use your copy for bridging between
the reader and the spherical harmonics provider that the force model will
need. If you think this use case is widespread, you can create an issue in
the forge (you need to register first) and ask for the wrapper class to
be made public.
Note also that if instead of numerical propagator and Holmes-Featherstone
force model you use DSST propagator and zone/tesseral DSST foce models,
they will require unnormalized coefficients instead of normalized ones, so
you should adapt previous code snippet (changing classes names and the boolean
parameter in reder.getProvider call).
best regards,
Luc
Thanks for the help.
CN
Chris Nebelecky
ckn@buffalo.edu
chris.nebelecky@gmail.com