Index Page
A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 

Required Reading


   CSPICE_EKNELT returns an integer value of the number of elements
   in the specified row in a specified column.

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


   selidx   the scalar integer index of the column in the
            the SELECT from which to retrieve data. The range of  
            'selidx' is 0:nsel-1 inclusive, where 'nsel' is the
            number of items in the SELECT clause of the current query.
   row      the scalar integer index of the row containing the element. 
            This number refers to a member of the set of rows 
            matching a query.  row must be in the range 
            where nmrows is the matching row count returned 
            by cspice_ekfind. 
   the call:

      nelt = cspice_eknelt( selidx, row )


      nelt   the scalar integer number of elements in the column entry 
             belonging to the specified column in the specified row. 

      Null entries in variable-size columns are considered to have size 1. 


   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.

      ;; Assign an EK file to load.
      EK= 'test_file.ek'

      ;; Load the EK.
      cspice_furnsh, EK

      ;; The file "test_file.ek" contains the table 'vector_1', and
      ;; 'vector_1' has the column named 'd_col_1', a vector of double 
      ;; precision values.
      ;; Define a set of constraints to perform a query on all
      ;; loaded EK file (the SELECT clause). In this case select 
      ;; the column "d_col_1" from table "vector_1."
      query = 'Select d_col_1 from vector_1 order by row_no'

      ;; Query the EK system for data rows matching the
      ;; SELECT restraints.
      cspice_ekfind, query, nmrows, error, errmsg

      ;; Check whether an error occurred while processing the
      ;; SELECT clause. If so, output the error message.
      if ( error ) then begin
         print, 'SELECT clause error: ', errmsg

      ;; Loop over each row found to match the query.
      for rowno = 0, (nmrows-1) do begin

         ;; Fetch the double precision data. We know the query returned
         ;; one column, determine the number of values in the row of
         ;; interest.
         selidx = 0
         nelt   = cspice_eknelt( selidx, rowno)

         ;; Use cspice_ekgd to retrieve the double from 
         ;; row/column position.

         for eltidx = 0, (nelt-1) do begin

            cspice_ekgd, selidx, rowno, eltidx, ddata, isnull, found

            ;; Output the value, if non-null data exists at the 
            ;; requested position.
            if ( NOT isnull ) then begin
               print, FORMAT='(A,3I2,F12.1)',           $
                             'Double precision data: ', $
                              selidx, rowno, eltidx, ddata



      ;; Unload the EK. Note, you don't normally unload an EK
      ;; after a query, rather at the end of a program.
      cspice_unload, EK

   IDL outputs:

      Double precision data:  0 0 0   5000101.0
      Double precision data:  0 0 1   5000102.0
      Double precision data:  0 0 2   5000103.0
      Double precision data:  0 0 3   5000104.0
      Double precision data:  0 1 0   5000201.0
      Double precision data:  0 1 1   5000202.0
      Double precision data:  0 1 2   5000203.0
      Double precision data:  0 1 3   5000204.0
      Double precision data:  0 2 0   5000301.0
      Double precision data:  0 2 1   5000302.0
      Double precision data:  0 2 2   5000303.0
      Double precision data:  0 2 3   5000304.0


   This routine is meant to be used in conjunction with the EK 
   fetch entry points cspice_ekgc, cspice_ekgd, and cspice_ekgi
   allowing the caller of those routines to determine appropriate
   loop bounds to use to fetch each column entry in the current row.

Required Reading



   -Icy Version 1.0.3, 24-APR-2010, EDW (JPL)

      Minor edit to code comments eliminating typo.
      Implemented a complete code example.

   -Icy Version 1.0.2, 03-FEB-2008, EDW (JPL)

      Completed the previously empty I/O section. Edited the header 
      for clarity.

   -Icy Version 1.0.1, 09-DEC-2005, EDW (JPL)

      Added Examples section.

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


   return the number of elements in a column entry 

Wed Apr  5 17:58:00 2017