Index Page
cspice_ckw01
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_CKW01 adds a type 1 segment to a C-kernel.

I/O


   Given:

      handle   file handle for an open CK file, returned from cspice_ckopn.

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

      begtim   encoded SCLK segment begin time.

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

      endtim   encoded SCLK segment end time.

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

      inst     NAIF instrument ID code.

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

      ref      name of the reference frame for the segment.

               [1,c1] = size(ref); char = class(ref)

                  or

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

      avflag   a boolean signifying if the segment will contain
               angular velocity.

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

      segid    name to identify the segment.

               [1,c2] = size(segid); char = class(segid)

                  or

               [1,1] = size(segid); cell = class(segid)

      sclkdp   array containing the encoded SCLK times for the data.

               [n,1] = size(sclkdp); double = class(sclkdp)

      quats    array of SPICE style quaternions representing instrument
               pointing.

               [4,n] = size(quats); double = class(quats)

      avvs     array of angular velocity vectors in units of radians per
               second.

               [3,n] = size(avvs); double = class(avvs)

   the call:

      cspice_ckw01( handle , ...
                    begtime, ...
                    endtime, ...
                    inst   , ...
                    ref    , ...
                    avflag , ...
                    segid  , ...
                    sclkdp , ...
                    quats  , ...
                    avvs )

   returns:

      Adds a type 1 segment to a CK.

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.

      INST1      = -77701;
      NCOMCH     = 10;
      REF        = 'J2000';
      SEGID1     = 'Test type 1 test CK';
      SECPERTICK = 0.001;
      SPACING    = 10.0;
      MAXREC     = 50;

      %
      % Note, sclkdp is a vector input, not a vectorized scalar.
      %
      sclkdp    = [1:MAXREC]';
      sclkdp    = (sclkdp - 1)*SPACING;

      spinrate  = [1:MAXREC]*1.e-6;

      theta     = [0:MAXREC-1]*SPACING;
      theta     = theta .* spinrate;

      %
      % Create a zero-filled array for the angular velocity
      % vectors. This allocates the needed memory and
      % defines a variable of the correct shape.
      %
      expavvs = zeros( [3 MAXREC] );

      a1 = zeros( [1 MAXREC] );
      a2 = a1;

      r  = cspice_eul2m( theta, a2, a1, 3, 1 ,3 );
      q  = cspice_m2q( r );

      %
      % Fill the z component of the expavvs vectors with the
      % corresponding spinrate element scaled to SECPERTICK.
      %
      expavvs(3,:) = spinrate/SECPERTICK;

      begtime = sclkdp(1);
      endtime = sclkdp(MAXREC);
      avflag = 1;

      %
      % Open a new CK, write the data, catch any errors.
      %
      try
         handle = cspice_ckopn( 'test1.ck', 'ck', 0)
         cspice_ckw01( handle , ...
                       begtime, ...
                       endtime, ...
                       INST1  , ...
                       REF    , ...
                       avflag , ...
                       SEGID1 , ...
                       sclkdp , ...
                       q      , ...
                       expavvs )
      catch

         error( [ 'Failure: ' lasterr] )
      end

      cspice_ckcls(handle)

   MATLAB outputs:

      The example code creates a CK with one type 1 segment.

Particulars


   None.

Required Reading


   For important details concerning this module's function, please refer to
   the CSPICE routine ckw01_c.

   MICE.REQ
   CK.REQ
   DAF.REQ
   SCLK.REQ

Version


   -Mice Version 1.0.1, 29-OCT-2014, EDW (JPL)

       Edited I/O section to conform to NAIF standard for Mice documentation.

   -Mice Version 1.0.0, 22-NOV-2005, EDW (JPL)

Index_Entries


   write ck type_1 pointing data segment


Wed Apr  5 18:00:30 2017