Navigation and Ancillary Information Facility NIF Using Module Headers April 2006.

Slides:



Advertisements
Similar presentations
Navigation and Ancillary Information Facility NIF Introduction to the SPICE Ephemeris Subsystem SPK Focused on reading SPK files November 2014.
Advertisements

Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Introduction to SPICE Jose Luis Vázquez European Space Astronomy Centre European Space Agency.
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 Shape Model Subsystem Preview (DSK) November 2014.
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 Time Conversion and Formats June 2004.
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.
Navigation and Ancillary Information Facility NIF Leapseconds and Spacecraft Clock Kernels LSK and SCLK November 2014.
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.
Navigation and Ancillary Information Facility NIF JNISPICE March 2006.
Navigation and Ancillary Information Facility NIF Introduction to Kernels November 2005.
Scientific Computing Division A tutorial Introduction to Fortran Siddhartha Ghosh Consulting Services Group.
Navigation and Ancillary Information Facility NIF Preparing for Programming Using the SPICE Toolkits November 2014.
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 Leapseconds and Spacecraft Clock Kernels LSK and SCLK April 2006.
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 “Camera-matrix” Kernel CK (Orientation or Attitude Kernel) Emphasis on reading CK files March 2006.
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 Planetary Constants Kernel PCK November 2014.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Navigation and Ancillary Information Facility NIF Leapseconds and Spacecraft Clock Kernels LSK and SCLK June 2004.
Navigation and Ancillary Information Facility NIF Introduction to Kernels January 2009.
Navigation and Ancillary Information Facility NIF Exception Handling November 2014.
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.
Navigation and Ancillary Information Facility NIF Using C-kernels to Capture Instrument Articulation June 28, 2002 Scott Turner
Navigation and Ancillary Information Facility NIF Dynamic Reference Frames November 2014.
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 Introduction to the SPICE Toolkit March 2006.
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 Instrument Kernel IK November 2014.
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 Planetary Constants Kernel PCK January 2009.
Navigation and Ancillary Information Facility NIF Planetary Constants Kernel PCK October 2014.
Navigation and Ancillary Information Facility NIF Introduction to Kernels March 2010.
Navigation and Ancillary Information Facility NIF SPICE Toolkit Common Problems November 2014.
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.
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 Instrument Kernel IK June 2004.
Navigation and Ancillary Information Facility NIF SPICE Conventions A summary of many “standards,” lingo and common usage within SPICE June 2004.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and.
Navigation and Ancillary Information Facility NIF “Metadata” In SPICE Kernels Also known as “comments” January 2009.
Coordinatate systems are used to assign numeric values to locations with respect to a particular frame of reference commonly referred to as the origin.
Navigation and Ancillary Information Facility NIF Finding SPICE Components An Introduction to the NAIF Server April 2006.
Navigation and Ancillary Information Facility NIF Frames Kernel FK March 2010.
Navigation and Ancillary Information Facility NIF “Metadata” In SPICE Kernels Also known as “comments” October 2007.
SECTION 2 SETUP, WRITING AND CREATING
Preparing for Programming Using the SPICE Toolkits
Shape Model Subsystem Preview (DSK)
Summary of Key Points October 2007.
IDL Interface to CSPICE “Icy”
Lecture: MATLAB Chapter 1 Introduction
Frames Kernel FK October 2007.
Presentation transcript:

Navigation and Ancillary Information Facility NIF Using Module Headers April 2006

Navigation and Ancillary Information Facility NIF 2 Using Module Headers Module Header Purpose Module“headers” are provided for all Toolkit modules, whether Fortran, C or IDL. This is the fundamental source for detailed user information and examples on how to use the module. –For some families of modules (e.g. SPK), additional information about the whole family is provided in a “required reading” document (e.g. …/doc/spk.req) Depending on the language, these “headers” may be found within the source code, or under the …/doc directory, or both. (See the next three pages.)

