SPICE Setup
SPICE is an information system with the purpose of providing the observation geometry needed to plan scientific observations and to analyze the data returned from those observations. SPICE is comprised of a suite of data files, often called kernels, and software -mostly subroutines. A customer incorporates a few of the subroutines into his/her own program that is built to read SPICE data and compute the needed geometric parameters for whatever task is at hand.
Installation
We recommend to use SpiceyPy
, the Python wrapper of SPICE. You can install it as any other Python library.
Install SpiceyPy
with pip install spiceypy
.
This will install CSPICE
with the wrapper. Alternative methods available from the SpiceyPy GitHub repository.
If you wish to install SPICE for other languages follow the instructions under the NAIF Toolkit page.
Warning
If you have the SPICE Toolkit already installed, make sure is version N67 or a latest one.
SPICE Kernels Setup
The SPICE Kernels can be setup in a plethora of ways. Here we provide the one that is recommended by the JUICE SOC and by the ESA SPICE Service.
Install Git: You can see the instruction on the following page.
Clone the SPICE Kernels: Clone the JUICE SPICE kernel data set from BitBucket. Clone it from the terminal with:
git clone --depth 1 https://s2e2.cosmos.esa.int/bitbucket/scm/spice_kernels/juice.gitPlease be aware that due to the large history of the repository and the large size of some binary kernels, timeout errors may occur if the
--depth
option is not used for performing a shallow clone.ALTERNATIVELY download the kernels from the ESA SPICE FTP, you should do so by downloading the kernels listed in any Meta-kernel. Good luck with that.
Update the meta-kernel for local usage: In order to use the kernels with the Meta-kernels in SPICE outside of the Meta-kernel directory of the Git repository the user needs to modify the following the PATH_VALUE variable of the meta-kernel from:
PATH_VALUES = ( '..' )to:
PATH_VALUES = ( '<Absolute Path to 'kernels' directory>' )The meta-kernel can be found in the directory
juice/kernels/mk/
It is recommended for users to make a local copy of the meta-kernel and modify the value of the
PATH_VALUES
keyword to point to the actual location of the JUICE SPICE data set’sdata
directory on their system. Replacing/
with\
and converting line terminators to the format native to the user’s system may also be required if this meta-kernel is to be used on a non-UNIX workstation.Test the kernels: Download the BRIEF utility from NAIF utilites page Put it under your system PATH or directly in the directory
juice/kernels/mk/
. Run it from the command line with./brief <name of the metakernel>
, you should see something like:brief juice_crema_5_0_local.tm BRIEF -- Version 4.1.0, September 17, 2021 -- Toolkit Version N0067 Summary for: /Users/marc.costa/spice/juice/kernels/spk/juice_sci_v02.bsp Bodies: JUICE_JUP_HALO_RING (-28941)* JUICE_JUP_MAIN_RING (-28942)* JUICE_JUP_AMA_GOS_RING (-28943)* JUICE_JUP_THE_GOS_RING (-28944)* JUICE_JUP_THE_RING_EXR (-28945)* JUICE_IO_PLASMA_TORUS (-28968)* JUICE_EUROPA_PLASMA_TORUS (-28988)* Start of Interval (ET) End of Interval (ET) ----------------------------- ----------------------------- 1950 JAN 01 00:00:00.000 2050 JAN 01 00:00:00.000 (...)
Note
A very practical alternative to the SPICE Kernel setup is to use the planetary-coverage
Python package to obtain
and manage the SPICE Kernels. Full instructions available in its Documentation.
Install SKD Git Hooks (optional)
skd_post_merge is a set of Git Hooks with the responsibility of creating or updating the local Meta-Kernels of a given SPICE Kernel Dataset (SKD) everytime that the local repository of the SKD is updated. This update usually is raisen by a “git pull”, “git merge” or a “git checkout”.
Install Git Hooks: You can see the instructions here. Install in the terminal from the SPICE juice kernels directory with:
misc/git_hooks/skd_post_merge/install_hook_linux_or_mac.shUpdate the meta-kernel: In order to update the local Meta-kernels every time that the local repository of the SKD is updated, one needs to execute the following command in a terminal, from the SPICE juice kernels folder:
misc/git_hooks/skd_post_merge/update_local_mks.sh