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_ssize

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


Abstract


   CSPICE_SSIZE sets the size (maximum cardinality) of a SPICE cell of
   any data type.

I/O


   Given:

      size     the scalar integer size (maximum number of elements) to assign
               to `cell'.

               help, size
                  LONG = Scalar

               `size' must be non-negative and must be no larger than the
               initial declared size of the cell.

      cell     a SPICE cell of any data type.

               help, cell
                  STRUCT = cspice_celld(N)   or   STRUCT = cspice_celli(N)

               `cell' must be declared as a double precision, or integer.

               The user must create `cell' using either cspice_celld or
               cspice_celli.

   the call:

      cspice_ssize, size, cell

   returns:

      cell     on output, the cell with its size updated to the value given by
               the input argument 'size'.

               help, cell
                  STRUCT = cspice_celld(N)   or   STRUCT = cspice_celli(N)

               The cardinality of the cell is set to 0.

               The cell becomes a SPICE set: the cell's "is a set?" attribute
               becomes True. This routine does not clear the unused portion
               of the cell's control area.

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 double precision SPICE cell of ten elements and insert
      three intervals into it, creating a window. Finally, reduce
      the size of the SPICE cell by two elements. Check the size and
      cardinality of the cell after each of the operations.

      Example code begins here.


      PRO ssize_ex1

         ;;
         ;; Set a size for the cell.
         ;;
         SIZE = 10

         ;;
         ;; Create a double precision cell of SIZE
         ;;
         cell = cspice_celld( SIZE )

         ;;
         ;; Output the cardinality and size of a new cell.
         ;;
         print, "Size of cell, initial       : ", cspice_size( cell )
         print, "Cardinality of cell, initial: ", cspice_card( cell )

         ;;
         ;; Define an array of intervals.
         ;;
         array = [ [ 1.d, 3.0], [ 7.0, 11.0], [23.0, 27.0] ]

         ;;
         ;; Insert data into the cell, creating a window.
         ;;
         for i=0,2 do begin
            cspice_wninsd, array[0,i], array[1,i], cell
         endfor

         print, "Cardinality of cell, filled : ", cspice_card( cell )

        ;;
        ;; Reset the size to SIZE - 2 to free.
        ;;
        cspice_ssize, size-2, cell

        print, "Size of cell, reset         : ", cspice_size( cell )
        print, "Cardinality of cell, reset  : ", cspice_card( cell )

        END


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


      Size of cell, initial       :           10
      Cardinality of cell, initial:            0
      Cardinality of cell, filled :            6
      Size of cell, reset         :            8
      Cardinality of cell, reset  :            0


Particulars


   None.

Exceptions


   1)  If an attempt is made to set the size of the cell to a
       negative number, the error SPICE(INVALIDSIZE) is signaled by a
       routine in the call tree of this routine.

   2)  The size of a cell may not be set to a value larger than the
       original declared size. However, the SPICE cell routines
       cannot detect this error.

   3)  If any of the input arguments, `size' or `cell', is undefined,
       an error is signaled by the IDL error handling system.

   4)  If any of the input arguments, `size' or `cell', 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


   1)  See exception (2) in the -Exceptions section.

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, 26-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added example's
       problem statement.

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

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

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

   -Icy Version 1.0.2, 08-AUG-2008 (EDW)

       Minor edits to header text.

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

       Corrections to English.

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

   -Icy Version 1.0.0, 29-MAR-2006 (EDW)

Index_Entries


   None.



Fri Dec 31 18:43:08 2021