Packageing orekit-data in my App

Hello,
Can anyone point me to an example of how to package the orekit-data?

I am very new to OreKit and any best practices associated with creating a Java program that uses it. I have read that I shouldn’t package the orekit-data into my Jar because the data might change. I also found an article that seemed to suggest there was a way to include only the orekit-data I actually use. Is there any documentation that I might have missed?

Thank you.
sg

You can look at the first few paragraphs of data contexts and at the recommended default setup.

If you want to know which data is really used by your application, you can add the following statement at the end of a run, it will print what was loaded:

    DataContext.
        getDefault().
        getDataProvidersManager().
        getLoadedDataNames().
        forEach(s -> System.out.println(s));

Then you can remove from the orekit-data the files that were not really used. Be aware that the list is only representative of the current run, if you change your program input data, it may need to load a different set of files.

1 Like

Hi @luc ,

Thank you too.
I put some gravity models in Potential directory. Through this, I do know the EGM96.gfc is used.

ps, how to specify which potential is used?

Best,
Rongwang

You should put only one gravity field model in orekit-data. The library will pick up the first one if it finds, so if you put several, you don’t know which one is used.
If you need several gravity fields at once, you should not use the default loading mechanism but load each field by yourself.

To add up to Luc’s answer, @lirw1984, you can consider using the FilesListCrawler to specify the files you want to use.