Hi,
I have experienced some issues, I believe, with the cache used by Orekit in Frame transform.
Here is a snapshot of a code where I see this issue:
FactoryManagedFrame itrf = FramesFactory.getITRF(IERSConventions.IERS_2010, false);
FactoryManagedFrame tod = FramesFactory.getTOD(true);
double step = 3600.0;
AbsoluteDate initialDate = new AbsoluteDate(2020, 1, 1, 0, 0, 0.0, TimeScalesFactory.getUTC());
AbsoluteDate maxDate = new AbsoluteDate(2022, 1, 1, 0, 0, 0.0, TimeScalesFactory.getUTC());
long timeBefore = System.currentTimeMillis();
for (AbsoluteDate currentDate = initialDate; currentDate.isBefore(maxDate); currentDate = currentDate.shiftedBy(step)) {
Transform transformationAtInitial = itrf.getTransformTo(tod, initialDate);
Transform transformationAtCurrent = itrf.getTransformTo(tod, currentDate);
}
long timeAfter = System.currentTimeMillis();
System.out.println("Number of elapsed seconds are:" + (timeAfter - timeBefore) * 1e-3);
When my maxDate is 2021/01/01, the excecution time of this code is about 1sec, and when my maxDate is in 2022/01/01, it is about 60s
I think the way cache is orchestrated in Orekit may be responsible for this large difference in execution time. From what I understood, Frame transforms are stored in cache with a max length of 1 year.
The code above is close from a real context when I have to request transform successively at times before and after the stored cache. When the difference between the two times is lower than 1 year, everything works perfectly. However, once the difference is larger than one year, the code spends a lot of time rebuilding cache successively before and after. Therefore, the number of requests to frame transform increases a lot.
I do not know if I was clear, I can provide some drawings if necessary.
What do you think? Did I understand this issue correctly? Do think you could have a solution?
Thank you for your time,
Dorian