Index Page
cspice_ekaced
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_EKACED adds data to a double precision column in the specified 
   record of an EK file.

   For important details concerning this module's function, please refer to
   the CSPICE routine ekaced_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.
               
      recno    the scalar integer indicating the index of the new
               record.
               
      column   the string scalar name of the column for the new record.
      
      nvals    the integer number of entries from 'dvals' to add to 
               the new record.
               
      dvals    an array of double precision values containing the 
               data values to add to the new record in 'column'/
   
                  Note: 'nvals' specifies the number of 'dvals'
                  entries written to the new record.
   
      isnull   a scalar boolean flagging whether the entry is null, if
               equal to SPICETRUE, cspice_ekaced reserves space for
               record but does not add the record to the EK.
   
   the call:
   
      cspice_ekaced, handle, segno, recno, column, nvals,  $
                     dvals, isnull
   
   adds 'nvals' of the 'dvals' array to column 'column' in segment 'segno',
   record 'recno', of the EK file 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.

   PRO EKACED_T
   
      ;;
      ;; Constants
      ;;
      EKNAME = 'ekrced.ek'
      IFNAME = 'Test EK/Enjoy'
      NCOLS  = 2
      NROWS  = 5
      NRESVC = 0
      TABLE  = 'DP_DATA'
      CVLEN  = 81
      MAXVAL = 10
      dvals  = dblarr( MAXVAL )
      
      ;;
      ;; 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 stores the internal file name. 
      ;;
   
      if ( cspice_exists (EKNAME) ) then begin
         file_delete, EKNAME
      endif
   
      ;;
      ;; Create and open a new EK file.
      ;;
      cspice_ekopn, EKNAME, IFNAME, NRESVC, handle
       
      ;;
      ;;   Set up the table and column names and declarations 
      ;;   for the DP_DATA segment.  We'll index all of 
      ;;   the columns.
      ;;
      cdecls = strarr(NCOLS) 
      cnames = strarr(NCOLS)
   
      ;;
      ;; Define the column names and formats.
      ;;
      cnames[0] = 'DP_COL_1'
      cdecls[0] = 'DATATYPE = DOUBLE PRECISION, INDEXED = TRUE, ' +$
                  'NULLS_OK = TRUE'
    
      cnames[1] = 'DP_COL_2'
      cdecls[1] = 'DATATYPE = DOUBLE PRECISION, SIZE = VARIABLE, '+$
                  'NULLS_OK = TRUE'
   
      ;;
      ;; Start the segment.
      ;;
      cspice_ekbseg, handle, TABLE, NCOLS, cnames, cdecls, segno
   
      ;;
      ;; Loop over the number of rows, writing data to each column.
      ;;
      for i = 0, (NROWS-1) do begin
   
         ;;
         ;; Set the null flag for i == 1.
         ;;
         isnull =  ( i EQ 1 );
      
         ;;
         ;; Append a new record to the EK.
         ;;
         cspice_ekappr, handle, segno, recno
   
         ;;
         ;; Define the scalar.
         ;;
         dvals[0] = double(i + 350.d)
   
         ;;
         ;; Add the data to the EK in column 1.
         ;;
         cspice_ekaced, handle, segno,  recno,  cnames[0],  $
                        1,      dvals,  isnull
   
         ;;
         ;; Array-valued columns follow.
         ;;
         dvals[0] = double( 10*i)
         dvals[1] = double((10*i)+1 )
         dvals[2] = double((10*i)+2 )
   
         ;;
         ;; Add the data to column 2.
         ;;
         cspice_ekaced, handle, segno,  recno,  cnames[1],  $
                        3,      dvals,  isnull
   
      endfor
   
      ;;
      ;; Close the file.
      ;;
      cspice_ekcls, handle
   
      ;;
      ;; Open the created file. Show the values added.
      ;;
      cspice_ekopr, EKNAME, handle
   
      ;;
      ;; Provide a maximum size for the return array 'dvals'.
      ;;
      nelts = 20l
   
      for i = 0, (NROWS-1) do begin
   
         cspice_ekrced, handle, segno, i, cnames[0], nelts, $
                        dvals, isnull
   
         if ( NOT isnull ) then begin
            print, 'Data from column: ',cnames[0],'   record number: ',i
            print, dvals
            print   
         endif
    
         ;;
         ;; Array-valued columns follow.
         ;;
         cspice_ekrced, handle, segno, i, cnames[1], nelts, $
                         dvals, isnull
   
         if ( NOT isnull ) then begin
            print, 'Data from column: ',cnames[1], '   record number: ',i
            print, dvals
            print   
         endif
   
      endfor
   
      ;;
      ;; End the file.
      ;;
      cspice_ekcls, handle

   END 


   IDL outputs:
   
      Data from column: DP_COL_1   record number:        0
          350.00000
   
      Data from column: DP_COL_2   record number:        0
          0.0000000       1.0000000       2.0000000
   
      Data from column: DP_COL_1   record number:        2
          352.00000
   
      Data from column: DP_COL_2   record number:        2
          20.000000       21.000000       22.000000
   
      Data from column: DP_COL_1   record number:        3
          353.00000
   
      Data from column: DP_COL_2   record number:        3
          30.000000       31.000000       32.000000
   
      Data from column: DP_COL_1   record number:        4
          354.00000
   
      Data from column: DP_COL_2   record number:        4
          40.000000       41.000000       42.000000
   
   Note record 1 does not appear due to setting the 'isnull' flag
   to true for that record.

Particulars


   None.

Required Reading


   ICY.REQ
   EK.REQ

Version


   -Icy Version 1.0.1, 23-FEB-2010, EDW (JPL)

      Correction to example code; corrected "cspice_ekrced" argument list.

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

Index_Entries

 
   add double precision data to EK column 
   add data to EK 
   write double precision data to EK column 
 



Wed Apr  5 17:58:00 2017