void dafrs_c ( ConstSpiceDouble * sum )
Change the summary for the current array in the current DAF.
DAF
FILES
Variable I/O Description
-------- --- --------------------------------------------------
sum I New summary for current array.
sum is the new summary for the current array. This
replaces the existing summary. However, the addresses
(the final two integer components) of the original
summary are not changed.
None.
None.
1) If this routine is called when no search is in progress in the
the current DAF, the error SPICE(DAFNOSEARCH) is signaled.
2) If the DAF containing the `current' array has actually been
closed, the error will be diagnosed by routines called by
this routine.
3) If the DAF containing the `current' array is not open for
writing, the error will be diagnosed by routines called by
this routine.
4) If no array is current in the current DAF, the error
SPICE(NOCURRENTARRAY) is signaled. There is no current
array when a search is started by dafbfs_c or dafbbs_c, but no
calls to daffna_c or dafbna_ have been made yet, or whenever
daffna_c or daffpa_c return the value SPICEFALSE in the `found'
argument.
This routine operates on a DAF opened for write access. A search
must be in progress at the time this routine is called; this
routine replaces the descriptor of the current segment.
See SPICELIB umbrella routine DAFFA.
1) Replace the body ID code -999 with -1999 in every descriptor
of an SPK file.
#include <SpiceUsr.h>
int main ( int argc, char **argv )
{
#define ND 2
#define NI 6
#define DSCSIZ 5
#define NEWCODE ( -1999 )
#define OLDCODE ( -999 )
SpiceBoolean found;
SpiceInt handle;
SpiceInt ic [ NI ];
SpiceDouble dc [ ND ];
SpiceDouble sum [ DSCSIZ ];
/.
Open for writing the SPK file specified on the command line.
./
dafopw_c ( argv[1], &handle );
/.
Search the file in forward order.
./
dafbfs_c ( handle );
daffna_c ( &found );
while ( found )
{
/.
Fetch and unpack the descriptor (aka summary)
of the current segment.
./
dafgs_c ( sum );
dafus_c ( sum, ND, NI, dc, ic );
/.
Replace ID codes if necessary.
./
if ( ic[0] == OLDCODE )
{
ic[0] = NEWCODE;
}
if ( ic[1] == OLDCODE )
{
ic[1] = NEWCODE;
}
/.
Re-pack the descriptor; replace the descriptor
in the file.
./
dafps_c ( ND, NI, dc, ic, sum );
dafrs_c ( sum );
/.
Find the next segment.
./
daffna_c ( &found );
}
/.
Close the file.
./
dafcls_c ( handle );
return ( 0 );
}
None.
None.
N.J. Bachman (JPL)
W.L. Taber (JPL)
I.M. Underwood (JPL)
-CSPICE Version 1.0.0, 23-NOV-2004 (NJB)
replace daf summary
Link to routine dafrs_c source file dafrs_c.c
|