Ruby SPICE Wrapper

SPICE Wrapper API documentation

The Ruby SPICE wrapper was written by the LROC SOC to allow for precise computation of various orbital and spacecraft geometry in the Ruby language. The wrapper passes calls in Ruby through to a subset of the functions available in NAIF's CSPICE toolkit. In the context of Lunaserv, the Ruby SPICE wrapper is used to get the sub-solar point on various bodies at requested times.

If you're using the night or illumination layer types in Lunaserv, you will need to download and install the Ruby SPICE wrapper and appropriate spice data for the body of interest. Both of these items can be downloaded from the downloads page. Additional SPICE kernels are available directly from NAIF. The SPICE kernels we have made available there include data for all planets in the solar system and also data for the Jupiter and Saturn systems.

The current version of the naif-spice gem includes the necessary spice files for compilation on OS X, both 32 & 64 bit Linux, and Linux on the Raspberry Pi. If you are using one of those platforms, try installing the gem like you normally would. If you're using a different platform or if you get errors compiling against the spice library, then follow these instructions to compile against a downloaded version of the CSPICE toolkit. First download the appropriate CSPICE toolkit from NAIF. Then unpack the toolkit. Go into the lib directory and copy cspice.a to libcspice.a so gcc can find it. Then run the following command:

gem install --local /path/to/naif-spice.gem -- --with-cspice-dir=/path/to/cspice

Update the paths as necessary to point to the proper locations.