Index of Functions: A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X 
Index Page
cspice_dafrs

Table of contents
Abstract
I/O
Parameters
Examples
Particulars
Exceptions
Files
Restrictions
Required_Reading
Literature_References
Author_and_Institution
Version
Index_Entries


Abstract


   CSPICE_DAFRS changes the summary for the current array
   in the current DAF.

I/O


   Given:

      nd       a scalar integer defining the size of the double precision array
               `dc'.

               help, nd
                  LONG = Scalar

      ni       a scalar integer defining the size of the integer array `ic'.

               help, ni
                  LONG = Scalar

      dc       the array of double precision components of the summary.

               help, dc
                  DOUBLE = Array[nd]

      ic       the array of integer components of the summary.

               help, ic
                  LONG = Array[ni]

   the call:

      cspice_dafrs, nd, ni, dc, ic

   changes the summary for the current array in the current DAF.

Parameters


   None.

Examples


   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) Replace the body ID code 301 (Moon) with a test body ID,
      e.g. -999, in every descriptor of an SPK file.


      Example code begins here.


      PRO dafrs_ex1

         ;;
         ;; Local parameters.
         ;;
         MAXOBJ = 1000

         ND = 2
         NI = 6

         NEWCODE = ( -999 )
         OLDCODE = ( 301 )

         ;;
         ;; Local variables.
         ;;
         ids = cspice_celli( MAXOBJ )

         ;;
         ;; Get the SPK file name.
         ;;
         fname = ''
         read, fname, PROMPT =  'Enter name of the SPK file > '

         ;;
         ;; Open for writing the SPK file.
         ;;
         cspice_dafopw, fname, handle

         ;;
         ;; Search the file in forward order.
         ;;
         cspice_dafbfs, handle
         cspice_daffna, found

         while ( found ) do begin

            ;;
            ;; Fetch and unpack the descriptor (aka summary)
            ;; of the current segment.
            ;;
            cspice_dafgs, ND, NI, dc, ic

            ;;
            ;; Replace ID codes if necessary.
            ;;
            if ( ic[0] eq OLDCODE ) then begin
               ic[0] = NEWCODE
            endif
            if ( ic[1] eq OLDCODE ) then begin
               ic[1] = NEWCODE
            endif

            ;;
            ;; Re-pack the descriptor; replace the descriptor
            ;; in the file.
            ;;
            cspice_dafrs, ND, NI, dc, ic

            ;;
            ;; Find the next segment.
            ;;
            cspice_daffna, found

         endwhile

         ;;
         ;; Close the file.
         ;;
         cspice_dafcls, handle

         ;;
         ;; Find the set of objects in the SPK file.
         ;;
         cspice_spkobj, fname, ids

         print, 'Objects in the DAF file:'
         print, ''

         for i=0, cspice_card( ids ) - 1L do begin

            obj  =  ids.base[ ids.data + i ]
            print, FORMAT='(I4,$)', obj

         endfor
         print, ''

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, using the SPK file named de430.bsp, the output was:


      Enter name of the SPK file > de430.bsp
      Objects in the DAF file:

      -999   1   2   3   4   5   6   7   8   9  10 199 299 399


Particulars


   This routine writes the contents of `dc' and `ic' to the current
   DAF segment summary.

   For an SPK file, `nd' always equals 2, `ni' always equals 6. The precise
   contents of the vectors depend on the type of DAF but the
   final two elements of the `ic' (integer) vector always contains the
   initial and final addresses respectively of the array.

   A single call to cspice_dafrs equates to the C calls:

      dafps_c ( nd, ni, dc, ic, sum );
      dafrs_c ( sum );

   without use of the `sum' variable.

   The summary of the current array in the current DAF can
   be updated by providing new ones through cspice_dafrs. This feature
   should not be used except to correct errors that occurred during
   the creation of a file. Note that changes can only be made to
   files opened for write access.

Exceptions


   1)  If `nd' is zero or negative, no double precision components are
       stored.

   2)  If `ni' is zero or negative, no integer components are stored.

   3)  If the total size of the summary, computed as

               (ni - 1)
          nd + -------- + 1
                   2

       is greater than 125 double precision words, some components may
       not be stored.

   4)  If this routine is called when no search is in progress in the
       the current DAF, the error SPICE(DAFNOSEARCH) is signaled by a
       routine in the call tree of this routine.

   5)  If the DAF containing the "current" array has actually been
       closed, an error is signaled by a routine in the call tree of
       this routine.

   6)  If the DAF containing the "current" array is not open for
       writing, an error is signaled by a routine in the call tree of
       this routine.

   7)  If no array is current in the current DAF, the error
       SPICE(NOCURRENTARRAY) is signaled by a routine in the call tree
       of this routine. There is no current array when a search is
       started by cspice_dafbfs or cspice_dafbbs, but no calls to
       cspice_daffna or cspice_daffpa have been made yet, or whenever
       cspice_daffna or cspice_daffpa return the value False.

   8)  If any of the input arguments, `nd', `ni', `dc' or `ic', is
       undefined, an error is signaled by the IDL error handling system.

   9)  If any of the input arguments, `nd', `ni', `dc' or `ic', is not
       of the expected type, or it does not have the expected dimensions
       and size, an error is signaled by the Icy interface.

Files


   None.

Restrictions


   None.

Required_Reading


   ICY.REQ
   DAF.REQ

Literature_References


   None.

Author_and_Institution


   J. Diaz del Rio     (ODC Space)
   E.D. Wright         (JPL)

Version


   -Icy Version 1.0.1, 24-NOV-2021 (JDR)

       Edited the header to comply with NAIF standard. Added complete
       example code.

       Added -Particulars, -Parameters, -Exceptions, -Files, -Restrictions,
       -Literature_References and -Author_and_Institution sections.

       Removed reference to the routine's corresponding CSPICE header from
       -Abstract section.

       Added arguments' type and size information in the -I/O section.

   -Icy Version 1.0.0, 08-DEC-2004 (EDW)

Index_Entries


   replace DAF summary



Fri Dec 31 18:43:02 2021