# Using SPICE kernels MoCSI supports the usage of spice kernels. For this you need to prepare a metakernel containing the paths to the individual kernels (leapseconds, planetary constants, etc.) required for the following operations. Typically, you can download metakernels directly for specific missions from the respective websites. Currently, SPICE can be used within the heliocentric distance and solar vector modules to calculate accurate distance and orientation of solar system body. The corresponding modules are `HeliocentricDistanceVariableSpice` and `SolarVectorVariableSpice`, which have to be selected as submodules of their managing modules `HeliocentricDistance` and `SolarVector`. The corresponding ini files should look like this: `HeliocentricDistance.ini`: ``` chain_insertion = "InitChain", "PreTimeStepChain" submodules = "HeliocentricDistanceVariableSpice" dependencies = "None" ``` `SolarVector.ini`: ``` chain_insertion = "InitChain", "PreTimeStepChain" submodules = "SolarVectorVariableSpice" dependencies = "None" ``` Within the submodules, the path to the metakernel needs to provided (`spice_metakernel_path`), together with other parameters, such as the `object_id` (comet 67P in this example), the `reference_frame_id` (usually `J2000`), the start time of the simulation (`start_time_utc`) and the name of the body-fixed frame (`rotating_frame_id`). Please update these values for your specific simulation case. `HeliocentricDistanceVariableSpice.ini`: ``` submodules = "None" # The submodules to be loaded beneath this module, if there are any. dependencies = "None" # The modules dependencies, if there are any. spice_metakernel_path = "path/to/the/METAKERNEL.TM" # The path to the SPICE metakernel file. object_id = "1000012" # The SPICE object ID of the target body. reference_frame_id = "J2000" # The SPICE reference frame (usually "J2000"). start_time_utc = "2025-04-28T00:00:00" ``` `SolarVectorVariableSpice.ini`: ``` submodules = "None" # The submodules to be loaded beneath this module, if there are any. dependencies = "None" # The modules dependencies, if there are any. spice_metakernel_path = "path/to/the/METAKERNEL.TM" # The path to the SPICE metakernel file. object_id = "1000012" # The SPICE object ID of the target body. reference_frame_id = "J2000" # The SPICE reference frame (usually "J2000"). start_time_utc = "2025-04-28T00:00:00" # The starting time for the simulation of the target body in UTC format (YYYY-MM-DDThh:mm:ss). rotating_frame_id = "67P/C-G_FIXED" # The SPICE frame ID of the body-fixed frame of the target body. ```