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
cspice_ckfxfm

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries

Abstract


   CSPICE_CKFXFM finds the state transformation matrix from a C-kernel (CK)
   frame with the specified frame class ID (CK ID) to the base frame of the
   highest priority CK segment containing orientation and angular velocity
   data for this CK frame at the time requested.

I/O


   Given:

      inst     the unique frame class ID (CK ID) of the CK frame for which
               data is being requested.

               [1,1] = size(inst); int32 = class(inst)

      et       the epoch for which the state transformation is desired.

               [1,1] = size(et); double = class(et)

               `et' should be given in seconds past the epoch of J2000
               TDB.

   the call:

      [xform, ref, found] = cspice_ckfxfm( inst, et )

   returns:

      xform    a state transformation matrix that converts states relative
               to the CK frame given by its frame class ID, `inst', to
               states relative to the base frame given by its frame ID,
               `ref'.

               [6,6] = size(xform); double = class(xform)

               Thus, if a state S has components x, y, z, dx, dy, dz in
               the CK frame, then S has components x', y', z', dx',
               dy', dz' in the base frame `ref'.

                  .-   -.     .-         -. .-  -.
                  |  x' |     |           | |  x |
                  |  y' |     |           | |  y |
                  |  z' |     |           | |  z |
                  | dx' |  =  |   xform   | | dx |
                  | dy' |     |           | | dy |
                  | dz' |     |           | | dz |
                  `-   -'     `-         -' `-  -'


      ref      the ID code of the base reference frame to which `xform' will
               transform states.

               [1,1] = size(ref); int32 = class(ref)

      found    true if a record was found to satisfy the pointing request.

               [1,1] = size(found); logical = class(found)

               `found' will be false otherwise.

Parameters


   None.

Examples


   Any numerical results shown for this example may differ between
   platforms as the results depend on the SPICE kernels used as input
   and the machine specific arithmetic implementation.

   1) Use cspice_ckfxfm to compute the angular rate of rotation for the Mars
      Global Surveyor (MGS) spacecraft frame, 'MGS_SPACECRAFT',
      relative to the inertial frame used as the base frame in CK
      files containing MGS spacecraft orientation at 2003-JUL-25
      13:00:00. The frame class ID (CK ID) for the 'MGS_SPACECRAFT'
      frame is -94000.

      Use the meta-kernel shown below to load the required SPICE
      kernels.


         KPL/MK

         File name: ckfxfm_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
            ---------                     --------
            naif0012.tls                  Leapseconds
            mgs_sclkscet_00061.tsc        MGS SCLK coefficients
            mgs_sc_ext12.bc               MGS s/c bus attitude

         \begindata

         KERNELS_TO_LOAD = ( 'naif0012.tls',
                             'mgs_sclkscet_00061.tsc',
                             'mgs_sc_ext12.bc' )

         \begintext

         End of meta-kernel


      Example code begins here.


      function ckfxfm_ex1()

         %
         % Local parameters.
         %
         EPOCH =   '2003-JUL-25 13:00:00';
         INST  =   -94000;

         %
         % Load the required LSK, SCLK and CK. Use a
         % meta-kernel for convenience.
         %
         cspice_furnsh( 'ckfxfm_ex1.tm' );

         %
         % First convert the time to seconds past J2000.
         %
         [et] = cspice_str2et( EPOCH );

         %
         % Now, look up the state transformation from the MGS
         % spacecraft frame specified by its frame class ID
         % (CK ID) to a base reference frame (returned by
         % cspice_ckfxfm), at `et'.
         %
         [xform, ref, found] = cspice_ckfxfm( INST, et );

         %
         % Next determine the angular velocity of the
         % transformation.
         %
         [rot, av] = cspice_xf2rav( xform );

         %
         % The angular rate of change (in radians/second) is just
         % the magnitude of `av'.
         %
         fprintf( 'Angular rate of change (rad/s): %19.16f\n',            ...
                                            cspice_vnorm( av ) )

         %
         % It's always good form to unload kernels after use,
         % particularly in Matlab due to data persistence.
         %
         cspice_kclear


      When this program was executed on a Mac/Intel/Octave6.x/64-bit
      platform, the output was:


      Angular rate of change (rad/s):  0.0008907319999591


Particulars


   cspice_ckfxfm searches through loaded CK files to satisfy a pointing
   request. Last-loaded files are searched first, and individual
   files are searched in backwards order, giving priority to
   segments that were added to a file later than the others.

   The search ends when a segment is found that can give pointing
   for the specified CK frame at the request time.

   Only segments with angular velocities are considered by this
   routine.

   This routine uses the cspice_ckmeta routine to determine the SCLK ID
   used to convert the input `et' time to the encoded SCLK time used
   to look up pointing data in loaded CK files.

Exceptions


   1)  If no CK files were loaded prior to calling this routine, an
       error is signaled by a routine in the call tree of this
       routine.

   2)  If no SCLK correlation data needed to read CK files were
       loaded prior to calling this routine, an error is signaled by
       a routine in the call tree of this routine.

   3)  If the input time `et' cannot be converted to an encoded SCLK
       time, using SCLK data associated with `inst', an error is
       signaled by a routine in the call tree of this routine.

   4)  If any of the input arguments, `inst' or `et', is undefined,
       an error is signaled by the Matlab error handling system.

   5)  If any of the input arguments, `inst' or `et', is not of the
       expected type, or it does not have the expected dimensions and
       size, an error is signaled by the Mice interface.

Files


   cspice_ckfxfm searches through loaded CK files to locate a segment that
   can satisfy the request for state transformation data for the CK
   frame with the specified frame class ID at time `et'. You must load
   a CK file containing such data before calling this routine. You
   must also load SCLK and possibly LSK files needed to convert the
   input `et' time to the encoded SCLK time with which the orientation
   data stored inside that CK is tagged.

Restrictions


   1)  A CK file must be loaded prior to calling this routine.

   2)  LSK and SCLK files needed for time conversions must be loaded
       prior to calling this routine.

Required_Reading


   CK.REQ
   MICE.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)

Version


   -Mice Version 1.0.0, 13-DEC-2021 (JDR)

Index_Entries


   get instrument frame transformation and reference frame


Fri Dec 31 18:44:23 2021