fdds_read - read DDS binary data


SYNOPSIS

#include <fdds.h> (fixed-format sources)
#include <f90dds.h> (free-format sources)

integer function fdds_read(bin, tag, buf, count)

integer bin
integer tag
integer buf(*)
integer count

DESCRIPTION

This function reads data from a binary stream, into a buffer.

INPUT

bin is a binary tag, previously obtained from fdds_open. It specifies a particular binary stream.

tag is a field tag, previously obtained, for example, from fdds_member. It specifies a tag associated with bin. This provides a scale factor for count. If tag is zero (nominal), it defaults to the SEQUENCE (trace type) associated with bin.

Data is read into buf. The minimum size is count times the size of tag.

OUTPUT

A byte sequence from the stream is copied into the buffer no conversions are performed. The return value is the number of types actually read, or EOF if an error occurred before any transfer.

EXAMPLES

In fixed-format Fortran:
      #include <fdds.h>
      integer in_bin
      integer buf(*)
      ...
!     read 10 traces into type buffer
      j = fdds_read(in_bin, 0, buf, 10)
    

In free-format F90:

      #include <f90dds.h>
      integer in_bin
      integer buf(*)
      ...
!     read 10 traces into type buffer
      j = fdds_read(in_bin, 0, buf, 10)
    

Using the DDS module:
(Note that the DDS module requires that data arrays passed to I/O functions be 1 dimensional.)

      use dds
      
      integer :: in_bin, nsmp, ntrc, itrc
      real, allocatable :: buffer(:,:)
      
      allocate(buffer(nsmp, ntrc))
      ! read 10 traces into buffer
      do itrc=1,10
        ier = fdds_read(in_bin, 0, buffer(:,itrc), 1)
      enddo
    

SEE ALSO

fdds_readm Read & map
fdds_write Write data
fdds_writem Map & write
    

AUTHOR

R. L. Selzler, EPTG (May, 1994)