Orekit frame transformation caching and interpolation

I have read through the discussion here: Orekit Caching Feature Behaviour.

I am wondering about the possibility of Orekit exposing functionality so that a client can provide his own custom frame transformation caching/interpolation algorithms for more fine-grained control over memory usage and performance. Uses of InterpolatingTransformProvider, ShiftingTransformProvider, and GenericTimeStampedCache are hardcoded in AbstractFrames.

Here is one proposal for how this functionality could be added: Add a new constructor to AbstractFrames taking an additional parameter such as a Map<Predefined, UnaryOperator<TransformProvider>> which would allow a client to provide a custom transformation wrapper for each Predefined frame. If no entry is present, no wrapping of the raw transform would be done. The existing constructors would delegate to the new constructor, passing a map defining the caching/interpolating wrappers which are currently hardcoded. I am not sure what would be done for

  • The versioned ITRF frames. I have never used this functionality. It looks like the versioned ITRF frame uses the same TransformProvider as the “raw ITRF” frame, so maybe there would be nothing to be done.
  • The uncached ITRF frames. I have never used this functionality either. These use custom-built ITRF, TIRF, CIRF frames which are separate from the Predefined frames. The TransformProvider between CIRF and GCRF hardcodes a ShiftingTransformProvider, which uses an InterpolatingTransformProvider, which uses a GenericTimeStampedCache. Ideally this could be overridden also, but the necessary UnaryOperator<TransformProvider> could not be obtained from the Map I suggested above. Perhaps the Map could instead be a Map<CoarsePredefined, UnaryOperator<TransformProvider>> where CoarsePredefined is a new enum with values such as CoarsePredefined.ITRF instead of Predefined.ITRF_CIO_CONV_2010_SIMPLE_EOP, Predefined.ITRF_CIO_CONV_2010_ACCURATE_EOP, etc. Groups of values of the Predefined enum corresponding to different convention variants would map to a single value of the CoarsePredefined enum. And CoarsePredefined could be used as a key to obtain a UnaryOperator<TransformProvider> both when building the cached, predefined frames and when building the uncached ITRF frames. (I don’t like the CoarsePredefined name, it is just a placeholder for discussion.)

These are just thoughts I am throwing out there to see if there is interest in such a feature. If there is interest, I am open to implementation ideas that are much better than my suggestions above.

Hi @andrewsgoetz,

Part of what you propose could indeed be done through the recently introduced TimeInterpolator interface even though we would have to tweak it so that it could use a custom cache as well instead of the predefined GenericTimeStampedCache.

I left the parts related to the transform interpolation mostly untouched because it was adding several modifications and i could not see the end of it (especially when i had done 10k+ lines of code :sweat:).

Long story short i believe that what you propose would not be that hard to do and would be very interesting :+1:

Cheers,
Vincent