void dafgsr_c ( SpiceInt handle,
SpiceInt recno,
SpiceInt begin,
SpiceInt end,
SpiceDouble * data,
SpiceBoolean * found )
Read a portion of the contents of a summary record in a DAF file.
DAF
FILES
Variable I/O Description
-------- --- --------------------------------------------------
handle I Handle of DAF.
recno I Record number.
begin I First word to read from record.
end I Last word to read from record.
data O Contents of record.
found O True if record is found.
handle is the handle associated with a DAF.
recno is the record number of a particular double precision
record within the DAF, whose contents are to be read.
DAF record numbers start at 1.
begin is the first word in the specified record to be
returned. For compatibility with SPICELIB, word
numbers range from 1 to 128.
end is the final word in the specified record to be
returned. For compatibility with SPICELIB, word
numbers range from 1 to 128.
data contains the specified portion (from `begin' to `end',
inclusive) of the specified record.
found is SPICETRUE when the specified record is found, and is
SPICEFALSE otherwise.
None.
1) Bad values for `begin' and `end' (begin < 1, end < begin,
etc.) are not signaled as errors, but result in the actions
implied by the pseudo-code:
for ( j = 0, i = max(1,begin); i <= max(128,end); i++, j++ )
{
data[j] = buffered_DAF_record[i];
}
2) If `handle' is invalid, the error will be diagnosed by
routines called by this routine.
The input handle must refer to a DAF that is open for read or write
access.
dafgsr_c checks the DAF record buffer to see if the requested
record can be returned without actually reading it from
external storage. If not, it reads the record and stores
it in the buffer, typically removing another record from
the buffer as a result.
Once in the buffer, the specified portion of the record is
returned.
The following code fragment illustrates one way that dafgsr_c
and dafwdr_ can be used to update part of a summary record.
If the record does not yet exist, we can assume that it is
filled with zeros.
#include "SpiceUsr.h"
#include "SpiceZfc.h"
SpiceInt size = 128;
SpiceInt recno;
SpiceInt handle;
.
.
.
dafgsr_c ( handle, recno, 1, 128, drec, &found );
if ( !found )
{
cleard_ ( &size, drec );
}
for ( i = first; i <= last; i++ )
{
drec[i] = new_value[i];
}
dafwdr_ ( &handle, &recno, drec );
Note that since only entire records may be written using dafwdr_,
the entire record needs to be read also.
None.
None.
N.J. Bachman (JPL)
F.S. Turner (JPL)
-CSPICE Version 1.0.0, 17-JUN-2009 (NJB) (FST)
read daf summary record
Link to routine dafgsr_c source file dafgsr_c.c
|