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_celld

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


Abstract


   CSPICE_CELLD creates a double precision Icy data cell of defined
   size.

I/O


   Given:

      size     the number of elements in the cell's double precision data
               array.

               help, size
                  LONG = Scalar

   the call:

      cell = cspice_celld( size )

   returns:

      cell     a double precision SPICE cell with `size' elements available in
               the cell's data array.

               help, cell, /struct
               ** Structure <id>, 10 tags, length=L, data length=L-1, refs=1:
                  OFFSET          LONG      Array[9]
                  DTYPE           LONG         1
                  LENGTH          LONG         0
                  SIZE            LONG         size
                  CARD            LONG         0
                  ISSET           BYTE         1
                  ADJUST          BYTE         0
                  INIT            BYTE         0
                  BASE            DOUBLE    Array[DATA+size]
                  DATA            LONG         6

               where L = 108 + size * 8.

               The scalar IDL structure is composed of fields corresponding to
               a SPICE cell:

               OFFSET   A 9-vector of IDL_MEMINT offsets for each of the
                        structure fields with respect to the beginning of the
                        structure.

                        Element 0 of the array contains the offset to the DTYPE
                        field; element 1 of the array contains the offset to
                        the LENGTH field, etc.

                        This array has no function in a cell sense.
                        The SPICE cell implementation uses the OFFSET
                        values to locate data fields within the IDL structure.

               DTYPE    Data type of cell: an integer scalar defining the type
                        of data stored in the cell data array.

               LENGTH   For character cells, the integer scalar declared length
                        of the cell's string array.

               SIZE     An integer scalar defining the maximum number of data
                        items that can be stored in the cell's data array.

               CARD     The cell's "cardinality": the integer scalar defining
                        the number of data items currently present in the cell

                        Note CARD <= SIZE.

                        This field has value 0 after cell creation.

               ISSET    A boolean scalar flag indicating whether the cell is a
                        SPICE set. Sets have no duplicate data items, and their
                        data items are stored in increasing order.

               ADJUST   A boolean scalar flag indicating whether the cell's
                        data area has adjustable size. Adjustable size cell
                        data areas are not currently implemented.

               INIT     A boolean scalar flag indicating whether the cell is
                        initialized.

               BASE     The array of type DTYPE with SIZE + DATA elements
                        (an N-vector, N = SIZE + DATA)

               DATA     The offset from the first element of the BASE array
                        to the cell data. This field has value
                        SPICE_CELL_CTRLSZ (defined in SpiceCel.h), referred to
                        as the control segment size.

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) Create a cell containing a double precision 8-vector, insert numbers
      in it and display its contents.


      Example code begins here.


      PRO celld_ex1

         ;;
         ;; Create a cell containing a double precision 8-vector.
         ;;
         cell = cspice_celld( 8 )

         ;;
         ;; Insert the list of double precision numbers into the
         ;; cell. If the item is an element of the cell, the cell is
         ;; not changed.
         ;;
         items = [ 0.d, 1.d, 1.d, 2.d, 3.d, 5.d, 8.d, 13.d ]

         cspice_insrtd, items, cell

         ;;
         ;; Where `array' has cardinality CARD, non-zero
         ;; for this example.
         ;;
         data_start = cell.data
         data_end   = data_start + cell.card - 1
         array      = cell.base[ data_start:data_end]

         print, 'Double precision numbers in SPICE cell:'
         print, array

         ;;
         ;; Display the structure information.
         ;;
         print
         print, 'SPICE cell information:'
         help, cell, /struct

      END


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


      Double precision numbers in SPICE cell:
             0.0000000       1.0000000       2.0000000       3.0000000
             5.0000000       8.0000000       13.000000

      SPICE cell information:
      ** Structure <1a34904>, 10 tags, length=172, data length=171, refs=1:
         OFFSET          LONG      Array[9]
         DTYPE           LONG                 1
         LENGTH          LONG                 0
         SIZE            LONG                 8
         CARD            LONG                 7
         ISSET           BYTE         1
         ADJUST          BYTE         0
         INIT            BYTE         1
         BASE            DOUBLE    Array[14]
         DATA            LONG                 6


      Note the length of the BASE field equals the defined SIZE, 8,
      plus the value of the DATA offset, 6.

      Access to the cell data array is best done using the Icy calls, but
      if necessary a user can directly access the data.

Particulars


   A cell as used in Icy is a structure similar to the CSPICE expression
   of a cell; all fields present in the CSPICE structure exist in the Icy
   version.

   The DATA field defines the offset from the start of the BASE array to
   the beginning of the cell array data. The first DATA elements of BASE
   serve as control information.

Exceptions


   1)  If the input argument `size' is undefined, an error is
       signaled by the IDL error handling system.

   2)  If the input argument `size' is not of the expected type, or
       it does not have the expected dimensions and size, an error is
       signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   CELLS.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.3, 27-AUG-2021 (JDR)

       Added arguments' type and size information in -I/O section.

       Edited the header to comply with NAIF standard. Added complete code
       example using existing fragments.

       Added -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

   -Icy Version 1.0.2, 19-JAN-2009 (EDW)

      Edited -Examples sections to show use of the cardinality field,
      ".card," (correct) instead of the size field, ".size," (incorrect).
      Eliminated the code showing direct writes to the cell data field.
      Users should call Icy routines to change cell data.

   -Icy Version 1.0.1, 12-SEP-2006 (EDW)

      Correct Required Reading citation cell.req to cells.req.

   -Icy Version 1.0.0, 01-AUG-2004 (EDW)

Index_Entries


   create a d.p. cell



Fri Dec 31 18:43:02 2021