Index Page
cspice_ekacli
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_EKACLI adds a column of integer data to an EK segment.

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

I/O

   
   Given:
   
      handle   the scalar integer referring to an EK file open for 
               write access
      segno    the scalar integer indicating EK segment number
               for the new record
      column   the scalar string naming the target column for the data
               stored in 'ivals'
      ivals    an array of integers, listed in row order, containing
               the data to add to the EK referred to by 'handle'
      entszs   an array of integers containing the sizes of column
               entries - used only for columns possessing variable size
               entries; the ith element of 'entszs' corresponds to the
               size of the ith entry of 'ivals'
      nlflgs   an array of booleans indicating whether the
               corresponding 'ivals' has a null value, with
               the ith entry of 'nlflgs' corresponding to the ith
               entry of 'ivals'
      rcptrs   an integer array of record pointers, returned from
               cspice_ekifld, for the input segment
      wkindx   a read/write array of integers, used as a workspace
               when building an column index - as this array
               functions as read/write, the calling routine must
               declare an appropriate size of nrows (the number of 
               rows in the column)
   
   the call:
   
      cspice_ekacli, handle, segno, column, ivals, entszs, nlflgs, $
                     rcptrs, wkindx
   
   writes the 'ivals' data to 'column' in segment 'segno' of the
   EK referred to by 'handle'.
   

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.

   
      ;;
      ;; Define needed parameters.
      ;;
      SPICEFALSE = 0B
      SPICETRUE  = 1B
      EKNAME     = "ekacli.ek"
      IFNAME     = "Test EK"
      NCOLS      = 2
      NRESVC     = 0
      NROWS      = 9
      TABLE      = "DATAORDERS"
   
      ;;
      ;; Open a new EK file.  For simplicity, we won't
      ;; reserve space for the comment area, so the 
      ;; number of reserved comment characters is zero. 
      ;; The constant IFNAME is the internal file name. 
      ;;
      if ( cspice_exists( EKNAME) ) then begin
          file_delete, EKNAME
      endif
      cspice_ekopn, EKNAME, IFNAME, NRESVC, handle
   
      cnames = strarr( NCOLS )
      cdecls = strarr( NCOLS )
   
      cnames[0] = "ORDER_ID" 
      cdecls[0] = "DATATYPE = INTEGER, INDEXED = TRUE"
   
      cnames[1] = "CUSTOMER_ID"
      cdecls[1] = "DATATYPE = INTEGER, INDEXED = TRUE"
   
   
      ;;
      ;; Start the segment.  We presume the number of  rows 
      ;; of data is known in advance. 
      ;;
      cspice_ekifld, handle,  TABLE,   NCOLS,  NROWS,  $  
                     cnames,   cdecls, segno,  rcptrs
   
      ;;
      ;; At this point, arrays containing data for the 
      ;; segment's columns may be assigned.  The names 
      ;; of the data arrays: 
      ;;
      ;;   Column           Data array 
      ;;
      ;;   "ORDER_ID"       ordids 
      ;;   "CUSTOMER_ID"    cstids
      ;;
      ;; The null flags array indicates which entries are null. 
      ;; It is ignored for columns that don't allow null 
      ;; values.  In this case, neither column allows 
      ;; nulls. 
      ;;
      ;; Fill in data arrays and null flag arrays here.  This code
      ;; section would normally be replaced by calls to user functions
      ;; returning column values.
      ;;
      ordids = lonarr( NROWS)
      cstids = lonarr( NROWS)
      nlflgs = lonarr( NROWS)
      wkindx = lonarr( NROWS)
      sizes  = lonarr( NROWS)
   
      for i = 0, (NROWS-1) do begin
   
         ordids[i] = i
         cstids[i] = i*100
         nlflgs[i] = SPICEFALSE
   
      endfor
   
      ;;
      ;; The sizes array shown below is ignored for scalar 
      ;; and fixed-size array columns, so we need not 
      ;; initialize it.  For variable-size arrays, the 
      ;; Ith element of the sizes array must contain the size 
      ;; of the Ith column entry in the column being written. 
      ;; Normally, the sizes array would be reset for each 
      ;; variable-size column. 
      ;;
      ;; Add the columns of data to the segment.  All of the 
      ;; data for each column is written in one shot. 
      ;;
      cspice_ekacli, handle, segno, "order_id", ordids, sizes, nlflgs, $
                     rcptrs, wkindx
   
      cspice_ekacli, handle, segno, "customer_id", cstids, sizes, nlflgs,$
                     rcptrs, wkindx
   
      ;;
      ;; Complete the segment.  The rcptrs array is that 
      ;; returned by ekifld_c. 
      ;;
      cspice_ekffld, handle, segno, rcptrs
   
      ;;
      ;; The file must be closed by a call to cspice_ekcls
      ;;
      cspice_ekcls, handle

Particulars


   None.

Required Reading


   ICY.REQ
   EK.REQ

Version


   -Icy Version 1.0.0, 16-JUN-2003, EDW (JPL)

Index_Entries

 
   write entire integer column to EK segment 
 



Wed Apr  5 17:58:00 2017