Table of contents
eknseg_c ( EK, number of segments in file )
SpiceInt eknseg_c ( SpiceInt handle )
Return the number of segments in a specified EK.
VARIABLE I/O DESCRIPTION
-------- --- --------------------------------------------------
handle I EK file handle.
The function returns the number of segments in the specified
handle is the handle of an EK file opened for read access.
The function returns the number of segments in the EK identified
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.
See the description of handle in -Detailed_Input.
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.
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.
Example code begins here.
int main( )
Open the EK file, returning the file handle
associated with the open file to the variable named
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
N.J. Bachman (JPL)
J. Diaz del Rio (ODC Space)
-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)
return number of segments in an E-kernel