| ckmeta |
|
Table of contents
Procedure
CKMETA ( CK ID to associated SCLK )
SUBROUTINE CKMETA ( CKID, META, IDCODE )
Abstract
Return (depending upon the user's request) the ID code of either
the spacecraft or spacecraft clock associated with a C-Kernel ID
code.
Required_Reading
CK
FRAMES
Keywords
UTILITY
Declarations
IMPLICIT NONE
INCLUDE 'zzctr.inc'
INTEGER CKID
CHARACTER*(*) META
INTEGER IDCODE
Brief_I/O
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
CKID I The ID code for some C kernel object.
META I The kind of meta data requested 'SPK' or 'SCLK'
IDCODE O The requested SCLK or spacecraft ID code.
Detailed_Input
CKID is the ID code for some object whose attitude
and possibly angular velocity are stored in
some C-kernel.
META is a character string that indicates which piece
of meta data to fetch. Acceptable values are
'SCLK' and 'SPK'. The routine is case insensitive.
Leading and trailing blanks are insignificant.
However, blanks between characters are regarded
as being significant.
Detailed_Output
IDCODE if META is 'SCLK' then the value returned in IDCODE
is the ID code of the spacecraft clock used for
converting ET to TICKS and TICKS to ET for the
C-kernel used to represent the attitude of the
object with ID code CKID.
If META is 'SPK' then the value returned in IDCODE is the
ID code of the spacecraft on which the platform indicated
by CKID is mounted.
Parameters
None.
Exceptions
1) If the variable META is not recognized to be one of the
inputs 'SPK' or 'SCLK', the error SPICE(UNKNOWNCKMETA)
is signaled.
2) If CKID is greater than -1000, the associated SCLK and SPK
IDs must be in the kernel pool. If they are not present
a value of zero is returned for the requested item. Zero
is never the valid ID of a spacecraft clock.
Files
None.
Particulars
This is a utility routine for mapping C-kernels to associated
spacecraft clocks.
An association of an SCLK ID and spacecraft ID with a CK frame
class ID may be made by placing in a text kernel the kernel
variable assignments
CK_<ck_frame_class_ID_code>_SCLK = <ID code of SCLK>
CK_<ck_frame_class_ID_code>_SPK = <SPK ID code>
See the Frames Required Reading section on CK frames.
Examples
The numerical results shown for this example may differ across
platforms. The results depend on the SPICE kernels used as
input, the compiler and supporting libraries, and the machine
specific arithmetic implementation.
1) Suppose you would like to look up the attitude of an object
in a C-kernel but have ET and seconds as your input time and
tolerance.
Use the meta-kernel shown below to load the required SPICE
kernels.
KPL/MK
File name: ckmeta_ex1.tm
This meta-kernel is intended to support operation of SPICE
example programs. The kernels shown here should not be
assumed to contain adequate or correct versions of data
required by SPICE-based user applications.
In order for an application to use this meta-kernel, the
kernels referenced here must be present in the user's
current working directory.
The names and contents of the kernels referenced
by this meta-kernel are as follows:
File name Contents
-------------------- -----------------------
cas00071.tsc CASSINI SCLK
naif0012.tls Leapseconds
04153_04182ca_ISS.bc CASSINI image navigated
spacecraft CK
\begindata
KERNELS_TO_LOAD = ( 'naif0012.tls',
'cas00071.tsc'
'04153_04182ca_ISS.bc' )
\begintext
End of meta-kernel
Example code begins here.
PROGRAM CKMETA_EX1
IMPLICIT NONE
C
C Local parameters.
C
C -- The code for CASSINI spacecraft reference frame is
C -82000.
C
C -- The reference frame we want is J2000.
C
CHARACTER*(*) REF
PARAMETER ( REF = 'J2000' )
INTEGER CKID
PARAMETER ( CKID = -82000 )
C
C Local variables.
C
DOUBLE PRECISION AV ( 3 )
DOUBLE PRECISION CLKOUT
DOUBLE PRECISION CMAT ( 3, 3 )
DOUBLE PRECISION ET
DOUBLE PRECISION ETOUT
DOUBLE PRECISION SECTOL
DOUBLE PRECISION TICKS
DOUBLE PRECISION TICK2
DOUBLE PRECISION TOL
INTEGER IDCODE
LOGICAL FOUND
C
C Initial values.
C
DATA ET / 141162208.034340D0 /
DATA SECTOL / 0.5D0 /
C
C First load the CK, LSK and SCLK files.
C
CALL FURNSH ( 'ckmeta_ex1.tm' )
C
C Get the SCLK identifier of the spacecraft clock required
C to convert from ET to TICKS.
C
CALL CKMETA ( CKID, 'SCLK', IDCODE )
C
C Convert ET and ET+SECTOL to spacecraft clock ticks.
C
CALL SCE2C ( IDCODE, ET, TICKS )
CALL SCE2C ( IDCODE, ET+SECTOL, TICK2 )
C
C Compute the tolerance in spacecraft clock ticks.
C
TOL = TICK2 - TICKS
C
C Look the attitude up.
C
CALL CKGPAV ( CKID, TICKS, TOL, REF,
. CMAT, AV, CLKOUT, FOUND )
WRITE(*,'(A,F20.6)') 'Input ET: ', ET
IF ( FOUND ) THEN
CALL SCT2E ( IDCODE, CLKOUT, ETOUT )
WRITE(*,'(A,F20.6)') 'Attitude found at ET:', ETOUT
ELSE
WRITE(*,'(A)') 'No attitude found at ET.'
END IF
END
When this program was executed on a Mac/Intel/gfortran/64-bit
platform, the output was:
Input ET: 141162208.034340
Attitude found at ET: 141162208.034586
Restrictions
None.
Literature_References
None.
Author_and_Institution
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
B.V. Semenov (JPL)
W.L. Taber (JPL)
Version
SPICELIB Version 1.2.1, 07-JUN-2021 (JDR) (NJB)
Edited the header to comply with NAIF standard. Added complete
code example based on existing fragment.
SPICELIB Version 1.2.0, 06-SEP-2013 (BVS)
BUG FIX: the POOL agents now watch both variables --
CK_<ID>_SCLK and CK_<ID>_SPK. Before they watched only
CK_<ID>_SCLK.
BUG FIX: if a previously available CK_<ID>_SCLK or CK_<ID>_SPK
variable that was used to populate a saved value disappears,
the routine now resets and returns the value based on the
default rule rather than keeping and returning the stale
POOL-based saved value.
BUG FIX: the routine now deletes watchers for the CK IDs that
were bumped from the local buffer.
Updated to keep track of agent-specific POOL counters and call
ZZCVPOOL to make use of them.
SPICELIB Version 1.1.0, 05-MAR-2009 (NJB)
This routine now keeps track of whether its kernel pool
look-up failed. If so, a kernel pool lookup is attempted on
the next call to this routine. This change is an enhancement,
not a bug fix (unlike similar modifications in SCLK routines).
Header sections were put in correct order.
SPICELIB Version 1.0.1, 09-MAR-1999 (NJB)
Comments referring to SCE2T have been updated to refer to
SCE2C. Occurrences of "id" replaced by "ID."
SPICELIB Version 1.0.0, 04-OCT-1994 (WLT)
|
Fri Dec 31 18:36:02 2021