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

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_SPKW05 writes an SPK segment of type 5 given a time-ordered 
   set of discrete states and epochs, and the gravitational parameter 
   of a central body.

   For important details concerning this module's function, please refer to
   the CSPICE routine spkw05_c.

I/O

   
   Given:
   
      handle   the scalar integer handle of an SPK file opened
               with write access
               
      body     a scalar integer NAIF ID identifying the body 
               trajectory to record in the SPK file
               
      center   the scalar integer NAIF ID for the center of motion 
               associated with body
               
      frame    a string variable holding the reference frame name
               used to reference the states, e.g. "J2000"
               
      first    the scalar double precision starting epoch, in TDB 
               seconds past J2000, of the ephemeris data
               
      last     the double precision ending epoch, in TDB 
               seconds past J2000, of the ephemeris data
               
      segid    a string variable holding to the segment identifier
               (an SPK segment identifier may contain up to 40 
               printing ASCII characters )
               
      gm       the double precision scalar gravitational parameter of 
               the central body 
             
                   ( in units of kilometers **3 / seconds **2 )
               
      n        the integer number of states and epochs to be stored 
               in the segment
               
      states   an array of 6xN double precision values containing a 
               time-ordered array of geometric states ( x, y, z, 
               dx/dt, dy/dt, dz/dt, in kilometers and kilometers per 
               second ) of the 'body' with respect to 'center'
               
      epochs   an array of N double precision values in a strictly
               increasing sequence containing the epochs 
               (ephemeris seconds past J2000) corresponding to 'states'
               
   Note: the interface code signals an error if the length of 'states' does
   not equal the length of 'epochs'.
   
   the call:
   
        cspice_spkw05, handle, body, center, frame, first, last,  $
                       segid, gm, n, states, epochs
   
   writes to the SPK file referred to by 'handle' a type 5 SPK segment
   containing the data listed in 'states'.
   

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.

   
      ;;
      ;; Define the segment identifier parameters.
      ;;
      BODY       = 3
      CENTER     = 10
      REF        = 'J2000'
      GM_SUN     = 132712440023.310d
      N_DISCRETE = 9
      SPK5       = 'test5.bsp'
   
      segid      = 'SPK type 5 test segment'
   
      ;;
      ;; A set of epochs.
      ;;
      DISCRETEEPOCHS = [ 100.d, 200.d, 300.d, 400.d, 500.d, $ 
                         600.d, 700.d, 800.d, 900.d         $
                       ]
   
      ;;
      ;; An array of discrete states to write to the SPK segment.
      ;;
      DISCRETESTATES = [                                             $  
                       [ 101.d, 201.d, 301.d, 401.d, 501.d, 601.d ], $
                       [ 102.d, 202.d, 302.d, 402.d, 502.d, 602.d ], $
                       [ 103.d, 203.d, 303.d, 403.d, 503.d, 603.d ], $
                       [ 104.d, 204.d, 304.d, 404.d, 504.d, 604.d ], $
                       [ 105.d, 205.d, 305.d, 405.d, 505.d, 605.d ], $
                       [ 106.d, 206.d, 306.d, 406.d, 506.d, 606.d ], $
                       [ 107.d, 207.d, 307.d, 407.d, 507.d, 607.d ], $
                       [ 108.d, 208.d, 308.d, 408.d, 508.d, 608.d ], $
                       [ 109.d, 209.d, 309.d, 409.d, 509.d, 609.d ]  $
                       ]
      
      ;;
      ;; Open a new SPK file.
      ;;  
      if ( cspice_exists(SPK5) ) then begin
         file_delete, SPK5
      endif
      cspice_spkopn, SPK5, 'Type 5 SPK internal file name.', 4, handle
   
      ;;  
      ;; Create a type 5 segment.
      ;;
      cspice_spkw05, handle,                         $
                     BODY,                           $
                     CENTER,                         $
                     REF,                            $
                     DISCRETEEPOCHS[0],              $
                     DISCRETEEPOCHS[N_DISCRETE-1],   $
                     segid,                          $
                     GM_SUN,                         $
                     N_DISCRETE,                     $
                     DISCRETESTATES,                 $
                     DISCRETEEPOCHS
   
      ;;
      ;; Close the SPK file.
      ;;
      cspice_spkcls, handle

Particulars


   None.

Required Reading


   ICY.REQ
   SPK.REQ

Version


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

Index_Entries

 
   write spk type_5 ephemeris data segment 
 



Wed Apr  5 17:58:03 2017