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_appndd

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


Abstract


   CSPICE_APPNDD appends an item or list of items to a double precision cell.

I/O


   Given:

      item     a double precision value which is to be appended to `cell'.

               help, item
                  DOUBLE = Scalar   or   DOUBLE = Array[N]

      cell     a double precision SPICE cell to which `item' will be appended.

               help, cell
                  STRUCT = cspice_celld(N)

               The user must create `cell' using cspice_celld.

   the call:

      cspice_appndd, item, cell

   returns:

      cell     the input cell with `item' appended.

               help, cell
                  STRUCT = cspice_celld(N)

               `item' is the last member of `cell'.

               If `cell' is actually a SPICE set on input and ceases to
               qualify as a set as result of the requested append
               operation, the `isSet' member of cell will be set to
               False.

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 for fifteen elements, add a first element to
      it and then append several more double precision numbers.
      Validate the cell into a set and print the result. Finally,
      append another double precision number. After each operation,
      check if the cell constitutes a set or not.


      Example code begins here.


      PRO appndd_ex1

         ;;
         ;; Create a cell for fifteen elements.
         ;;
         SIZE = 15

         cell = cspice_celld( SIZE )

         ;;
         ;; Add a single item to the new cell
         ;;
         cspice_appndd, 0.d, cell

         ;;
         ;; Now insert a list of items.
         ;;
         items = [ 1.d, 1., 2., 3., 5., 8., 13., 21., 34. ]

         cspice_appndd, items, cell

         ;;
         ;; Output the contents of 'set'. Recall
         ;; set data begins at 'set.base[ set.data + 0 ]'.
         ;;
         print, 'Items in original cell A:'
         for i=0, cspice_card(cell)-1 do begin
            print, FORMAT='(F6.1,$)', cell.base[ cell.data + i]
         endfor
         print, ' '

         ;;
         ;; After the append, does the cell key as a set?
         ;;
         if(  cell.isset ) then print, "Cell is a set after first append"
         if( ~cell.isset ) then print, "Cell is not a set after first append"

         ;;
         ;; Force a set. Validate the cell as a set.
         ;;
         cspice_valid, SIZE, SIZE, cell

         print, ' '
         print, 'Items in cell A after cspice_valid:'
         for i=0, cspice_card(cell)-1 do begin
            print, FORMAT='(F6.1,$)', cell.base[ cell.data + i]
         endfor
         print, ' '

         if(  cell.isset ) then print, "Cell is a set after cspice_valid"
         if( ~cell.isset ) then print, "Cell is not a set cspice_valid"

         ;;
         ;; Append a new value to the cell, the value being less than all
         ;; other set values.
         ;;
         cspice_appndd, -22.d, cell

         print, ' '
         print, 'Items in cell A after second append:'
         for i=0, cspice_card(cell)-1 do begin
            print, FORMAT='(F6.1,$)', cell.base[ cell.data + i]
         endfor
         print, ' '

         ;;
         ;; The data array does not satisfy the requirements for a set,
         ;; check the `isset' flag indicates the change.
         ;;
         if(  cell.isset ) then print, "Cell is a set after second append"
         if( ~cell.isset ) then print, "Cell is not a set after second append"

      END


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


      Items in original cell A:
         0.0   1.0   1.0   2.0   3.0   5.0   8.0  13.0  21.0  34.0
      Cell is not a set after first append

      Items in cell A after cspice_valid:
         0.0   1.0   2.0   3.0   5.0   8.0  13.0  21.0  34.0
      Cell is a set after cspice_valid

      Items in cell A after second append:
         0.0   1.0   2.0   3.0   5.0   8.0  13.0  21.0  34.0 -22.0
      Cell is not a set after second append


      Note that if the cell is not big enough to accommodate the
      addition of an item, an error is signaled. In this case, the
      cell is not altered.

Particulars


   The user must create any needed cell structures with cspice_celld,
   cspice_celli prior to use regardless of whether the routine
   uses the cell as input or returns it as output.

Exceptions


   1)  If the cell is not big enough to accommodate the addition of a
       new element, the error SPICE(CELLTOOSMALL) is signaled by a
       routine in the call tree of this routine.

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

   3)  If any of the input arguments, `item' 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


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

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

       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.0, 03-OCT-2006 (EDW)

Index_Entries


   append an item to a d.p. cell



Fri Dec 31 18:43:02 2021