| dafhsf_c |
|
Table of contents
Procedure
dafhsf_c ( DAF, handle to summary format )
void dafhsf_c ( SpiceInt handle,
SpiceInt * nd,
SpiceInt * ni )
AbstractReturn the summary format associated with a handle. Required_ReadingDAF KeywordsCONVERSION DAF FILES Brief_I/OVARIABLE I/O DESCRIPTION -------- --- -------------------------------------------------- handle I Handle of a DAF file. nd O Number of double precision components in summaries. ni O Number of integer components in summaries. Detailed_Input
handle is the handle associated with a previously opened
DAF file.
Detailed_Output
nd,
ni are the numbers of double precision and integer
components, respectively, in each array summary
in the specified file.
ParametersNone. Exceptions
1) If the specified handle does not belong to any file that is
currently known to be open, the error SPICE(DAFNOSUCHHANDLE)
is signaled by a routine in the call tree of this routine.
FilesNone. ParticularsThe summary format must be known in order to pack or unpack an array summary. See the DAF Required Reading for a discussion of summary formats. 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 d.p. `words' in a DAF having an
arbitrary summary format.
Use the SPK kernel below as input DAF file for the program.
de421.bsp
Example code begins here.
/.
Program dafhsf_ex1
./
#include <stdio.h>
#include "SpiceUsr.h"
int main( )
{
/.
Count the number of d.p. words of data in a
`daf'. Exclude array summaries, reserved records,
the file record, and character records.
./
#define MAXND 124
#define MAXNI 250
#define MAXSUM 125
/.
Local variables.
./
SpiceChar * daf;
SpiceDouble dc [MAXND];
SpiceDouble sum [MAXSUM];
SpiceInt fa;
SpiceInt handle;
SpiceInt ia;
SpiceInt ic [MAXNI];
SpiceInt n;
SpiceInt nd;
SpiceInt ni;
SpiceBoolean found;
daf = "de421.bsp";
/.
Open the `daf' and find the summary format.
./
dafopr_c ( daf, &handle );
dafhsf_c ( handle, &nd, &ni );
/.
Start a forward search and examine each array in
turn.
./
dafbfs_c ( handle );
daffna_c ( &found );
n = 0;
while ( found )
{
/.
Obtain the array summary, unpack it, and get
the initial and final array addresses from
the integer descriptor component.
./
dafgs_c ( sum );
dafus_c ( sum, nd, ni, dc, ic );
ia = ic[ ni - 2];
fa = ic[ ni - 1];
n = fa - ia + 1 + n;
daffna_c ( &found );
}
printf( "Number of d.p. words is %d\n", n );
return ( 0 );
}
When this program was executed on a Mac/Intel/cc/64-bit
platform, the output was:
Number of d.p. words is 2098004
RestrictionsNone. Literature_ReferencesNone. Author_and_InstitutionJ. Diaz del Rio (ODC Space) Version-CSPICE Version 1.0.0, 09-JUL-2021 (JDR) Index_Entrieshandle to DAF summary format Link to routine dafhsf_c source file dafhsf_c.c |
Fri Dec 31 18:41:03 2021