[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orekit Users] June 2012 Leap Second



Matt Edwards <matt.edwards.issinc@gmail.com> a écrit :

Hello,
Hi Matt,

I am trying to verify if the upcoming leap second has been added into the
toolkit or not. I am currently using jar 5.0.3 in my project and am not
seeing
proper functionality.

I have:

UTCScale utcScale = TimeScalesFactory.getUTC();
String date = "2012-07-01T00:00:00.000";
AbsoluteDate ad = new AbsoluteDate(date, utcScale);
AbsoluteDate base = new AbsoluteDate(2012, 06, 30, 23, 59, 59.0, utcScale);

System.out.println("UTC offset from TAI:" + utcScale.offsetFromTAI(base));
System.out.println("UTC offset from TAI:" + utcScale.offsetFromTAI(ad));
System.out.println("Duration: " + ad.durationFrom(base));

prints:
UTC offset from TAI:-34.0
UTC offset from TAI:-34.0
Duration: 1.0

This code prints a difference of -34.0 seconds. However there will be a Leap
Second added at the end of June 2012 resulting that the proper answer is -35
seconds. and a Duration of 2seconds between these dates.
The leap seconds data per se is not embedded into Orekit. The library  
loads the UTC-TAI.history file provided by the user. In the source  
archive of the library, a small subset of data is already available,  
but it is mainly used for the internal unit test, it is not intended  
as a definitive or complete data source.
Users are expected to manage data by themselves. Orekit support  
different way to customize data loading, as some users prefer to have  
a set of files on disk for a desktop usage, some other users prefer to  
have data in classpath for a server or embedded usage, and still other  
users prefer to download directly data from the network for mobile and  
always up to date usage. The configuration mechanism is described  
here: <https://www.orekit.org/forge/projects/orekit/wiki/Configuration>.
If you want to take the upcoming leap second into account, you need to  
have an up to date UTC-TAI.history file. The Orekit wiki page above  
shows the URL to update the various files Orekit can handle (look at  
the bottom of the page). The table in this page shows the  
UTC-TAI.history file can be retrieved from this URL:  
<http://hpiers.obspm.fr/eoppc/bul/bulc/UTC-TAI.history>.

The dates should function as per this link
ftp://hpiers.obspm.fr/iers/bul/bulc/bulletinc.dat

2012 June 30,     23h 59m 59s
2012 June 30,     23h 59m 60s
2012 July  1,        0h  0m  0s

If I have something flawed in my approach please let me know. Or if there
will
be a new release prior to the end of the month, I will grab the update then.
The next Orekit version will be 6.0. Its release date is not known  
yet. The Project Management Committee will decide at the start of July  
what must be included in this version. The current state is however  
quite stable, and we don't expect too much change, so we hope the  
version will be released soon.
The upcoming 6.0 version is a large change with respect to the  
previous 5.x branch. It will not be compatible with 5.x (this is the  
reason why the major number as changed). I strongly advise you to look  
at this version and to prepare to update your code. Developing a new  
application for 5.x should be avoided.
best regards,
Luc

Regards,
Matt E.



----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.