Index Page
cspice_spkw02
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_SPKW02 write a type 2 SPK segment to a SPK file.

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

I/O

   
   Given:
   
      handle   a scalar integer referring to 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 )
      intlen   a double precision scalar describing the time
               interval in seconds covered by the Chebyshev 
               coefficient set
      n        the integer number of coefficient sets
      polydg   the integer degree of the Chebyshev polynomials,
               i.e. the number of Chebyshev coefficients minus one
      cdata    an array of double precision values containing
               the sets of Chebyshev polynomial coefficients to
               write to the SPK segment
   
                  the (degree + 1) coefficients for the first 
                  coordinate of the first logical record 
   
                  the coefficients for the second coordinate 
   
                  the coefficients for the third coordinate 
   
                  the coefficients for the first coordinate for 
                  the second logical record, ... 
   
                  and so on. 
   
      btime    the double precision time in seconds (past J2000
               TDB) of the first set of coefficients; 'first'
               is an appropriate value for 'btime'
   
   the call:
   
      cspice_spkw02, handle, body, center, frame, first, last, $
                     segid, intlen, n, polydg, cdata, btime
   
   writes to the SPK file referred to by 'handle' a type 2 SPK segment
   containing the data listed in 'cdata'.
   

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'
      N_RECORDS     = 4
      SPK2          = "test2.bsp"
      CHBDEG        = 2
   
      ;;
      ;; A set of Chebyshev coefficients.
      ;; 
      CHEBYCOEFFS02 = [1.0101d, 1.0102d, 1.0103d, $
                       1.0201d, 1.0202d, 1.0203d, $
                       1.0301d, 1.0302d, 1.0303d, $ 
                       2.0101d, 2.0102d, 2.0103d, $
                       2.0201d, 2.0202d, 2.0203d, $
                       2.0301d, 2.0302d, 2.0303d, $
                       3.0101d, 3.0102d, 3.0103d, $
                       3.0201d, 3.0202d, 3.0203d, $
                       3.0301d, 3.0302d, 3.0303d, $        
                       4.0101d, 4.0102d, 4.0103d, $
                       4.0201d, 4.0202d, 4.0203d, $
                       4.0301d, 4.0302d, 4.0303d  $
                      ]
   
      ;;
      ;; A set of epochs. 
      ;;
      DISCRETEEPOCHS = [ 100.d, 200.d, 300.d, 400.d, 500.d, $ 
                         600.d, 700.d, 800.d, 900.d         $
                       ]
      
      ;;
      ;; Create a segment identifier.
      ;;
      segid = 'SPK type 2 test segment'
       
      ;;
      ;; Open a new SPK file.
      ;;
      if ( cspice_exists(SPK2) ) then begin
         file_delete, SPK2
      endif
      cspice_spkopn, SPK2, 'Type 2 SPK internal file name.', 4, handle
   
      ;;
      ;; Create a type 2 segment.
      ;;
      intlen = DISCRETEEPOCHS[1]-DISCRETEEPOCHS[0];
   
      cspice_spkw02, handle,                    $
                     BODY,                      $
                     CENTER,                    $
                     REF,                       $
                     DISCRETEEPOCHS[0],         $
                     DISCRETEEPOCHS[N_RECORDS], $
                     segid,                     $
                     intlen,                    $
                     N_RECORDS,                 $
                     CHBDEG,                    $
                     CHEBYCOEFFS02,             $ 
                     DISCRETEEPOCHS[0]
                       
      ;;
      ;; 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_2 data segment 
 



Wed Apr  5 17:58:03 2017