SEGYREAD - read an SEG-Y tape                            

   segyread > stdout tape=                                 

   or                                                

   SEG-Y data stream ... | segyread tape=-  > stdout             

 Required parameter:                                       
 tape=            input tape device or seg-y filename (see notes)      

 Optional parameters:                                      
 buff=1     for buffered device (9-track reel tape drive)        
            =0 possibly useful for 8mm EXABYTE drives      
 verbose=0  silent operation                         
            =1 ; echo every 'vblock' traces                      
 vblock=50  echo every 'vblock' traces under verbose option      
 hfile=header     file to store ebcdic block (as ascii)                
 bfile=binary     file to store binary block                     
 over=0     quit if bhed format not equal 1, 2, or 3       
            = 1 ; override and attempt conversion                
 format=bh.format if over=1 try to convert assuming format value 
 conv=1     convert data to native format                  
                  = 0 ; assume data is in native format          
 ns=bh.hns  number of samples (use if bhed ns wrong)       
 trmin=1          first trace to read                      
 trmax=INT_MAX    last trace to read                             
 endian=1   set =0 for little-endian machines(PC's,DEC,etc.)     
 errmax=0   allowable number of consecutive tape IO errors       

 Notes:                                              
 Traditionally tape=/dev/rmt0.      However, in the modern world tape device
 names are much less uniform.  The magic name can often be deduced by  
 "ls /dev".  Likely man pages with the names of the tape devices are:
 "mt", "sd" "st".  Also try "man -k scsi", " man mt", etc. 
 Sometimes "mt status" will tell the device name.                

 For a SEG-Y diskfile use tape=filename.                   

 Remark: a SEG-Y file is not the same as an su file. A SEG-Y file
 consists of three parts: an ebcdic header, a binary reel header, and  
 the traces.  The traces are (usually) in 32 bit IBM floating point    
 format.  An SU file consists only of the trace portion written in the
 native binary floats.                                     

 Formats supported:                                        
 1: ibm floating point, 2: ibm fixed point, 4 byte,              
 3: ibm fixed point,  2 byte                               

 tape=-   read from standard input. Caveat, under Solaris, you will    
 need to use the buff=1 option, as well.                   

        type:       sudoc segyread   for further information           



 Note:
      If you have a tape with multiple sequences of ebcdic header,
      binary header,traces, use the device that
      invokes the no-rewind option and issue multiple segyread
      commands (making an appropriate shell script if you
      want to save all the headers).      Consider using >> if
      you want a single trace file in the end.  Similar
      considerations apply for multiple reels of tapes,
      but use the standard rewind on end of file.
                                   
 Note: For buff=1 (default) tape is accessed with 'read', for buff=0
      tape is accessed with fread. We suggest that you try buff=1
      even with EXABYTE tapes.                       
 Caveat: may be slow on an 8mm streaming (EXABYTE) tapedrive
 Warning: segyread or segywrite to 8mm tape is fragile. Allow sufficient
      time between successive reads and writes.
 Warning: may return the error message "efclose: fclose failed"
      intermittently when segyreading/segywriting to 8mm (EXABYTE) tape
      even if actual segyread/segywrite is successful. However, this
      error message may be returned if your tape drive has a fixed
      block size set.
 Caution: When reading or writing SEG-Y tapes, the tape
      drive should be set to be able to read variable block length
      tape files.


 Credits:
      SEP: Einar Kjartansson
      CWP: Jack K. Cohen, Brian Sumner, Chris Liner
         : John Stockwell (added 8mm tape stuff)
 conv parameter added by:
      Tony Kocurko
      Department of Earth Sciences
      Memorial University of Newfoundland
      St. John's, Newfoundland
 read from stdin via tape=-  added by     Tony Kocurko
 bhed format = 2,3 conversion by:
      Remco Romijn (Applied Geophysics, TU Delft)
      J.W. de Bruijn (Applied Geophysics, TU Delft)
--------------------------
 Additional Notes:
      Brian's subroutine, ibm_to_float, which converts IBM floating
      point to IEEE floating point is NOT portable and must be
      altered for non-IEEE machines.      See the subroutine notes below.

      A direct read by dd would suck up the entire tape; hence the
      dancing around with buffers and files.