11 Preparing For Programming
11 Preparing For Programming
January 2020
N IF Setting Path to Toolkit Executables (1)
Navigation and Ancillary Information Facility
Replace my_directory with the path in which you installed the toolkit on your computer.
Replace drive:\my_directory with the path in which you installed the toolkit on your
computer.
Preparing for Programming 3
N IF Unix: Build a SPICE Executable
Navigation and Ancillary Information Facility
– Recent versions of Visual Studio include scripts to spawn a DOS shell with
the needed environment. The scripts exist under Visual Studio “version”
found in the Programs menu:
The scripts’ names for a 64bit (x64) environment or a 32bit (x86) are:
» VSversion x64 Native Tools Command Prompt
• Example, VS2015 x64 Native Tools Command Prompt
» VSversion x86 Native Tools Command Prompt
• Example, VS2015 x86 Native Tools Command Prompt
Programs -> Intel Software Development Tools -> Intel Visual Fortran
Compiler (version)
e.g.
IDL > dlm_register, ‘/naif/icy/lib/icy.dlm’
– Or, copy icy.dlm and icy.so (or icy.dll) to IDL's binary directory located at
{The IDL install directory}/bin/bin.user_architecture, e.g.
» For Unix, X86 architecture
• Unix specific:
– Start the IDL application from a shell in the directory containing both
icy.dlm and icy.so.
– Append the path to your icy.dlm to the IDL_DLM_PATH environment
variable to include the directory containing icy.dlm and icy.so, e.g.:
Warning: do not invoke IDL from the Icy source directory, icy/src/icy, nor
register that directory, and do not append that directory to
IDL_DLM_PATH. This directory contains an “icy.dlm” but not “icy.so.”
• Windows specific:
– Set environment variable IDL_DLM_PATH from the Advanced pane
of the System Control Panel.
• Once registered as specified on earlier pages, confirm IDL
recognizes and can access Icy.
– Using the help command:
» Appearance of the words “not loaded” might suggest something is wrong, but
this is expected state until you execute an Icy command.
– Execute a trivial Icy command:
IDL> print, cspice_icy(‘version’)
% Loaded DLM: ICY.
Icy 1.4.20 25-DEC-2008 (EDW)
• Use the IDL IDE’s preferences panel to set the current working
directory to the location where you will be developing your
code.
• Optional: Place your dlm_register command in a start up
script. Specify the script using the IDL IDE’s preferences panel.
– On Unix/Linux:
>> addpath('/naif/mice/lib')
>> addpath('/naif/mice/src/mice')
Backup
;; Load the generic kernels using the meta kernel, and a Cassini spk.
cspice_furnsh, 'standard.tm'
cspice_furnsh, '/kernels/cassini/spk/030201AP_SK_SM546_T45.bsp'
;; Define the number of divisions of the time interval and the time interval.
STEP = 10000
utc = [ 'Jun 20, 2004', 'Dec 1, 2005' ]
cspice_str2et, utc, et
times = dindgen(STEP)*(et[1]-et[0])/STEP + et[0]
cspice_kclear
Trajectory of the Cassini vehicle in the J2000 frame, for June 20, 2004 to Dec 1, 2005
% Load the generic kernels using the meta kernel, and a Cassini spk.
% Define the number of divisions of the time interval and the time interval.
STEP = 1000;
et = cspice_str2et( {'Jun 20, 2004', 'Dec 1, 2005'} );
times = (0:STEP-1) * ( et(2) - et(1) )/STEP + et(1);
plot3(x,y,z)
cspice_kclear
Trajectory of the Cassini vehicle in the J2000 frame, for June 20, 2004 to Dec 1, 2005