Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_spkssb

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_SPKSSB returns the geometric state (position and
   velocity) of a target body relative to the solar system
   barycenter.

I/O


   Given:

      targ     the standard NAIF ID code for a target body.

               help, targ
                  LONG = Scalar

      et       the epoch (ephemeris time) at which the state of the target body
               is to be computed.

               help, et
                  DOUBLE = Scalar

      ref      the name of the reference frame relative to which the output
               state vector should be expressed.

               help, ref
                  STRING = Scalar

               This may be any frame supported by the Icy frame system,
               including dynamic and other non-inertial frames.

   the call:

      cspice_spkssb, targ, et, ref, starg

   returns:

      starg    a Cartesian state vector representing the position and velocity
               of the target body, relative to the solar system barycenter, at
               epoch `et'.

               help, starg
                  DOUBLE = Array[6]

               This vector is rotated into the specified reference frame.
               Units are always km and km/sec.

Parameters


   None.

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.

   1) Look-up the geometric state vector of Mars (499) and Earth (399)
      with respect to the Solar System Barycenter in the J2000 frame
      and compute the absolute distance between the two bodies at
      epoch July 4, 2003 11:00 AM PST.

      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File: spkssb_ex1.tm

         This meta-kernel is intended to support operation of SPICE
         example programs. The kernels shown here should not be
         assumed to contain adequate or correct versions of data
         required by SPICE-based user applications.

         In order for an application to use this meta-kernel, the
         kernels referenced here must be present in the user's
         current working directory.

         The names and contents of the kernels referenced
         by this meta-kernel are as follows:

            File name                        Contents
            ---------                        --------
            de430.bsp                        Planetary ephemeris
            mar097.bsp                       Mars satellite ephemeris
            naif0011.tls                     Leapseconds


         \begindata

            KERNELS_TO_LOAD = ( 'de430.bsp',
                                'mar097.bsp',
                                'naif0011.tls' )

         \begintext

         End of meta-kernel


      Example code begins here.


      PRO spkssb_ex1

         ;;
         ;; Load a set of kernels: an SPK file, a PCK
         ;; file and a leapseconds file. Use a meta
         ;; kernel for convenience.
         ;;
         cspice_furnsh, 'spkssb_ex1.tm'

         ;;
         ;; Define parameters for a state lookup:
         ;;
         targ1  = 499
         epoch  = 'July 4, 2003 11:00 AM PST'
         frame  = 'J2000'
         targ2  = 399

         ;;
         ;; Convert the epoch to ephemeris time.
         ;;
         cspice_str2et, epoch, et

         ;;
         ;; Look-up the states for the defined parameters.
         ;;
         cspice_spkssb, targ1, et, frame, state1
         cspice_spkssb, targ2, et, frame, state2

         ;;
         ;; What measure of distance separates the two bodies
         ;; at epoch.
         ;;
         dist = cspice_vdist( state1[0:2], state2[0:2] )

         print, 'The absolute distance (KM)      : ', dist
         print, 'between Mars and Earth at epoch : ', epoch

         ;;
         ;; It's always good form to unload kernels after use,
         ;; particularly in IDL due to data persistence.
         ;;
         cspice_kclear

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      The absolute distance (KM)      :        80854820.
      between Mars and Earth at epoch : July 4, 2003 11:00 AM PST


      Note, an cspice_spkgeo call equivalent to the two cspice_spkssb
      calls present in the code example:

         cspice_spkgeo, targ1, et, frame, targ2, state, ltime
         dist = norm( state[0:2] )

Particulars


   In order to compute the state of one body relative to another,
   the states of the two bodies must be known relative to a third
   body. One simple solution is to use the solar system barycenter
   as the third body.

   Ephemeris data from more than one segment may be required
   to determine the state of a body relative to the barycenter.
   cspice_spkssb reads as many segments as necessary, from as many
   files as necessary, using files that have been loaded by
   previous calls to cspice_furnsh or cspice_spklef (load ephemeris file).

Exceptions


   1)  If sufficient information has not been "loaded" via the routine
       cspice_furnsh, cspice_spklef or the PCK kernel loaders, an error is
       signaled by a routine in the call tree of this routine.

   2)  If any of the input arguments, `targ', `et' or `ref', is
       undefined, an error is signaled by the IDL error handling
       system.

   3)  If any of the input arguments, `targ', `et' or `ref', is not
       of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

   4)  If the output argument `starg' is not a named variable, an
       error is signaled by the Icy interface.

Files


   See -Restrictions.

Restrictions


   1)  The ephemeris files to be used by cspice_spkssb must be loaded
       by cspice_furnsh or cspice_spklef before cspice_spkssb is called.

Required_Reading


   ICY.REQ
   SPK.REQ
   FRAMES.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.1, 01-JUN-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement and meta-kernel. Added cspice_kclear call to
       example code.

       Added -Parameters, -Exceptions, -Files, -Restrictions, -Particulars,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.0.0, 16-JUN-2003 (EDW)

Index_Entries


   state relative to solar system barycenter



Fri Dec 31 18:43:07 2021