Index Page
cspice_ekfind
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_EKFIND finds E-kernel data that satisfy a set of constraints.

I/O


   Given:

      query   a string specifying the data to locate from data
              available in all loaded EK files.

              [1,c1] = size(query); char = class(query)

                 or

              [1,1] = size(query); cell = class(query)

              The general form of a query general form:

                 SELECT   <column list>
                 FROM     <table list>
                 [WHERE    <constraint list>]
                 [ORDER BY <ORDER BY column list>]

              (WHERE and ORDER BY are optional parameters)

   the call:

      [ nmrows, ok, errmsg] = cspice_ekfind( query )

   returns:

      query    the number of rows matching the query.

               [1,1] = size(query); int32 = class(query)

      ok       a boolean indicating whether the query parsed correctly, 
               true, or not, false.

               [1,1] = size(ok); logical = class(ok)

      errmsg   the description of the parse error, should one occur,
               otherwise the string returns as blank.

               [1,c2] = size(errmsg); char = class(errmsg)

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.

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

      %
      % Load the EK.
      %
      cspice_furnsh( EK )

      %
      % Assume the file test_file.ek contains the table 'scalar_2',
      % and that "scalar_2' contains columns named:
      %
      %   c_col_1, d_col_1, i_col_1, t_col_1
      %
      % Define a set of constraints to perform a query on all
      % loaded EK files (the SELECT clause).
      %
      query = [ 'Select c_col_1, d_col_1, i_col_1, t_col_1 from ' ...
                'scalar_2 order by row_no' ];

      %
      % Query the EK system for data rows matching the
      % SELECT constraints.
      %
      [ nmrows, ok, errmsg ] = cspice_ekfind( query );

      %
      % Check whether an error occurred while processing the
      % SELECT clause. If so, output the error message.
      %
      if ( ok )
         printf( 'SELECT clause error: %s\n', errmsg );
      end

      %
      % If no error occurred, 'nmrows' contains the number of rows matching
      % the constraints specified in the query string.
      %
      fprintf( 'Number of matching row: %d\n', nmrows )

      %
      % Clear the kernel pool and database. Note, you don't normally
      % unload an EK after a query, rather at the end of a program.
      %
      cspice_kclear

   MATLAB outputs:

      Number of matching row: 20

   Load at least one EK kernel prior to calling cspice_ekfind, otherwise
   an error signals.

Particulars


   None.

Required Reading


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

   MICE.REQ
   EK.REQ

Version


   -Mice Version 1.2.1, 03-NOV-2014, EDW (JPL)

       Edited I/O section to conform to NAIF standard for Mice documentation.

   -Mice Version 1.2.0, 10-MAY-2011, EDW (JPL)

      "logical" call replaced with "zzmice_logical."

   -Mice Version 1.0.0, 10-APR-2010, EDW (JPL)

Index_Entries


   find EK data
   issue EK query


Wed Apr  5 18:00:31 2017