Overriding parser in TAIUTCDatFilesLoader


I am going to be adding Orekit to an existing project so that I can use the AbsoluteDate class to handle leap seconds, with the potential of using other aspects of Orekit in the same application in the future.

I would like to use the existing leap second files we have currently in the system rather than having to import/regenerate the tai-utc.dat file. However, I can’t quite wrap my brain around how I would override the activity of TAIUTCDatFilesLoader.parser() to parse while still using AbsoluteDate.

Can anyone point me in the direction of how I would go about doing this?

For reference, the file I wish to load is the LeapSecond.dat file provided by AGI for their software.


Try adding this AGILeapSecondFilesLoader.java (9.5 KB)

I will probably add this for Orekit next version.

In order to use it, you have to insert the following statement at the beginning of your code:

        TimeScalesFactory.addUTCTAIOffsetsLoader(new AGILeapSecondFilesLoader(AGILeapSecondFilesLoader.DEFAULT_SUPPORTED_NAMES));

I have created issue 737 for this,
pushed the corresponding code in the develop branch, with some tests and closed
the issue.

I have also set it up so that it is one of the default loaders, so you do not have to call TimeScalesFactory.addUTCTAIOffsetsLoader as I wrote in the previous comment, now it is already done by default. Just put the file somewhere Orekit can find it (typically in your orekit-data folder) and it will be found automatically.

Thanks for the quick reply Luc. Am I correct in assuming that to use this I’ll have to import the orekit source code into my project and then put this in the org.orekit.time package? Right now I’m only using the .jar files (although I have downloaded the source code).


You can get the latest snapshot from the maven-snapshot section in our nexus repository.
You’ll have to browse for the latest 10.3 jar snapshot that was automatically built when I pushed the latest changes.

Thanks Luc. I am an absolute novice at maven, so I couldn’t figure out how to get this into Eclipse as a maven project, but I did create a project with the 10.2 source code I already had and the AGI Leap Second parser works great.

Since you have the leap second parser, would you also happen to have the EOP and SpaceWeather parser for those AGI files? Not really needed right now, but having them would mean future integration would be much easier.

Thanks again for the help!

We already have SpaceWeather parser since 10.2. See the javadoc for class CssiSpaceWeatherDataLoader.

Could you open a feature request for EOP data?

Sure! Do I do that through the Bug Tracker? Or is there another place for feature requests?

Thanks again. This continues to be a great resource!


Yes, the bug tracker is the proper place to ask for a new feature.
There are predefined labels that you can set up in the boxes below the issue text, one of which is “Feature”