#! /bin/bash if [ "$#" != "2" ]; then if [ "$#" != "3" ]; then echo "***** env2depth ERROR *****" echo "Usage: env2depth input-pathname output-pathname [END-DEPTH]" exit fi fi if [ "$1" == "$2" ]; then echo "***** env2depth ERROR *****" echo "Do not use the same directory for output as input (it causes a loop)." exit fi declare OSI edepth let OSI=1 edepth=16000 dir_in="$1" dir_out="$2" LINE=" " if [ "$#" == "3" ]; then LINE=" sdepth 0 edepth $3" edepth=$3 fi if [ $edepth -lt 8192 ]; then OSI=.5 fi if [ $edepth -lt 4096 ]; then OSI=.25 fi if [ $edepth -lt 2048 ]; then OSI=.125 fi cd "$dir_in" for x in *sgy ; do extension=${x##*.} if [ $extension = sgy ]; then echo "reading file: $dir_in/$x" echo "writing file: $dir_out/depth-$x" cd "-" sioseis << eof procs diskin filter wbt avenor mix gains2 t2d header3 diskoa end diskin ipath $dir_in/$x end end prout fno 0 lno 999999 noinc 1000 end ! print every 500th trace end filter ftype 0 pass 2 500 dbdrop 48 end end t2d $LINE osi $OSI vtp 1500 0 end end gains2 subwb yes type 5 alpha 5 end end avenor sets 0 .1 addwb yes end end wbt vel 1500 end end mix weight 1 1 end end header3 c30 'SIOSEIS processing step 1: convert correlates to envelope.' c31 'step 2: procs diskin filter wbt avenor mix gains2 t2d header3 diskoa' c32 ' filter ftype 0 pass 2 500 dbdrop 48 end' c33 ' wbt vel 1500 end # convert water depth to time' c34 ' avenor sets 0 .1 addwb yes end' c35 ' mix weight 1 1 end' c36 ' gains2 subwb yes type 5 alpha 5 end # exponential gain from wb' c37 'Notes: ' c38 '1) The data sample interval is $OSI kilometers, thus other seismic' c39 ' packages should treat it like time.' c40 '2) The deep water delay has been removed - all data start at zero.' end end diskoa opath $dir_out/depth-$x end end end eof chmod 444 $dir_out/depth-$x cd "-" fi doneGo to the list of seismic processes. Go to SIOSEIS introduction. Go to SIOSEIS examples Go back to SIOSEIS Knudsen scripts