ckr05 |
Table of contents
ProcedureCKR05 ( Read CK record from segment, type 05 ) SUBROUTINE CKR05 ( HANDLE, DESCR, SCLKDP, TOL, NEEDAV, . RECORD, FOUND ) AbstractRead a single CK data record from a segment of type 05 (MEX/Rosetta Attitude file interpolation). Required_ReadingCK KeywordsPOINTING DeclarationsIMPLICIT NONE INCLUDE 'ck05.inc' INCLUDE 'ckparam.inc' INTEGER HANDLE DOUBLE PRECISION DESCR ( 5 ) DOUBLE PRECISION SCLKDP DOUBLE PRECISION TOL LOGICAL NEEDAV DOUBLE PRECISION RECORD ( * ) LOGICAL FOUND Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- HANDLE I File handle. DESCR I Segment descriptor. SCLKDP I Pointing request time. TOL I Lookup tolerance. NEEDAV I Angular velocity flag. RECORD O Data record. FOUND O Flag indicating whether record was found. Detailed_InputHANDLE, DESCR are the file handle and segment descriptor for a CK segment of type 05. SCLKDP is an encoded spacecraft clock time indicating the epoch for which pointing is desired. TOL is a time tolerance, measured in the same units as encoded spacecraft clock. When SCLKDP falls within the bounds of one of the interpolation intervals then the tolerance has no effect because pointing will be returned at the request time. However, if the request time is not in one of the intervals, then the tolerance is used to determine if pointing at one of the interval endpoints should be returned. NEEDAV is .TRUE. if angular velocity is requested. Detailed_OutputRECORD is a set of data from the specified segment which, when evaluated at epoch SCLKDP, will give the attitude and angular velocity of some body, relative to the reference frame indicated by DESCR. The structure of the record is as follows: +----------------------+ | evaluation epoch | +----------------------+ | subtype code | +----------------------+ | number of packets (n)| +----------------------+ | nominal SCLK rate | +----------------------+ | 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. ParametersNone. ExceptionsThis routine follows the pattern established in the lower-numbered CK data type readers of not explicitly performing error diagnoses. Exceptions are listed below nonetheless. 1) If the input HANDLE does not designate a loaded CK 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 05, the error SPICE(WRONGCKTYPE) is signaled. 3) If the input SCLK 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 tolerance is negative, the error SPICE(VALUEOUTOFRANGE) is signaled. FilesSee argument HANDLE. ParticularsSee the CK Required Reading file for a description of the structure of a data type 05 segment. ExamplesThe data returned by the CKRnn 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 CKRxx routines might be used to "dump" and check segment data for a particular epoch. The search performed here does not mimic the behavior of the CK reader APIs CKGP and CKGPAV, which continue searching when an applicable segment doesn't satisfy a pointing request. See the CK Required reading for details. C C Get a segment applicable to a specified body and epoch. C CALL CKBSS ( INST, SCLKDP, TOL, NEEDAV ) CALL CKSNS ( HANDLE, DESCR, SEGID, SFND ) IF ( .NOT. SFND ) THEN [Handle case of pointing not being found] END IF 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. 05 ) THEN CALL CKR05 ( HANDLE, DESCR, SCLKDP, TOL, NEEDAV, . RECORD, FOUND ) IF ( .NOT. FOUND ) THEN [Handle case of pointing not being found] END IF [Look at the RECORD data] . . . END IF Restrictions1) Correctness of inputs must be ensured by the caller of this routine. Literature_ReferencesNone. Author_and_InstitutionN.J. Bachman (JPL) J. Diaz del Rio (ODC Space) VersionSPICELIB Version 2.0.1, 06-JUL-2021 (NJB) (JDR) Corrected code example: removed comment character preceding CKBSS call. Added note regarding difference between this search and those performed by the CK reader APIs CKGP and CKGPAV. Edited the header to comply with NAIF standard. SPICELIB Version 2.0.0, 27-JAN-2014 (NJB) Increased MAXDEG to 23 for compatibility with CK type 6. SPICELIB Version 1.1.0, 06-SEP-2002 (NJB) |
Fri Dec 31 18:36:03 2021