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
ckgr01

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Declarations
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version

Procedure

     CKGR01 ( C-kernel, get record, type 01 )

     SUBROUTINE CKGR01 ( HANDLE, DESCR, RECNO, RECORD )

Abstract

     Return a specified pointing instance from a CK type 01 segment.
     The segment is identified by a CK file handle and segment
     descriptor.

Required_Reading

     CK
     DAF

Keywords

     POINTING

Declarations

     IMPLICIT NONE

     INTEGER               HANDLE
     DOUBLE PRECISION      DESCR   ( * )
     INTEGER               RECNO
     DOUBLE PRECISION      RECORD  ( * )

Brief_I/O

     VARIABLE  I/O  DESCRIPTION
     --------  ---  --------------------------------------------------
     HANDLE     I   The handle of the file containing the segment.
     DESCR      I   The segment descriptor.
     RECNO      I   The number of the pointing record to be returned.
     RECORD     O   The pointing record.

Detailed_Input

     HANDLE   is the handle of the binary CK file containing the
              desired segment. The file should have been opened
              for read access, either by CKLPF or DAFOPR.

     DESCR    is the packed descriptor of the data type 1 segment.

     RECNO    is the number of the individual pointing record to be
              returned from the data type 1 segment.

Detailed_Output

     RECORD   is the pointing record indexed by RECNO in the segment.
              The contents are as follows:

                 RECORD( 1 ) = CLKOUT

                 RECORD( 2 ) = q0
                 RECORD( 3 ) = q1
                 RECORD( 4 ) = q2
                 RECORD( 5 ) = q3

                 RECORD( 6 ) = Av1  ]
                 RECORD( 7 ) = Av2  |-- Returned optionally
                 RECORD( 8 ) = Av3  ]

              CLKOUT is the encoded spacecraft clock time associated
              with the returned pointing values.

              The quantities q0 - q3 represent a quaternion.
              The quantities Av1, Av2, and Av3 represent the
              angular velocity vector, and are returned only if the
              segment contains angular velocity data. The
              components of the angular velocity vector are
              specified relative to the inertial reference
              frame of the segment.

Parameters

     None.

Exceptions

     1)  If the segment is not of data type 1, the error
         SPICE(CKWRONGDATATYPE) is signaled.

     2)  If RECNO is less than one or greater than the number of
         records in the specified segment, the error
         SPICE(CKNONEXISTREC) is signaled.

     3)  If the specified handle does not belong to any file that is
         currently known to be open, an error is signaled by a routine
         in the call tree of this routine.

     4)  If DESCR is not a valid, packed descriptor of a segment in
         the CK file specified by HANDLE, the results of this routine
         are unpredictable.

Files

     The file specified by HANDLE should be open for read access.

Particulars

     For a detailed description of the structure of a type 1 segment,
     see the CK required reading.

     This is a utility routine that performs as follows. It finds out
     how many records are in the segment, checks to see if the request
     fits the bounds of the segment, and then moves directly to get
     the requested data.

Examples

     The following code fragment prints the records of the first
     segment in a CK file. Suppose MOC.CK is valid CK file that
     contains segments of data type 1.

           INTEGER               ICD     ( 6 )
           INTEGER               HANDLE
           INTEGER               NREC
           INTEGER               I
           DOUBLE PRECISION      DCD     ( 2 )
           DOUBLE PRECISION      DESCR   ( 5 )
           DOUBLE PRECISION      RECORD  ( 8 )
           LOGICAL               FOUND

     C
     C     First load the file. (The file may also be opened by using
     C     CKLPF.)
     C
           CALL DAFOPR ( 'MOC.CK', HANDLE )

     C
     C     Begin forward search.  Find first array.
     C
           CALL DAFBFS ( HANDLE )
           CALL DAFFNA ( FOUND  )

     C
     C     Get segment descriptor.
     C
           CALL DAFGS ( DESCR )

     C
     C     Unpack the segment descriptor into its double precision
     C     and integer components.
     C
           CALL DAFUS ( DESCR, 2, 6, DCD, ICD )

     C
     C     The data type for a segment is located in the third integer
     C     component of the descriptor.
     C
           IF ( ICD( 3 ) .EQ. 1 ) THEN

     C
     C        How many records does this segment contain?
     C
              CALL CKNR01 ( HANDLE, DESCR, NREC )

              DO I = 1, NREC

     C
     C           Get the record associated with record number I.
     C
                 CALL CKGR01 ( HANDLE, DESCR, I, RECORD )
                 WRITE (*,*) 'Record ', I, ':'
                 WRITE (*,*)  RECORD
              END DO

           END IF

Restrictions

     1)  The binary CK file containing the segment whose descriptor was
         passed to this routine must be opened for read access by
         either CKLPF or DAFOPR.

Literature_References

     None.

Author_and_Institution

     J. Diaz del Rio    (ODC Space)
     J.M. Lynch         (JPL)
     W.L. Taber         (JPL)
     R.E. Thurman       (JPL)
     I.M. Underwood     (JPL)
     E.D. Wright        (JPL)

Version

    SPICELIB Version 1.1.1, 26-OCT-2021 (JDR)

        Edited the header to comply with NAIF standard.

    SPICELIB Version 1.1.0, 07-SEP-2001 (EDW)

        Replaced DAFRDA call with DAFGDA.
        Added IMPLICIT NONE.

    SPICELIB Version 1.0.3, 10-MAR-1992 (WLT)

        Comment section for permuted index source lines was added
        following the header.

    SPICELIB Version 1.0.2, 06-MAR-1991 (JML)

        A correction was made to the example program in the
        header. The array of double precision components of
        the descriptor ( DCD ) had originally been declared
        as an integer.

    SPICELIB Version 1.0.1, 02-NOV-1990 (JML)

        The restriction that a C-kernel file must be loaded
        was explicitly stated.

    SPICELIB Version 1.0.0, 07-SEP-1990 (RET) (IMU)
Fri Dec 31 18:36:02 2021