#!/bin/sh #set -x #CWPROOT=/prog1/SeismicUnix; export CWPROOT # on pandora CWPROOT=/usr/local/SU; export CWPROOT PATH=$CWPROOT/bin:$PATH; export PATH # This script will read the tape image files (*.tif) from disk and write # data in SEG-Y format to a tape. # The files are supposed to be named: 1.tif, 2.tif, 3.tif ... # # A file named ascii.header, which is used as the ebcdic header on the # segy tape, must exist in the current directory. It may be edited # according to your needs (the lines cannot be more than 80 characters # long and the number of lines must be exactly 40). dir=p11 # set directory where tif files are stored #first=102 # set first file number #last=111 # set last file number #first=112 #last=121 first=122 last=126 tape=/dev/nst0 # set tape device to use ns=6144 # set number of samples per trace dt=2000 # set sample inverval (microseconds) ######################################################################## # Generate header files used by segywrite segyhdrs ns=$ns dt=$dt bfile=binary hfile=/dev/null /bin/cp ascii.header header mt -f $tape setblk 0 mt -f $tape rewind # Generate a list of file names filenr=$first filelist="$dir/$filenr.tif" while [ $filenr -lt $last ]; do filenr=`expr $filenr + 1` filelist="$filelist $dir/$filenr.tif" done echo List of files: echo $filelist # Make a fifo node to be used by tifread (avoid use of temporary files) /bin/rm -f fifo_node mkfifo fifo_node sleep 5 # Send data to the fifo node cat $filelist > fifo_node & sleep 5 # Read tif file, convert from SEG-D, and write SEG-Y to tape echo Start writing tape... ./tifread fifo_node | \ segdread tape=- use_stdio=1 ns=$ns | \ segywrite tape=$tape verbose=1 vblock=240 endian=0 mt -f $tape eof 3 echo Rewinding tape... mt -f $tape rewind /bin/rm -f fifo_node echo "Done!" exit