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
eknseg_c

Table of contents
Procedure
Abstract
Required_Reading
Keywords
Brief_I/O
Detailed_Input
Detailed_Output
Parameters
Exceptions
Files
Particulars
Examples
Restrictions
Literature_References
Author_and_Institution
Version
Index_Entries

Procedure

   eknseg_c ( EK, number of segments in file ) 

   SpiceInt eknseg_c ( SpiceInt handle )

Abstract

   Return the number of segments in a specified EK.

Required_Reading

   EK

Keywords

   EK
   UTILITY


Brief_I/O

   VARIABLE  I/O  DESCRIPTION
   --------  ---  --------------------------------------------------
   handle     I   EK file handle.

   The function returns the number of segments in the specified
   E-kernel.

Detailed_Input

   handle      is the handle of an EK file opened for read access.

Detailed_Output

   The function returns the number of segments in the EK identified
   by `handle'.

Parameters

   None.

Exceptions

   1)  If `handle' is invalid, an error is signaled by a routine in the
       call tree of this routine. eknseg_c will return the value zero.

   2)  If an I/O error occurs while trying to read the EK, the error
       is signaled by a routine in the call tree of this routine.
       eknseg_c will return the value zero.

Files

   See the description of handle in -Detailed_Input.

Particulars

   This routine is used to support the function of summarizing an
   EK file. Given the number of segments in the file, a program
   can use ekssum_c in a loop to summarize each of them.

Examples

   The numerical results shown for this example may differ across
   platforms. The results depend on the SPICE kernels used as
   input, the compiler and supporting libraries, and the machine
   specific arithmetic implementation.

   1) Find the number of segments on an EK.

      Use the EK kernel below as test input file for loading the
      experiment database. This kernel contains the Deep
      Impact spacecraft sequence data based on the integrated
      Predicted Events File covering the whole primary mission.

         dif_seq_050112_050729.bes


      Example code begins here.


      /.
         Program eknseg_ex1
      ./
      #include <stdio.h>
      #include "SpiceUsr.h"

      int main( )
      {

         /.
         Local variables.
         ./
         SpiceInt             handle;
         SpiceInt             nseg;

         /.
         Open the EK file, returning the file handle
         associated with the open file to the variable named
         `handle'.
         ./
         ekopr_c ( "dif_seq_050112_050729.bes", &handle );

         /.
         Return the number of segments in the EK.
         ./
         nseg = eknseg_c ( handle );
         printf( "Number of segments =  %d\n", nseg );

         /.
         Close the file.
         ./
         ekcls_c ( handle );

         return ( 0 );
      }


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


      Number of segments =  2

Restrictions

   None.

Literature_References

   None.

Author_and_Institution

   N.J. Bachman        (JPL)
   J. Diaz del Rio     (ODC Space)

Version

   -CSPICE Version 1.0.1, 10-AUG-2021 (JDR)

       Edited the header to comply with NAIF standard. Added
       complete code example.

   -CSPICE Version 1.0.0, 24-FEB-1999 (NJB)

Index_Entries

   return number of segments in an E-kernel
Fri Dec 31 18:41:06 2021