cknr01 |
Table of contents
ProcedureCKNR01 ( C-kernel, number of records, type 01 ) SUBROUTINE CKNR01 ( HANDLE, DESCR, NREC ) AbstractReturn the number of pointing instances in a CK type 01 segment. The segment is identified by a CK file handle and segment descriptor. Required_ReadingCK DAF KeywordsPOINTING DeclarationsIMPLICIT NONE INTEGER HANDLE DOUBLE PRECISION DESCR ( * ) INTEGER NREC Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- HANDLE I The handle of the file containing the segment. DESCR I The descriptor of the type 1 segment. NREC O The number of records in the segment. Detailed_InputHANDLE is the handle of the binary CK file containing the segment whose descriptor was also passed. The file should have been opened for read access, either by CKLPF or DAFOPR. DESCR is the packed descriptor of a data type 1 segment. Detailed_OutputNREC is the number of pointing records in the type 1 segment. ParametersNone. Exceptions1) If the segment indicated by DESCR is not a type 1 segment, the error SPICE(CKWRONGDATATYPE) is signaled. 2) 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. 3) 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. FilesThe file specified by HANDLE should be open for read access. ParticularsFor a complete description of the internal structure of a type 1 segment, see the CK required reading. ExamplesThe following code fragment prints the records of the first segment in a CK file. Suppose MOC.CK is binary 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 Restrictions1) 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_ReferencesNone. Author_and_InstitutionJ. 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) VersionSPICELIB 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:03 2021