BOFF

Some programs need a header value for the shot to receiver offset. This program computes that offset in case it is not in the headers, and then inserts the value in the header of the output file, boff****.seg. The only command line argument is the input file name. If the offset BSEGY header value has not been set, it will contain garbage. In the following example, we look at the first trace offset (74 m) in a test file. The commands are:
#!/bin/bash
# adds offset to a header value
# This header is not really needed for BSU programs,
# but is useful when converting to Seismic Unix codes
# that require it.
echo " PC linux is little endian"
echo "offset is 4 byte integer in header at hex bytes 0x24 0x25 0x26 0x27"
hexdump -C k007.seg |grep 00000020
echo "00000020               |  |  |  |  "
echo "hexdump k007.seg: starting at hexbyte 0x20, List shows 45 00 00 00"
echo "this is garbage"
# BOFF computes offset header, for trace 1 this is 74 meters
boff k007.seg >/dev/null
hexdump -C boffk007.seg |grep 00000020
echo "00000020               |  |  |  |  "
echo "hexdump boffk007.seg: shows 4a 00 00 00 "
echo "garbage replaced with 0x4a = 74, correct value  "
The output when run is:
 PC linux is little endian
offset is 4 byte integer in header at hex bytes 0x24 0x25 0x26 0x27
00000020  00 00 01 00 45 00 00 00  61 90 01 00 ff 85 01 00  |....E...a.......|
00000020               |  |  |  |  
hexdump k007.seg: starting at hexbyte 0x20, List shows 45 00 00 00
this is garbage
00000020  00 00 01 00 4a 00 00 00  61 90 01 00 ff 85 01 00  |....J...a.......|
00000020               |  |  |  |  
hexdump boffk007.seg: shows 4a 00 00 00 
garbage replaced with 0x4a = 74, correct value