Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library Using Interactive Data Language (IDL)

Slides:



Advertisements
Similar presentations
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
Advertisements

The Functions and Purposes of Translators Code Generation (Intermediate Code, Optimisation, Final Code), Linkers & Loaders.
Navigation and Ancillary Information Facility NIF SPICE Conventions A summary of many “standards,” lingo and common usage within SPICE April 2006.
Navigation and Ancillary Information Facility NIF Writing an Icy Based Program June 2004.
Navigation and Ancillary Information Facility NIF Writing an Mice (MATLAB) Based Program November 2014.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Navigation and Ancillary Information Facility NIF Matlab Interface to CSPICE “Mice” How to Access the CSPICE library Using Matlab © November 2014 © The.
Introduction to Array The fundamental unit of data in any MATLAB program is the array. 1. An array is a collection of data values organized into rows and.
Examining the Code [Reading assignment: Chapter 6, pp ]
Baburao Kamble (Ph.D) University of Nebraska-Lincoln Data Analysis Using R Week2: Data Structure, Types and Manipulation in R.
Navigation and Ancillary Information Facility NIF Time Conversion and Time Formats January 2009.
Navigation and Ancillary Information Facility NIF Time Conversion and Time Formats November 2014.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit October 2014.
M. Taimoor Khan * Java Server Pages (JSP) is a server-side programming technology that enables the creation of dynamic,
Navigation and Ancillary Information Facility NIF Leapseconds and Spacecraft Clock Kernels LSK and SCLK November 2014.
Geog Basic Skills in Scientific Programming Syllabus, Introduction, Fundamentals of IDL Syntax.
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 SPICE Conventions A summary of standards, lingo and common usage within SPICE November 2014.
Copyright © 2012 Pearson Education, Inc. Publishing as Pearson Addison-Wesley C H A P T E R 2 Input, Processing, and Output.
Navigation and Ancillary Information Facility NIF JNISPICE March 2006.
9 Chapter Nine Compiled Web Server Programs. 9 Chapter Objectives Learn about Common Gateway Interface (CGI) Create CGI programs that generate dynamic.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit January 2009.
Computational Methods of Scientific Programming Lecturers Thomas A Herring, Room A, Chris Hill, Room ,
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit March 2010.
POS 406 Java Technology And Beginning Java Code
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkits November 2014.
Navigation and Ancillary Information Facility NIF Leapseconds and Spacecraft Clock Kernels LSK and SCLK April 2006.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkit January 2008.
Navigation and Ancillary Information Facility NIF Event Finding Subsystem Preview Capabilities, Current Status and Plans January 2009.
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)
Copyright © Mohamed Nuzrath Java Programming :: Syllabus & Chapters :: Prepared & Presented By :: Mohamed Nuzrath [ Major In Programming ] NCC Programme.
Navigation and Ancillary Information Facility NIF Exception Handling October 2014.
Navigation and Ancillary Information Facility NIF Porting Kernels November 2005.
Navigation and Ancillary Information Facility NIF Introduction to the SPICE Toolkit March 2006.
Navigation and Ancillary Information Facility NIF Writing an Icy (IDL) Based Program January 2009.
Navigation and Ancillary Information Facility NIF SPICE System Development Plans March 2006.
Navigation and Ancillary Information Facility NIF Introduction to the SPICE Toolkit April 2006.
Navigation and Ancillary Information Facility NIF Introduction to the SPICE Toolkit June 2004.
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.
Navigation and Ancillary Information Facility NIF Using Module Headers April 2006.
Navigation and Ancillary Information Facility NIF Frames Kernel FK March 2006.
Navigation and Ancillary Information Facility NIF SPICE Event Finding Subsystem October 2007.
Navigation and Ancillary Information Facility NIF Time Conversion and Time Formats March 2010.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 14 Web Database Programming Using PHP.
Navigation and Ancillary Information Facility NIF Time Conversion and Time Formats January 2008.
Navigation and Ancillary Information Facility NIF SPICE Toolkit Common Problems October 2007.
Navigation and Ancillary Information Facility NIF Getting and Installing the SPICE Toolkit 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 Frames Kernel FK March 2010.
Navigation and Ancillary Information Facility NIF Writing an Mice (MATLAB) Based Program October 2007.
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.
Web Database Programming Using PHP
Fundamentals of Programming I Overview of Programming
Writing an Icy (IDL) Based Program
Preparing for Programming Using the SPICE Toolkits
APPENDIX a WRITING SUBROUTINES IN C
Introduction to Classes and Objects
Objectives You should be able to describe: Interactive Keyboard Input
Web Database Programming Using PHP
IDL Interface to CSPICE “Icy”
MatLab Programming By Kishan Kathiriya.
Frames Kernel FK October 2007.
PHP.
Presentation transcript:

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE “Icy” How to Access the CSPICE library Using Interactive Data Language (IDL) © March 2006 © Research Systems Inc.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 2 Topics How does it work? Benefits from Icy use Distribution Icy Operation Vectorization Simple Use of Icy Functionality

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 3 IDL includes an intrinsic capability to use external routines. –Icy functions as an IDL Dynamically Loadable Module. A DLM consists of a shared object library (icy.so/.dll) and a DLM text definition file (icy.dlm). » The shared library contains a set of IDL callable C interface routines that wrap a subset of CSPICE wrapper calls. »The text definition file lists the routines within the shared library and the format for the routine’s call parameters. How Does It Work? (1)

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 4 When a user invokes a call to a DLM routine: 1. IDL calls… 2. the interface routine in the shared object library, linked against… 3. CSPICE, which performs its function and returns the result… 4. to IDL… … transparent from the user’s perspective. How Does It Work? (2)

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 5 Benefits from using Icy –Ease of use: Icy operates as an extension to the IDL language regime. –Platform independence: the Icy code base requires no modification for ports across supported platforms. * Icy now runs on: »OS X (cc/gcc) »Solaris in 32 bit mode for cc and gcc compilers ** »Linux (gcc) »MS Windows »and should run on any platform supporting IDL, CSPICE, and an ANSI C compiler Benefits * CSPICE is widely portable, but not platform independent. ** NAIF successfully built an 64 bit Icy using the Solaris cc compiler.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 6 Icy Distribution NAIF distributes the Icy package as an independent product analogous to SPICELIB and CSPICE. The package includes: –The CSPICE source files. –The Icy interface source code. –Platform specific build scripts for Icy and CSPICE. – IDL versions of the SPICE cookbook programs, states, tictoc, subpt, and simple. –An HTML based help system for both Icy and CSPICE, with the Icy help cross-linked to CSPICE. –The Icy shared library and DLM file. The system is ready for use after installation of the these files. »The user can recompile the shared library if the appropriate compiler is available.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 7 Icy Operation (1) Icy supports many (335), but not all, CSPICE wrapper functions. –Icy has some functionality not available in CSPICE. »As of Icy 1.1, a subset of calls accept vectorized arguments. * (See Vectorization, pg. 11 ). Icy arguments normally match the arguments in the corresponding CSPICE call in type and name, with some exceptions. –Routines returning vectors do not explicitly return a vector dimension. CSPICE error messages are returned to Icy in the form usable by the IDL error catch handler. *Vectorized indicates passing a vector of N items as an argument: a vector of scalars, a vector of vectors, or a vector of matrices, the return value being an N dimensioned version of the non-vectorized output.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 8 Icy Operation (2) A user may occasionally encounter an IDL math exception: % Program caused arithmetic error: Floating underflow –This warning occurs most often as a consequence of CSPICE math operations. In all known cases, the SIGFPE exceptions caused by CSPICE can be ignored. CSPICE assumes numeric underflow as zero. –A user can adjust IDL’s response to math exceptions by setting to the !EXCEPT variable: »!EXCEPT = 0 suppresses the SIGFPE messages. »!EXCEPT = 1 the default, reports math exceptions on return to the interactive prompt. »!EXCEPT = 2 reports exceptions immediately after executing the command.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 9 Icy Operation (3) An operational irritant exists when using the cspice_furnsh call. –The IDL program interprets.pro files, so use of Icy’s cspice_furnsh module loads kernels to IDL, not the calling script. Therefore, kernels and pool variables persist in memory while IDL runs. –Possible solutions: »execute a single cspice_furnsh call to load all needed kernels at the start of an IDL run » balance every cspice_furnsh call with a cspice_unload Please refer to the Icy system required reading, icy.req, for further information.

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE Icy interfaces now accept and return vectorized arguments. Use of such arguments can eliminate the need for explicit loops (slow). Calls vectorized as of Icy 1.2: Icy Vectorization (1) cspice_reccyl cspice_recgeo cspice_reclat cspice_removd cspice_removi cspice_recpgr cspice_recrad cspice_recsph cspice_scdecd cspice_scencd cspice_sce2c cspice_scs2e cspice_sphrec cspice_cylrec cspice_deltet cspice_et2lst cspice_et2utc cspice_georec cspice_illum cspice_insrtd cspice_insrti cspice_latrec cspice_oscelt cspice_pxform cspice_pgrrec cspice_radrec cspice_spkezr cspice_spkpos cspice_srfrec cspice_srfxpt cspice_subpt cspice_str2et cspice_sxform cspice_timout

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 11 Example: use Icy to retrieve state vectors and light- time values for 1000 ephemeris times. –Create the array of 1000 ephemeris times in steps of 10 hours, keyed on July 1, 2005: cspice_str2et, 'July 1, 2005', start et = dindgen( 1000 )*36000.d + start –Retrieve the state vectors from Mars to earth at each et in the J2000 frame with LT+S aberration correction: cspice_spkezr, 'Earth', et, 'J2000', 'LT+S', 'MARS', state, ltime –Access the ith state 6-vector corresponding to the ith ephemeris time with the expression state_i = state[*,i] Icy Vectorization (2) continues on next page

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 12 –Convert the ephemeris time vector to UTC calendar strings with three decimal places accuracy. format = 'C' prec = 3 cspice_et2utc, et, format, prec, utcstr –The call returns utcstr, a vector of 1000 strings, each ith string the calendar date corresponding to et[i]. –Convert the position components of the N state vectors to latitudinal coordinates (the first three components of a state vector - IDL uses a zero based vector index). cspice_reclat, state[0:2,*], radius, latitude, longitude –The call returns three double precision 1000-vectors: radius, latitude, and longitude. Icy Vectorization (3)

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 13 Simple Use of Icy Functionality As an example of Icy use, calculate and plot the trajectory in the J2000 inertial frame of the Cassini spacecraft from June 20, 2004 to December 1, ;; Define the number of divisions of the time interval and the time interval. STEP = utc = [ 'Jun 20, 2004', 'Dec 1, 2005' ] ;; Load the needed kernels cspice_furnsh, 'standard.ker' cspice_furnsh, '/kernels/cassini/spk/T18-5TDJ5.bsp' ;; Create an array of ephemeris times, then retrieve position for each time value 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_unload, 'standard.ker' cspice_unload, '/kernels/cassini/spk/T18-5TDJ5.bsp'

Navigation and Ancillary Information Facility NIF IDL Interface to CSPICE 14 Graphic Output using IDL iTool Trajectory of the Cassini vehicle in the J2000, for June 20, 2005 to Dec 1, 2005 x y z