# This script converts all SEG-Y files (.sgy) in the directory it is run from to Seismic Unix (.su) format. Two navigation text files are produced from each SEG-Y file: one containing navigation and time information # stripped from the SEG-Y header (for all traces) and one that contains the same information, but for only every 100 traces. #! /bin/csh foreach file (*.sgy) # read SEG-Y standard file and convert to SU native format echo " " echo "Read SEG-Y file and output SU native format..." echo " " # set endian=0 for Intel and DEC, set endian=1 for Sun, SGI... segyread tape=$file:r:t.sgy verbose=1 vblock=1000 conv=1 endian=0 | \ segyclean > $file:r:t.su # extract SEG-Y trace header values (ffid, source x, source y, year, # julian day, hour, minute, second, source depth, source elevation) # echo " " # echo "Extracting SEG-Y trace header words... (ffid, source X, source Y, year, julian day, hour, minute, seconds)" # echo " " sugethw key=fldr,sx,sy,year,day,hour,minute,sec output=ascii < $file:r:t.su | \ grep fldr | sed 's/=/ /g' | sed 's/ //g' | \ awk '{FS=" "} {OFS=" "} {printf "%6s%7s\t%5s\t%6s\t%9.6f\t%9.6f\t%4s\t%3s:%2s:%2s:%2s\n", \ $4,$6,line,$2,$4/360000,$6/360000,$8,$10,$12,$14,$16} ' line=$file:r:t - > ../nav/$file:r:t.temp.txt sort -b -g -um -k 1,2 ../nav/$file:r:t.temp.txt | cut -f2-7 > ../nav/$file:r:t.nav rm ../nav/$file:r:t.temp.txt sugethw key=fldr,sx,sy,year,day,hour,minute,sec output=ascii < $file:r:t.su | \ grep fldr | sed 's/=/ /g' | sed 's/ //g' | \ awk '{FS=" "} {OFS=" "} {printf "%5s %6s %9.6f %9.6f %4s %3s:%2s:%2s:%2s\n", \ line,$2,$4/360000,$6/360000,$8,$10,$12,$14,$16} ' line=$file:r:t - > ../nav/$file:r:t.temp.txt awk '{if(!($2 % 100)) print;}' ../nav/$file:r:t.temp.txt > ../nav/S$file:r:t_100.nav rm ../nav/$file:r:t.temp.txt echo " " echo "Writing shot navigation files to nav directory..." echo " " end