Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkits November 2014.

Slides:



Advertisements
Similar presentations
Module 4.2 File management 1. Contents Introduction The file manager Files – the basic unit of storage The need to organise Glossary 2.
Advertisements

Navigation and Ancillary Information Facility NIF Writing an Icy Based Program June 2004.
Installing geant4 v9.5 using Windows Daniel Brandt, 06 April 2012 Installing Geant4 v9.5 for Windows A step-by-step guide for Windows XP/Vista/7 using.
Navigation and Ancillary Information Facility NIF Matlab Interface to CSPICE “Mice” How to Access the CSPICE library Using Matlab © November 2014 © The.
Navigation and Ancillary Information Facility NIF Porting Kernels January 2009.
Navigation and Ancillary Information Facility NIF Time Conversion and Time Formats January 2009.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit October 2014.
Welcome to CSE  Name: Di Cao   Classroom: DL357  Class Time: T 8:30am - 9:18am  Office.
Unix Primer. Unix Shell The shell is a command programming language that provides an interface to the UNIX operating system. The shell is a “regular”
Liang, Introduction to Java Programming, Sixth Edition, (c) 2007 Pearson Education, Inc. All rights reserved Programming Languages Machine.
Navigation and Ancillary Information Facility NIF Obtaining SPICE Components Offered by NAIF Emphasis on Kernels March 2010.
Navigation and Ancillary Information Facility NIF MATLAB Interface to CSPICE “Mice” How to Access the CSPICE library Using MATLAB © October 2007 © The.
Navigation and Ancillary Information Facility NIF “Comments” In SPICE Kernels Also known as “meta-data” November 2014.
Navigation and Ancillary Information Facility NIF SPICE Conventions A summary of standards, lingo and common usage within SPICE November 2014.
®® Microsoft Windows 7 for Power Users Tutorial 13 Using the Command-Line Environment.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit January 2009.
Navigation and Ancillary Information Facility NIF Preview of a Web-based GUI Interface to SPICE “WebGeocalc” The NAIF and UCD Teams August 22, 2011 SPICE.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit March 2010.
March 2, 2005Wah-kai Ngai1 Installation of Geant4 1st HK Simulation Meeting.
Navigation and Ancillary Information Facility NIF SPICE Conventions A summary of standards, lingo and common usage within SPICE November 2014.
Navigation and Ancillary Information Facility NIF Summary of Key Points January 2009.
Navigation and Ancillary Information Facility NIF Summary of Key Points October 2014.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit January 2008.
Navigation and Ancillary Information Facility NIF Writing a CSPICE (C) Based Program November 2014.
Navigation and Ancillary Information Facility NIF Toolkit Applications March 2006.
Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library Using Interactive Data Language (IDL)
Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library Using Interactive Data Language (IDL)
Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library Using Interactive Data Language (IDL)
Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library from the Interactive Data Language (IDL)
Navigation and Ancillary Information Facility NIF Exception Handling October 2014.
1 Programming Environment and Tools VS.Net 2012 First project MSDN Library.
Navigation and Ancillary Information Facility NIF Introduction to WebGeocalc October 2014 SPICE components and services are not restricted under ITAR and.
Navigation and Ancillary Information Facility NIF Porting Kernels November 2005.
Navigation and Ancillary Information Facility NIF Writing a CSPICE Based Program October 2007.
Navigation and Ancillary Information Facility NIF Getting Started Using SPICE April 2006.
Navigation and Ancillary Information Facility NIF Writing an Icy (IDL) Based Program January 2009.
Navigation and Ancillary Information Facility NIF Introduction to the Family of SPICE Toolkits October 2014.
Navigation and Ancillary Information Facility NIF SPICE Toolkit Common Problems November 2014.
Windows Installation Tutorial NASA ARSET For Python help, contact: Justin Roberts-Pierel
Navigation and Ancillary Information Facility NIF Using Module Headers April 2006.
Navigation and Ancillary Information Facility NIF Finding SPICE Components An Introduction to the NAIF Server January 2009.
1 Getting Started with C++ Part 1 Windows. 2 Objective You will be able to create, compile, and run a very simple C++ program on Windows, using Microsoft.
Navigation and Ancillary Information Facility NIF Porting SPICE Kernels Between Computers June 2004.
Navigation and Ancillary Information Facility NIF Writing a SPICE (FORTRAN) Based Program November 2014.
Navigation and Ancillary Information Facility NIF Porting Kernels March 2010.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit November 2014.
Navigation and Ancillary Information Facility NIF Welcome to the SPICE Tutorials March 2010.
Navigation and Ancillary Information Facility NIF Welcome to the SPICE Training Class October 2007.
Navigation and Ancillary Information Facility NIF Welcome to the SPICE Tutorials November 2014.
Navigation and Ancillary Information Facility NIF “Metadata” In SPICE Kernels a.k.a. “comments” March 2006.
Navigation and Ancillary Information Facility NIF SPICE Conventions A summary of many “standards,” lingo and common usage within SPICE June 2004.
Navigation and Ancillary Information Facility NIF “Metadata” In SPICE Kernels Also known as “comments” January 2009.
Navigation and Ancillary Information Facility NIF Frames Kernel FK March 2010.
Navigation and Ancillary Information Facility NIF Writing an Mice (MATLAB) Based Program October 2007.
 CSC 215 : Procedural Programming with C C Compilers.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit January 2008.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit April 2006.
Navigation and Ancillary Information Facility NIF “Metadata” In SPICE Kernels Also known as “comments” October 2007.
Introduction to the Family of SPICE Toolkits
Cygwin: getting the setup tool
CSC 215 : Procedural Programming with C
Writing an Icy (IDL) Based Program
Preparing for Programming Using the SPICE Toolkits
Summary of Key Points October 2007.
INTRODUCING Adams/CHASSIS
IDL Interface to CSPICE “Icy”
Compilers, Make and SubVersion
Cube Generator Todd Bradley January 8, 2014.
Windows Installation Tutorial
Review of Previous Lesson
Presentation transcript:

Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkits November 2014

Navigation and Ancillary Information Facility NIF Preparing for Programming 2 Setting Path to Toolkit Executables Unix –csh, tcsh: Use the set command to add the location of toolkit executables to your path. »set path = ($path /my_directory/toolkit/exe) »set path = ($path /my_directory/cspice/exe) »set path = ($path /my_directory/icy/exe) »set path = ($path /my_directory/mice/exe) –bash »PATH=$PATH:/my_directory/toolkit/exe »PATH=$PATH:/my_directory/cspice/exe »PATH=$PATH:/my_directory/icy/exe »PATH=$PATH:/my_directory/mice/exe Windows –Add location of toolkit executables to the environment variable PATH from the Advanced pane on the System Control Panel (Control Panel->System->Advanced). »drive:\my_directory\toolkit\exe »drive:\my_directory\cspice\exe »drive:\my_directory\icy\exe »drive:\my_directory\mice\exe Replace the italics with the path in which you installed the toolkit on your computer. Recommended for all languages

Navigation and Ancillary Information Facility NIF Preparing for Programming 3 Assume your Toolkit distribution is installed at: /naif/cspice/ for CSPICE (C toolkits) /naif/toolkit/ for SPICE (Fortran toolkits) Compile and link an application–let’s pretend it’s named program–against the CSPICE or SPICELIB library. »For C: »For FORTRAN: The default SPICE library names do not conform to the UNIX convention libname.a. So you cannot use the conventional library path/name options –L and –l, e.g. gcc … -L/path_to_libs/ -lname unless you rename the SPICE library. Unix/Linux: Builds $ gcc program.c -I/naif/cspice/include /naif/cspice/lib/cspice.a -lm $ gfortran program.f /naif/toolkit/spicelib.a

Navigation and Ancillary Information Facility NIF Preparing for Programming 4 The standard installation of Microsoft Visual Studio may not update environment variables needed to use the C compiler (cl) from the standard DOS shell. This depends on your version of the Microsoft development environment. –If programming in an XP 32-bit environment, you can set the environment variables by executing from a DOS shell one of the “vars32” batch scripts supplied with Microsoft compilers: »vars32.bat »vcvars32.bat »vsvars32.bat –If available on your system, you can execute the “Visual Studio version Command Prompt” utility from the Programs -> Microsoft Visual Studio version -> Visual Studio Tools menu. The utility spawns a DOS shell set with the appropriate environment variables. Caution: there may be 32-bit and 64-bit versions. Windows: Compiler settings

Navigation and Ancillary Information Facility NIF Preparing for Programming 5 Assume the SPICE distribution is installed at: C:\naif\cspice\ for C toolkits C:\naif\toolkit\ for Fortran toolkits Compile and link an application, say program, against the CSPICE or SPICELIB library. »For C toolkits: »For FORTRAN toolkits: Windows: Builds for C and Fortran > cl program.c -IC:\naif\cspice\include C:\naif\cspice\lib\cspice.lib > df program.f C:\naif\toolkit\lib\SPICELIB.LIB

Navigation and Ancillary Information Facility NIF Preparing for Programming 6 Unix and Windows –Use the IDL register command: e.g. –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. »Unix, X86 architecture »Windows, X86 architecture Required for “Icy” IDL> dlm_register, ‘_path_to_directory_containing_icy.dlm_’ IDL > dlm_register, ‘/naif/icy/lib/icy.dlm’ cp icy.dlm icy.so /Applications/exelis/idl/bin/bin.darwin.x86_64/ cp icy.dlm icy.dll C:\Program Files\Exelis\idl83\bin\bin.x86_64\ continued on next page Icy: Register the Icy DLM to IDL (1)

Navigation and Ancillary Information Facility NIF Preparing for Programming 7 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.: Caveat: with regards to the Icy source directory, icy/src/icy, do not invoke IDL from the directory, do not register the directory, and do not append to IDL_DLM_PATH the directory. This directory contains an “icy.dlm” but not “icy.so.” setenv IDL_DLM_PATH " :_path_to_directory_containing_icy.dlm_" continued on next page Icy: Register the Icy DLM to IDL (2)

Navigation and Ancillary Information Facility NIF Preparing for Programming 8 Windows specific: –Set environment variable IDL_DLM_PATH from the Advanced pane of the System Control Panel. Once registered (by whatever means) 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: Icy: Register the Icy DLM to IDL (3) IDL> help, ‘icy’, /DL **ICY - IDL/CSPICE interface from JPL/NAIF (not loaded) IDL> help, ‘icy’, /DL **ICY - IDL/CSPICE interface from JPL/NAIF (not loaded) IDL> print, cspice_icy(‘version’) % Loaded DLM: ICY. Icy DEC-2008 (EDW) IDL> print, cspice_icy(‘version’) % Loaded DLM: ICY. Icy DEC-2008 (EDW)

Navigation and Ancillary Information Facility NIF Preparing for Programming 9 Use the IDL IDE’s preferences panel to set the current working directory to the location where you will be developing your lessons’ code. Optional: Place your dlm_register command in a start up script. Specify the script using the IDL IDE’s preferences panel. Icy: Using the IDL IDE Recommended for “Icy”

Navigation and Ancillary Information Facility NIF Preparing for Programming 10 Assume the Mice distribution is installed at C:\naif\mice\ on Windows, or /naif/mice/ on Unix/Linux. Use of Mice from Matlab requires the Mice source and library directories exist in the Matlab search path. The easiest way to update the Matlab path is with the “addpath” command. –On Windows: –On Unix/Linux: Mice Required for “Mice” >> addpath('C:\naif\mice\lib') >> addpath('C:\naif\mice\src\mice') >> addpath('C:\naif\mice\lib') >> addpath('C:\naif\mice\src\mice') >> addpath('/naif/mice/lib') >> addpath('/naif/mice/src/mice') >> addpath('/naif/mice/lib') >> addpath('/naif/mice/src/mice')

Navigation and Ancillary Information Facility NIF Backup Icy programming example Mice programming example References Preparing for Programming 11

Navigation and Ancillary Information Facility NIF 12 Simple Icy Example As an example of Icy use with vectorization, calculate and plot the trajectory in the J2000 inertial frame of the Cassini spacecraft from June 20, 2004 to December 1, ;; Construct a meta kernel, "standard.tm”, which will be used to load the needed ;; generic kernels: "naif0009.tls," "de421.bsp,” and "pck0009.tpc.” ;; 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 = utc = [ 'Jun 20, 2004', 'Dec 1, 2005' ] cspice_str2et, utc, et times = dindgen(STEP)*(et[1]-et[0])/STEP + et[0] cspice_spkpos, 'Cassini', times, 'J2000', 'NONE', 'SATURN BARYCENTER', pos, ltime ;; Plot the resulting trajectory. x = pos[0,*] y = pos[1,*] z = pos[2,*] iplot, x, y, z cspice_kclear Preparing for Programming

Navigation and Ancillary Information Facility NIF 13 Graphic Output x y z Preparing for Programming Trajectory of the Cassini vehicle in the J2000 frame, for June 20, 2004 to Dec 1, 2005

Navigation and Ancillary Information Facility NIF 14 Simple Mice Example As an example of Mice use with vectorization, calculate and plot the trajectory in the J2000 inertial frame of the Cassini spacecraft from June 20, 2004 to December 1, 2005 Preparing for Programming % Construct a meta kernel, "standard.tm”, which will be used to load the needed % generic kernels: "naif0009.tls," "de421.bsp,” and "pck0009.tpc.” % Load the generic kernels using the meta kernel, and a Cassini spk. cspice_furnsh( { 'standard.tm', '/kernels/cassini/spk/030201AP_SK_SM546_T45.bsp'} ) % 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); [pos, ltime]= cspice_spkpos( 'Cassini', times, 'J2000', 'NONE', 'SATURN BARYCENTER' ); % Plot the resulting trajectory. x = pos(1,:); y = pos(2,:); z = pos(3,:); plot3(x,y,z) cspice_kclear

Navigation and Ancillary Information Facility NIF 15 Trajectory of the Cassini vehicle in the J2000 frame, for June 20, 2004 to Dec 1, 2005 Preparing for Programming Graphic Output

Navigation and Ancillary Information Facility NIF References “icy.req,” Icy Required Reading “mice.req,” Mice Required Reading “Introduction to the Family of SPICE Toolkits,” tutorial Preparing for Programming 16