ALE SPICE Data Setup & Driver Types¶
To use ALE, you will need:¶
- An ALE Installation.
- An image (Locating Image Data) formatted according to your driver type.
- SPICE Data according to your driver type.
ALE Driver Types and their requirements¶
For NaifSpice + IsisLabel Drivers, you will need:
-
An image imported into ISIS cube (.cub) format with a
-2isisapp. -
NAIF SPICE Kernels (See Setting up NAIF Data below).
For IsisLabel + IsisSpice Drivers, you will need:
-
An image imported into ISIS cube (.cub) format with a
-2isisapp, -
AND the resulting ISIS cube must be
spiceinited withspiceinit from=<your.cub>.
For NaifSpice + Pds3Label Drivers, you will need:
-
An image in PDS3 format
-
NAIF SPICE Kernels (See Setting up NAIF Data below).
How Each Driver Mixin Works - NaifSpice, IsisSpice, IsisLabel, and Pds3Label
NaifSpice drivers use the NAIF Kernels to look up spice data to an image, while IsisSpice drivers depend on an ISIS cube already having spice data attached with spiceinit.
IsisLabel drivers use images in the ISIS cube (.cub) format, while Pds3Label drivers use images in the PDS format.
There are 3 possible combinations of these mixins: IsisLabel + NaifSpice, IsisLabel + IsisSpice, and Pds3Label + NaifSpice.
NaifSpice + IsisLabel is the most commonly used driver type, but you can check the ALE driver to find out if IsisLabel + IsisSpice or Pds3Label + NaifSpice drivers are available instead or in addition:
- Look at the drivers in the ALE repository.
- Click on the drivers for the spacecraft that captured your image.
- Find the class for your sensor, and look for NaifSpice, IsisSpice, IsisLabel, or Pds3Label next to the class name.
There may be a class for both NaifSpice and IsisSpice; in that case you can use either, or use the -n or -i argument to specify which one to use. You might use -i for IsisSpice if you want to avoid re-spiceiniting a .cub.
By default, ALE will run through different drivers until either it finds the first one that works (at which point it will use that driver and complete its run), or all drivers fail.
Setting Up NAIF Data¶
For use of NAIF Data with ISIS, see the ISIS Data Area. For use of NAIF data with ALE, continue below.
Downloading NAIF SPICE Data with wget¶
[NAIF SPICE Data Home] [Getting Spice Kernels from the NAIF Server]
If you have enough space, NAIF recommends downloading the entire dataset for your spacecraft, detailed below.
Otherwise, you can try subsetting the data as detailed in the NAIF Server tutorial.
You will need wget, a common download utility.
Let's download the Clementine archive as a test.
-
Find your mission on the PDS SPICE Archives and copy the Archive Link.
- The url for the Clementine archive is:
https://naif.jpl.nasa.gov/pub/naif/pds/data/clem1-l-spice-6-v1.0/clsp_1000
- The url for the Clementine archive is:
-
cdinto you spice folder, the folder you have or will set as$ALESPICEROOT. -
Piece together the
wgetcommand.-
Starting with this base command... (Don't run it yet!)
wget -m -nH --cut-dirs=5 -R 'index.html*' -
add the url...
-nv https://naif.jpl.nasa.gov/pub/naif/pds/data/clem1-l-spice-6-v1.0/ -
then filter by the directory path (last half of url)...
-I pub/naif/pds/data/clem1-l-spice-6-v1.0/ -
and download into this folder (just the folder at the end of the url).
-P clem1-l-spice-6-v1.0/
-
-
Run the complete wget command:
The Mars Reconnaissance Orbiter (MRO) archive, which corresponds to the B10_013341_1010_XN_79S172W used in the related tutorials, is 340 GB. A subset of SPICE data is provided in the tutorials, but if you will be working with more MRO images, and you have the space, you can try downloading the MRO Spice data.
Setting $ALESPICEROOT¶
When you are using a NaifSpice Driver, ALE looks under the $ALESPICEROOT directory for SPICE Kernels.
You can echo it to see if it is set.
To work with MRO images for example, you might download the MRO NAIF SPICE Kernels to a data drive.
If your directory structure looks like /Volumes/data/spice-data/mro-m-spice-6-v1.0/mrosp_1000,
then you should set $ALESPICEROOT like:
Setting the Path Value in a metakernel¶
When using a NaifSpice Driver, $ALESPICEROOT must point to the relevant NAIF SPICE Data, and the metakernel within that data must be set.
If the path value in your metakernel has not been set, you may get an error like this:
Look up further in the verbose data, and if an unset metakernel is causing the problem, you will find something like:
Trying <class 'ale.drivers.mro_drivers.MroCtxIsisLabelNaifSpiceDriver'>
Failed:
================================================================================
Toolkit version: CSPICE_N0067
SPICE(NOSUCHFILE) --
The first file './data/lsk/naif0012.tls' specified by KERNELS_TO_LOAD in the file /Volumes/data/spice-data/mro-m-spice-6-v1.0/mrosp_1000/extras/mk/mro_2009_v14.tm could not be located.
Open that .tm file (mro_2009_v14.tm), and change the PATH_VALUES line to point to your data; the folder containing folders for lsk, pck, sclk, fk, ik, spk, ck, etc...
if your $ALESPICEROOT is /Volumes/data/spice-data, and you are working with an MRO image, you might change it to:
Now save the metakernel try again, and, if your SPICE Data is correctly configured, you should not see the same error: