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

Abstract
I/O
Examples
Particulars
Required Reading
Version
Index_Entries

Abstract


   CSPICE_DASEC extracts comments from the comment area of a binary
   DAS file.

   For important details concerning this module's function, please refer to
   the CSPICE routine dasec_c.

I/O


   Given:

      handle   the file handle of a binary DAS file which has been
               opened with read access. This handle refers to the DAS
               file from which to read the comment section.

      bufsiz   a scalar integer defining the maximum number of comments
               that may be placed into `buffer'.

      buflen   a scalar integer defining the allowed length of each
               string element of the output `buffer'.
               This length must be large enough to hold the
               longest output string. The SPICE system imposes no limit
               on the length of comment lines, so 'buflen' normally
               should be set to a "generous" value that is unlikely
               to be exceeded.

   the call:

      cspice_dasec, handle, bufsiz, buflen, n, buffer, done

   returns:

      n        the scalar integer number of comment lines read from the comment
               area of the binary DAS referred to by 'handle'. 'n' will be
               less than or equal to 'bufsiz' on output ( bufsiz >= n).

      buffer   a string vector containing comment lines which have been
               extracted from the comment area of the binary DAS
               file attached to handle.

               On output, `buffer' contains `bufsiz' or less strings of comment
               text, with one comment line per string ( bufsiz >= n).

      done     a scalar logical indicating whether or not all of the
               comment lines from the comment area of the DAS file have
               been read. This variable has the value true after the
               last comment line has been read. It will have the value
               false otherwise.

               If no comments exist in the comment area, this variable
               returns as true.

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.

   The following example will extract the comment area of a
   binary DAS file attached to `handle', displaying the comments on
   the terminal screen.

      PRO DASEC_T, das

         SPICEFALSE = 0L
         BUFSIZE    = 40L
         LINLEN     = 115L

         ;;
         ;; Open for reading the DAS, return the corresponding
         ;; file handle to 'handle'.
         ;;
         cspice_dasopr, das, handle

         done = SPICEFALSE

         cspice_dasec, handle, BUFSIZE, LINLEN, n, buf, done

         for i=0,n-1 do print, buf[i]

         if ( done ) then begin
            print, 'All comments read from file.'
         endif else begin
            print, 'Not all comments read from file.'
         endelse

         ;;
         ;; SAFELY close the file.
         ;;
         cspice_dascls, handle

      END

   IDL outputs:

      IDL> dasec_t, 'phobos512.bds'

      *************************************************************************
      MKDSK RUN DATE/TIME: 2010-06-30T16:52:12
      MKDSK SETUP FILE:    phobos512.cmd
      MKDSK INPUT FILE:    phobos_q512.txt
      MKDSK OUTPUT FILE:   phobos512.bds
      OUTPUT FILE STATUS:    NEW FILE
      *************************************************************************

                 \begindata

                 INPUT_SHAPE_FILE    = 'phobos_q512.txt'
                 OUTPUT_DSK_FILE     = 'phobos512.bds'
                 COMMENT_FILE        = ' '
                 LEAPSECONDS_FILE    = 'naif0009.tls'
                 SURFACE_NAME        = 'phobos'
                 CENTER_NAME         = 'phobos'
                 REF_FRAME_NAME      = 'IAU_PHOBOS'
                 START_TIME          = '1950-JAN-1/00:00:00'
                 STOP_TIME           = '2050-JAN-1/00:00:00'
                 DATA_CLASS          = 1
                 INPUT_DATA_UNITS    = ( 'ANGLES    = DEGREES'
                                         'DISTANCES = KILOMETERS' )
                 COORDINATE_SYSTEM   = 'LATITUDINAL'
                 MINIMUM_LATITUDE    = -90
                 MAXIMUM_LATITUDE    =  90
                 MINIMUM_LONGITUDE   = -180
                 MAXIMUM_LONGITUDE   =  180
                 DATA_TYPE           = 2
                 PLATE_TYPE          = 2
                 FINE_VOXEL_SCALE    = 4.0
                 COARSE_VOXEL_SCALE  = 5

                 \begintext

      *************************************************************************
      All comments read from file.

Particulars


   Binary DAS files contain an area which is reserved for storing
   annotations or descriptive textual information describing the data
   contained in a file. This area is referred to as the "comment
   area" of the file. The comment area of a DAS file is a line
   oriented medium for storing textual information. The comment
   area preserves any leading or embedded white space in the line(s)
   of text which are stored, so that the appearance of the
   information will be unchanged when it is retrieved (extracted) at
   some other time. Trailing blanks, however, are NOT preserved,
   due to the way that character strings are represented in
   standard Fortran 77.

   This routine will read the comments from the comment area of
   a binary DAS file, placing them into a line buffer. If the line
   buffer is not large enough to hold the entire comment area,
   the portion read will be returned to the caller, and the done
   flag will be set to SPICEFALSE. This allows the comment area to be
   read in "chunks," a buffer at a time. After all of the comment
   lines have been read, the done flag will be set to SPICETRUE.

   After all of the comments in DAS file have been read, the next
   call to this routine will start reading comments at the start
   of the comment area.

   This routine can be used to "simultaneously" extract comments
   from the comment areas of multiple binary DAS files.

Required Reading


   ICY.REQ
   DAS.REQ

Version


   -Icy Version 1.0.0, 05-JAN-2017, ML (JPL), EDW (JPL)

Index_Entries


   extract comments from a das file



Wed Apr  5 17:57:59 2017