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_dafgda

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


Abstract


   CSPICE_DAFGDA reads the double precision data bounded by two addresses
   within a DAF.

I/O


   Given:

      handle   the scalar integer file handle referring to a DAF file.

               help, handle
                  LONG = Scalar

      baddr,
      eaddr    the scalar integer initial and final addresses of a contiguous
               set of double precision numbers within a DAF.

               help, baddr
                  LONG = Scalar
               help, eaddr
                  LONG = Scalar

               Presumably, these make up all or part of a particular array.

               Note that DAF addresses begin at 1 as in the
               FORTRAN version of the SPICE Toolkit.

   the call:

      cspice_dafgda, handle, baddr, eaddr, data

   returns:

      data     the double precision data contained between the specified
               addresses within the specified file.

               help, data
                  DOUBLE = Array[N]

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) Open a type 8 SPK for read access, retrieve the data for
      the first segment and identify the beginning and end addresses,
      the number of data elements within, the size of the data array,
      and print the first two records.

      Use the SPK kernel below as input type 8 SPK file for the example.

         mer1_ls_040128_iau2000_v1.bsp

      Each segment contains only two records which provide the start
      and end position for the MER-1 rover landing site in the IAU_MARS
      frame. Since the landing site does not change over time, it is
      expected that both records are equal.


      Example code begins here.


      PRO dafgda_ex1

         ;;
         ;; Open the type 8 SPK for read access then read the
         ;; data from the first segment.
         ;;
         cspice_dafopr, 'mer1_ls_040128_iau2000_v1.bsp', handle

         ;;
         ;; Begin a forward search; find the first segment; read the
         ;; segment summary.
         ;;
         cspice_dafbfs, handle
         cspice_daffna, found
         cspice_dafgs, 2, 6, dc, ic

         ;;
         ;; Retrieve the data begin and end addresses.
         ;;
         baddr = ic[4]
         eaddr = ic[5]

         print, 'Beginning address       : ', baddr
         print, 'Ending address          : ', eaddr
         print, 'Number of data elements : ', eaddr - baddr + 1

         ;;
         ;; Extract all data bounded by the begin and end addresses.
         ;;
         cspice_dafgda, handle, baddr, eaddr, data

         ;;
         ;; Check 'data'. It should show an array of 16 doubles (4 + 6 * 2).
         ;;
         print, 'Size of data array      : ', n_elements(data)

         ;;
         ;; Check the data.
         ;;
         print, 'The first and second states stored in the segment:'
         print, FORMAT='(6F10.3)', data[0:5]
         print, FORMAT='(6F10.3)', data[6:11]

         ;;
         ;; Safely close the file
         ;;
         cspice_dafcls, handle

      END


      When this program was executed on a Mac/Intel/IDL8.x/64-bit
      platform, the output was:


      Beginning address       :          897
      Ending address          :          912
      Number of data elements :           16
      Size of data array      :           16
      The first and second states stored in the segment:
        3376.422  -326.649  -115.392     0.000     0.000     0.000
        3376.422  -326.649  -115.392     0.000     0.000     0.000


Particulars


   The principal reason that DAFs are so easy to use is that
   the data in each DAF are considered to be one long contiguous
   set of double precision numbers. You can grab data from anywhere
   within a DAF without knowing (or caring) about the physical
   records in which they are stored.

Exceptions


   1)  If `baddr' is zero or negative, the error SPICE(DAFNEGADDR)
       is signaled by a routine in the call tree of this routine.

   2)  If baddr > eaddr, the error SPICE(DAFBEGGTEND) is signaled by a
       routine in the call tree of this routine.

   3)  If `handle' is invalid, an error is signaled by a routine in the
       call tree of this routine.

   4)  If the range of addresses covered between `baddr' and `eaddr'
       includes records that do not contain strictly double
       precision data, then the values returned in `data' are
       undefined. See the -Restrictions section below for details.

   5)  If any of the input arguments, `handle', `baddr' or `eaddr',
       is undefined, an error is signaled by the IDL error handling
       system.

   6)  If any of the input arguments, `handle', `baddr' or `eaddr',
       is not of the expected type, or it does not have the expected
       dimensions and size, an error is signaled by the Icy
       interface.

   7)  If the output argument `data' is not a named variable, an
       error is signaled by the Icy interface.

Files


   None.

Restrictions


   1)  There are several types of records in a DAF. This routine
       is only to be used to read double precision data bounded
       between two DAF addresses. The range of addresses input
       may not cross data and summary record boundaries.

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.1.0, 10-AUG-2021 (JDR)

       Changed the input argument names "begin" and "end" to "baddr"
       and "eaddr" for consistency with other routines.

       Edited -Examples section to comply with NAIF standard. Added
       example's problem statement and a reference to required SPK file.

       Added -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.3, 13-SEP-2012 (EDW)

       Added a complete -Particulars section.

       Minor edits to Example code text.

   -Icy Version 1.0.2, 08-AUG-2008 (EDW)

       Minor edits to header text.

   -Icy Version 1.0.1, 03-FEB-2006 (EDW)

       Edited header for clarity.

   -Icy Version 1.0.0, 03-OCT-2006 (EDW)

Index_Entries


   read data from DAF address



Fri Dec 31 18:43:02 2021