Table of contents
CSPICE_DAFHSF returns the summary format associated with a handle.
Given:
handle the handle associated with a previously opened DAF file.
[1,1] = size(handle); int32 = class(handle)
the call:
[nd, ni] = cspice_dafhsf( handle )
returns:
nd,
ni the numbers of double precision and integer components,
respectively, in each array summary in the specified file.
[1,1] = size(nd); int32 = class(nd)
[1,1] = size(ni); int32 = class(ni)
None.
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.
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.
function dafhsf_ex1()
%
% Local variables.
%
daf = 'de421.bsp';
%
% Open the `daf' and find the summary format.
%
[handle] = cspice_dafopr( daf );
[nd, ni] = cspice_dafhsf( handle );
%
% Start a forward search and examine each array in
% turn.
%
cspice_dafbfs( handle );
[found] = cspice_daffna;
n = 0;
while found
%
% Obtain the array summary, unpack it, and get
% the initial and final array addresses from
% the integer descriptor component.
%
[dc, ic] = cspice_dafgs( nd, ni );
ia = ic( ni - 1);
fa = ic( ni );
n = fa - ia + 1 + n;
[found] = cspice_daffna;
end
fprintf( 'Number of d.p. words is %d\n', n )
When this program was executed on a Mac/Intel/Octave5.x/64-bit
platform, the output was:
Number of d.p. words is 2098004
The 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.
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.
2) If the input argument `handle' is undefined, an error is
signaled by the Matlab error handling system.
3) If the input argument `handle' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Mice interface.
None.
None.
DAF.REQ
MICE.REQ
None.
J. Diaz del Rio (ODC Space)
-Mice Version 1.0.0, 09-AUG-2021 (JDR)
handle to DAF summary format
|