| spkr18 | 
| Table of contents Procedure
     SPKR18 ( Read SPK record from segment, type 18 )
     SUBROUTINE SPKR18 ( HANDLE, DESCR, ET, RECORD )
Abstract
     Read a single SPK data record from a segment of type 18
     (MEX/Rosetta Orbit file interpolation).
Required_Reading
     SPK
Keywords
     EPHEMERIS
Declarations
     IMPLICIT NONE
     INCLUDE 'spk18.inc'
     INTEGER               HANDLE
     DOUBLE PRECISION      DESCR    ( 5 )
     DOUBLE PRECISION      ET
     DOUBLE PRECISION      RECORD   ( * )
Brief_I/O
     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     HANDLE     I   File handle.
     DESCR      I   Segment descriptor.
     ET         I   Target epoch.
     RECORD     O   Data record.
Detailed_Input
     HANDLE,
     DESCR    are the file handle and segment descriptor for
              a SPK segment of type 18.
     ET       is a target epoch, for which a data record from
              a specific segment is required.
Detailed_Output
     RECORD   is a set of data from the specified segment which,
              when evaluated at epoch ET, will give the state
              (position and velocity) of some body, relative
              to some center, in some reference frame.
              The structure of the record is as follows:
                 +----------------------+
                 | subtype code         |
                 +----------------------+
                 | number of packets (n)|
                 +----------------------+
                 | packet 1             |
                 +----------------------+
                 | packet 2             |
                 +----------------------+
                             .
                             .
                             .
                 +----------------------+
                 | packet n             |
                 +----------------------+
                 | epochs 1--n          |
                 +----------------------+
              The packet size is a function of the subtype code.
              All packets in a record have the same size.
Parameters
     None.
Exceptions
     1)  If the input HANDLE does not designate a loaded SPK file, an
         error is signaled by a routine in the call tree of this
         routine.
     2)  If the segment specified by DESCR is not of data type 18,
         the error SPICE(WRONGSPKTYPE) is signaled.
     3)  If the input ET value is not within the range specified
         in the segment descriptor, the error SPICE(TIMEOUTOFBOUNDS)
         is signaled.
     4)  If the window size is non-positive or greater than the
         maximum allowed value, the error SPICE(INVALIDVALUE) is
         signaled.
     5)  If the window size is not compatible with the segment
         subtype, the error SPICE(INVALIDVALUE) is signaled.
     6)  If the segment subtype is not recognized, the error
         SPICE(NOTSUPPORTED) is signaled.
     7)  If the input segment contains fewer than 2 packets, the
         error SPICE(TOOFEWSTATES) is signaled.
Files
     See argument HANDLE.
Particulars
     See the SPK Required Reading file for a description of the
     structure of a data type 18 segment.
Examples
     The data returned by the SPKRnn routine is in its rawest form,
     taken directly from the segment. As such, it will be meaningless
     to a user unless he/she understands the structure of the data type
     completely. Given that understanding, however, the SPKRxx
     routines might be used to "dump" and check segment data for a
     particular epoch.
     C
     C     Get a segment applicable to a specified body and epoch.
     C
           CALL SPKSFS ( BODY, ET, HANDLE, DESCR, IDENT, FOUND )
     C
     C     Look at parts of the descriptor.
     C
           CALL DAFUS ( DESCR, 2, 6, DCD, ICD )
           CENTER = ICD( 2 )
           REF    = ICD( 3 )
           TYPE   = ICD( 4 )
           IF ( TYPE .EQ. 18 ) THEN
              CALL SPKR18 ( HANDLE, DESCR, ET, RECORD )
                  .
                  .  Look at the RECORD data.
                  .
           END IF
Restrictions
     1)  Correctness of inputs must be ensured by the caller of
         this routine.
Literature_References
     None.
Author_and_Institution
     N.J. Bachman       (JPL)
     J. Diaz del Rio    (ODC Space)
Version
    SPICELIB Version 2.0.1, 12-AUG-2021 (JDR)
        Edited the header to comply with NAIF standard.
    SPICELIB Version 2.0.0, 21-DEC-2012 (NJB)
        An error check was added for segment packet counts
        less than 2.
        An in-line comment regarding deducibility of record size from
        segment subtype was removed. The comment now says the actual
        count of packets in the output record is inserted into the
        record.
    SPICELIB Version 1.0.0, 04-SEP-2002 (NJB) | 
Fri Dec 31 18:36:54 2021