A roadmap to support SPICE file types

Hi,

I have recently been working on adding potential support to file types defined in SPICE. These include actually a variety of file types providing different information, so I’d like to share my current view of the steps I’d like to take to add support for these files and see what people think about these potential features :slight_smile:

This is a quick overview of the general file types that are currently handled by SPICE routines (described in SPICE required reading docs):

  • DAF files (Double Precision Array Files): this is a very generic file type which is used as the basis to define more specific file types. In particular, the following 3 file types rely on DAF specifications: SPK (Spacecraft and Planet Kernel), PCK (Planetary Constants Kernel) and CK (C(amera)-matrix Kernel). SPK provide ephemeris for a target body, PCK provide orientation parameters for a target body-fixed frame with respect to an inertial frame and CK provide attitude data of spacecraft parts. I believe SPK and PCK would probably the SPICE file types of highest interest at this point.
  • DAS files (Direct Access Segregated Files): this is another generic file format that generalizes even further DAF files to also support storage of integers and characters-based data. This format is the basis of DSK (Digital Shape Kernels) and EK (Event Kernels). DSK provide information about the 3D shape of objects more complex than ellipsoids. EK provide sequence of events in a given mission.
  • SCLK files (Spacecraft CLocK): these provide data to convert from spacecraft clock data to other timescales. These seem to be important when handling CK files, since CK give attitude data referenced to spacecraft clock.

And this is the current roadmap that I envision:

  1. Add support for generic DAF files (a prototype is available in merge request 756)
  2. Add support for SPK files. This includes both reading files and evaluating them at given target times to obtain state vectors. This covers 16 different SPK types (a prototype is also available in merge request 756)
  3. Add support for PCK files, including also reading files and evaluating them. There is 3 different PCK types. A prototype is available in my issue-1571 branch, still not shared as a merge request since this builds up on the support for generic DAF files implemented by merge request 756.
  4. There is text-based versions of SPK kernels (this would be for example the ASCII versions of DE files) and PCK kernels. It probably would be easy to add support for these as well, having already support for the binary versions.
  5. Add support for SCLK files.
  6. Add support for CK files. It seems SCLK handling would be required to properly handle CK files. There is a single CK type.
  7. Add support for generic DAS files.
  8. Implement EK kernels
  9. Implement DSK kernels

What do you think about it? It seems SPK and PCK kernels are probably interesting additions. Would there also be interest in the other file types? I’m happy to tackle these as well. If so, would any of the file types be of particular interest? I think many (all?) of the data types provided in these files already have related data structures implemented in Orekit. So it could be a nice extension of available data sources.

And of course, I aim to provide example files for all implementations, with results verified against CSPICE :slight_smile:

Best wishes,

Rafa

2 Likes

Hello @Rafa,

This would be awesome, many thanks for working on this topic !

I lack experiences in these formats so i will let other orekit developers/users answer your question :sweat_smile:.

Again, many thanks for your contributions !

Cheers,
Vincent

1 Like

Hello @Rafa,

Same as @Vincent, I don’t know much about SPICE kernels. But the roadmap you propose looks well-ordered to me. Thanks for tackling this!!

Cheers,
Maxime

1 Like

Looks great @Rafa

I’ll follow your updates!

1 Like

Thank you for doing this, it’s going to be useful to be able to pull SPICE kernels directly into Orekit. Python has some wrappers around CSPICE but this will make things much cleaner :slight_smile:

1 Like