Navigation and Ancillary Information Facility NIF 3 Using Module Headers Fortran Module Header Locations For FORTRAN toolkits, the headers are provided within the source code modules. –YOURNAIFINSTALLATIONROOT/toolkit/src/spicelib/*.f or *.for In most cases there is a single “header” at the top of the source code. In a few cases, where a module has multiple entry points, there are additional “headers” at each entry point (e.g. “pool”).

Navigation and Ancillary Information Facility NIF 4 Using Module Headers C Module Header Locations For C toolkits the headers are provided in two formats, at two locations. –Plain text: »YOURNAIFINSTALLATIONROOT/cspice/src/cspice/*.c –HTML: »YOURNAIFINSTALLATIONROOT/cspice/doc/html/cspice/index.html

Navigation and Ancillary Information Facility NIF 5 Using Module Headers Icy Module Header Locations For IDL (“Icy”) toolkits, two kinds of headers are provided. –Icy wrappers in html format: »YOURNAIFINSTALLATIONROOT/cspice/doc/html/icy/index.html »This is a minimal set of information, and refers the user to the corresponding cspice header for details. –cspice headers, in text and html formats: »YOURNAIFINSTALLATIONROOT/cspice/src/cspice/*.c »YOURNAIFINSTALLATIONROOT/cspice/doc/html/cspice/index.html

Navigation and Ancillary Information Facility NIF 6 Using Module Headers CSPICE_SPKEZR Module Header I Let’s examine the information contained in an “Icy” module header using the SPKEZR module as example. Each module contains –Abstract –Inputs/Outputs (I/O) –Examples –Particulars –Required Reading –Version (History Information) Important: the information in an “Icy” wrapper is considered the bare minimum that might be needed by a user. More detail is provided in the corresponding cspice wrapper.

Navigation and Ancillary Information Facility NIF 7 Using Module Headers Abstract Information -Abstract CSPICE_SPKEZR returns the state (position and velocity) of a target body relative to an observing body, optionally corrected for light time (planetary aberration) and stellar aberration.

Navigation and Ancillary Information Facility NIF 8 Using Module Headers Input/Output Information - 1 -I/O Given: targ the scalar string name of a target body, optionally, you may supply the integer ID code for the object as an integer string, i.e. both "MOON" and "301" are legitimate strings that indicate the Moon is the target body, The target and observer define a state vector whose position component points from the observer to the target. et the scalar or N-vector of double precision ephemeris time, expressed as seconds past J2000 TDB, at which the state of the target body relative to the observer is to be computed, 'et' refers to time at the observer's location ref the scalar string name of the reference frame relative to which the output state vector should be expressed abcorr the scalar string name of the aberration corrections to be applied to the state of the target body to account for one-way light time and stellar aberration obs the scalar string name of a observing body, optionally, you may supply the integer ID code for the object as an integer string, i.e. both "MOON" and "301" are legitimate strings that indicate the moon is the observing body continues

Navigation and Ancillary Information Facility NIF 9 Using Module Headers Input/Output Information - 2 cspice_spkezr, targ, et, ref, abcorr, obs, starg, ltime returns: starg a double precision Cartesian 6-vector or 6xN array representing the position in kilometers and velocity in kilometers-per-second of the target body relative to the specified observer. The first three components of 6-vector 'starg‘ represent the x-, y- and z-components of the target's position; the last three components form the corresponding velocity vector. The 6xN form of 'starg' returns as starg[6,N]. Retrieve the ith state vector via: state_i = state[*,i] ltime the double precision, scalar or N-vector, one-way light time between the observer and target in seconds; if the target state is corrected for aberrations, then 'ltime' is the one-way light time between the observer and the light time corrected target location Please note, CSPICE documentation and source code uniformly uses the variable name 'lt' to designate the light-time between an observer and target. IDL uses "lt" as the less-than numeric comparison operator and so does not allow "lt" as a variable name. Therefore, Icy documentation uses the name 'ltime’ for the light-time value. 'starg' and 'ltime' return with the same order (N) as 'et'. continues

Navigation and Ancillary Information Facility NIF 10 Using Module Headers Input/Output Information - 3 The cspice_spkezr function performs the same operation as cspice_spkez with the exception that cspice_spkezr expects arguments 'targ' and 'obs' to pass as strings, whereas cspice_spkez expects the arguments as integers. cspice_spkezr also accepts the string form of the integer NAIF IDs as inputs to 'targ' and 'obs', e.g. targ = "Mars" obs = "Earth" or (remember, string representation of the integers) targ = "499" obs = "399"

Navigation and Ancillary Information Facility NIF 11 Using Module Headers Examples Examples Any numerical results shown for this example may differ between platforms as the results depend on the SPICE kernels used as input and the machine specific arithmetic implementation. ;; ;; Load a set of kernels: an SPK file, a PCK file and a leapseconds file. Use a meta ;; kernel for convenience. ;; cspice_furnsh, "standard.ker" ;; ;; Define parameters for a state lookup: ;; ;; Return the state vector of Mars (499) as seen from Earth (399) in the J2000 frame ;; using aberration correction LT+S (light time plus stellar aberration) at the epoch ;; July 4, :00 AM PST. ;; target = "Mars" epoch = 'July 4, :00 AM PST' frame = "J2000" abcorr = "LT+S" observer = "Earth" ;; ;; Convert the epoch to ephemeris time. ;; cspice_str2et, epoch, et continues

Navigation and Ancillary Information Facility NIF 12 Using Module Headers Examples - 2 ;; Look-up the state for the defined parameters. ;; cspice_spkezr, target, et, frame, abcorr, observer, state, ltime ;; ;; Output... print, 'The position of : ', target print, 'As observed from : ', observer print, 'In reference frame : ', frame print, 'At epoch : ', epoch ;; The first three entries of state contain the X, Y, Z position components. The final ;; three contain the Vx, Vy, Vz velocity components. ;; print, 'Scalar' print, 'R (kilometers) : ', state[0:2] print, 'V (kilometers/sec) : ', state[3:5] print, 'Light time (secs) : ', ltime print, ' between observer' print, ' and target' ;; ;; Create a vector of et's, starting at 'epoch‘ in steps of ephemeris seconds. ;; SIZE = 5 vec_et = dindgen( SIZE )* et ;; Look up the 'state' vectors and light time values 'lt' corresonding to the vector of ;; input ephemeris time 'vec_et'. cspice_spkezr, target, vec_et, frame, abcorr, observer, state, ltime print, 'Vector' cspice_et2utc, vec_et, 'C', 3, vec_epoch continues

Navigation and Ancillary Information Facility NIF 13 Using Module Headers Examples - 3 ;; ;; When called with a vector 'et', cspice_spkezr returns ;; 'state' as an 6xN matrix. Extract the ith state from the ;; matrix as: ;; ;; state_i = state[*,i] ;; for i=0, 4 do begin print, 'At epoch (UTC) : ', vec_epoch[i] print, 'R (kilometers) : ', (state[*,i])[0:2] print, 'V (kilometers/sec) : ', (state[*,i])[3:5] print, 'Light time (secs) : ', ltime[i] print, ' between observer' print, ' and target' print endfor ;; ;; It's always good form to unload kernels after use, ;; particularly in IDL due to data persistence. ;; cspice_unload, "standard.ker"

Navigation and Ancillary Information Facility NIF 14 Using Module Headers Examples: Printout IDL outputs: The position of : Mars As observed from : Earth In reference frame : J2000 At epoch : July 4, :00 AM PST Scalar R (kilometers) : V (kilometers/sec) : Light time (secs) : between observer and target Vector At epoch (UTC) : 2003 JUL 04 19:00: R (kilometers) : V (kilometers/sec) : Light time (secs) : between observer and target At epoch (UTC) : 2003 JUL 05 22:46: R (kilometers) : V (kilometers/sec) : Light time (secs) : between observer and target … (etc.)

Navigation and Ancillary Information Facility NIF 15 Using Module Headers Particulars -Particulars None. Note: this is an example of where important details are provided in the corresponding cspice module header (spkezr_c.c). There, the “Particulars” section is several pages long! It is not replicated here (in “Icy”) just to reduce maintenance problems.

Navigation and Ancillary Information Facility NIF 16 Using Module Headers Required Reading For important details concerning this module's function, please refer to the CSPICE routine spkezr_c. ICY.REQ SPK.REQ FRAMES.REQ A statement similar to this one appears in each “Icy” header.

Navigation and Ancillary Information Facility NIF 17 Using Module Headers Version -Icy Version 1.1.0, 01-AUG-2004, EDW (JPL) Added capability to process vector 'et' input returning a matrix 'starg' and vector 'ltime' on output. -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)