Back to SIOSEIS examples
Go to the list of seismic processes.
Go to SIOSEIS introduction.
mkenv
This mkenv is slightly different from other version in that this one
applies a bandpass filter and assumes an input pathname.
#! /bin/bash
# usage: mkenv filename-without-.sgy
# e.g. mkenv 2009_248_2001_LF_054
# Convert a file from correlates to envelope.
#
# Assume input directory is:
# /cygdrive/x/Healy0905/RawData/Knudsen320/
#
# Puts the filtered envelope in sub-directory env/
# Puts a prefix of env- on file and appends a suffix of .sgy
# Note that the envelope is filtered 2x500hz.
#
#
#
if [ "$#" != "1" ]; then
echo "***** mkenv ERROR *****"
echo "Usage: mkenv input-filename"
exit
fi
sioseis << eof
noecho procs diskin header t2f f2t gains header2 filter prout diskoa end
diskin
ipath /cygdrive/x/Healy0905/RawData/Knudsen320/$1.sgy end
end
header
i120 = i58 ! save the original trace length
fno 0 lno 9999999 ftr 0 ltr 999 end
end
header2
i58 = i120 ! restore the original trace length
fno 0 lno 9999999 ftr 0 ltr 999 end
end
prout
# opath /tmp/tmp info 3 ! generate the NGDC "seismic file" meta-data
fno 0 lno 999999 noinc 500 end ! print every 500th trace
end
gains
type 7 end ! complex modulus - make envelope from analytic
end
t2f
end ! number of sample is the next power of two larger than the input
end
f2t
type analytic end ! create the complex trace
end
filter
ftype 0 pass 2 500 dbdrop 48 end
end
diskoa
opath env/env-$1.sgy end
end
end
eof
#cp metadata /tmp/tmp1
#cat /tmp/tmp1 /tmp/tmp > metadata
mkdplt
#!/bin/bash -f
# "Usage: mkdplt filename [SDEPTH EDEPTH]"
# Arguments SDEPTH and EDEPTH are in units of METERS.
# e.g. mkdplt env-2007_171_0706_LF.sgy
# or mkdplt env-2007_171_0706_LF.sgy 1000 4000
#
# make a depth plot. The start depth of each trace changes as the
# deep water delay changes unless optional arguments SDEPTH and
# EDEPTH are given.
#
if [ $# != 1 ]; then
if [ $# != 3 ]; then
echo "Usage: mkdplt filename [SDEPTH EDEPTH]"
exit
fi
fi
rm sunfil.ras
FILE=$1
LINE=" "
if [ $# == 3 ]; then
LINE=" sdepth $2 edepth $3"
fi
rm sunfil.ras
sioseis << eof
procs diskin prout filter mix agc t2d plot end
diskin
ipath env-$FILE.sgy end
end
t2d
$LINE
osi .25 vtp 1500 0 end
end
agc
winlen .01 center .001 end
end
mix
weight 1 1 end
end
filter
ftype 0 pass 2 500 dbdrop 48 end
end
prout
fno 0 lno 9999999 noinc 100 end
end
plot
! scalar 6.E-07
dir ltr dptr 1 tlines .05 .1
colors gray opath siofil wiggle 0 ann gmtint anninc 5 ann2 shotno
trpin 300 def .02 tlines .05 vscale 5 end
end
end
eof
sio2sun siofil sunfil.ras
display -rotate 270 sunfil.ras &
mkdpltxy
#!/bin/bash -f
# "Usage: mkdplt filename [SDEPTH EDEPTH]"
# Arguments SDEPTH and EDEPTH are in units of METERS.
# e.g. mkdpltxy 2007_171_0706_LF
# or mkdpltxy 2007_171_0706_LF 1000 4000
# Note that the "env-" prefix and ".sgy" sufix are supplied by this script
#
# Make a Fledrmaus sd scene file. The start depth of each trace changes as the
# deep water delay changes unless optional arguments SDEPTH and
# EDEPTH are given.
#
if [ $# != 3 ]; then
echo "Usage: mkdplt filename [SDEPTH EDEPTH]"
exit
fi
rm sunfil.ras
FILE=$1
SDEPTH=$2
EDEPTH=$3
LINE=" "
if [ $# != 1 ]; then
LINE=" sdepth $SDEPTH edepth $EDEPTH"
fi
LINE1=" "
rm sunfil.ras
sioseis << eof
procs diskin geom prout mix agc t2d plot end
diskin
ipath env-$FILE.sgy end
end
geom
cknav 100 end
end
t2d
$LINE
osi .25 vtp 1500 0 end
end
agc
winlen .01 center .001 end
end
mix
weight 1 1 end
end
prout
opath tmp.xy
fno 0 lno 999999 ftr 0 ltr 999 trlist sxd syd end
# fno 0 lno 9999999 noinc 100 end
end
plot
scalar 5.E-07
dir ltr dptr 1 trim all
colors gray opath siofil wiggle 0 ann gmtint anninc 5
trpin 300 def .02 tlines 0 0 vscale 5 end
end
end
eof
sio2sun siofil sunfil.ras
convert -rotate 270 -trim -depth 8 sunfil.ras env-$FILE.tiff
display env-$FILE.tiff &
cat tmp.xy | cvtgeo -q polar/-160,75,0,0 > env-$FILE.xy
cmdop mkvcurtain -in env-$FILE.tiff -out env-$FILE.sd -xy env-$FILE.xy -mode simple -zrange -$EDEPTH -$SDEPTH
cp env-$FILE.sd /cygdrive/x/Healy0905/Processing/Subbottom/
cp env-$FILE.xy /cygdrive/x/Healy0905/Processing/Subbottom/
cp env-$FILE.tiff /cygdrive/x/Healy0905/Processing/Subbottom/
cp env-$FILE.sgy /cygdrive/x/Healy0905/Processing/Subbottom/
mkdpltg
#!/bin/bash -f
# "Usage: mkdpltg filename [SDEPTH EDEPTH]"
# Arguments SDEPTH and EDEPTH are in units of METERS.
# e.g. mkdpltg 2007_171_0706_LF
# or mkdpltg 2007_171_0706_LF 1000 4000
# Note that the "env-" prefix and ".sgy" sufix are supplied by this script
#
# Make a depth plot using an exponential gain hung from the water bottom.
# Process geom discards lat/long that are too far from the previous ping.
# Write to an x/y file of long/lat for each ping.
# Thus process wbt converts Knudsen depths in header word 16 to two way time.
# Process avenor equalizes (balances) traces based on amplitudes around the
# water bottom.
# Process mute zeroes the trace up to 2 mils beforr the water bottom.
# Process smute zeroes the trace from .25sec after the water bottom to the end.
# Process mix does a running average of two traces.
# Process gains applies an exponential gain from the water bottom.
# Process t2d converts time to depth.
# Process plot creates a SIO/Versatec raster plot file without annotation.
# Program sio2sun converts the SIO raster file to a Sun raster file.
# Program convert reformats, rotates, and further trims the SUn raster file
# into a TIFF file.
# Progarm cvtgeo converts lat/longs into polar stereo coordinates.
# mkvcurkain combines the TIFF file with the XY file to create a Fledermaus
# sd scene file.
#
# The start depth of each trace changes as the
# deep water delay changes unless optional arguments SDEPTH and
# EDEPTH are given.
#
if [ $# != 1 ]; then
if [ $# != 3 ]; then
echo "Usage: mkdplt filename [SDEPTH EDEPTH]"
exit
fi
fi
FILE=$1
LINE=" "
if [ $# != 1 ]; then
LINE=" sdepth $2 edepth $3"
fi
SDEPTH=$2
EDEPTH=$3
rm sunfil.ras
sioseis << eof
noecho procs diskin geom prout wbt filter avenor mute smute mix gains t2d plot e
nd
diskin
ipath env-$FILE.sgy end
end
geom
cknav 150 end # watch out for fast ship and deep
end
mute
addwb yes ttp 1 -.002 end # hung from the water bottom
end
smute
fno 0 lno 999999 addwb yes ttp 1 .25 end # hung from the water bottom
end
t2d
$LINE
osi .25 vtp 1500 0 end
end
gains
subwb yes type 5 alpha 8 end # hung from the water bottom
end
avenor
sets 0 .1 addwb yes end # 100 mils, hung from the water bottom
end
wbt
track .04 vel 1500 end # don't allow depth more than 40 mils (30 meters)
end
mix
weight 1 1 end
end
filter
ftype 0 pass 2 500 dbdrop 48 end
end
prout
opath tmp.xy
fno 0 lno 999999 ftr 0 ltr 999 trlist sxd syd end
end
plot
# scalar 3.0E-07
scalar 7.E-07
dir ltr dptr 1 tlines .05 .1
colors gray opath siofil wiggle 0 ann gmtint anninc 5
trpin 300 def .02 tlines .05 vscale 5 end
end
end
eof
sio2sun siofil sunfil.ras
convert -rotate 270 -trim -depth 8 sunfil.ras env-$FILE.tiff
display env-$FILE.tiff &
cat tmp.xy | cvtgeo -q polar/-160,75,0,0 > env-$FILE.xy
cmdop mkvcurtain -in env-$FILE.tiff -out env-$FILE.sd -xy env-$FILE.xy -mode simple -zrange -$EDEPTH -$SDEPTH
Tommy's bash script to do all
#!/bin/bash
#
# This is a bash shell script for batch processing seismic data files.
# It takes a comma seperated value text file with multiple entires of
# file names, start depths, end depths and passes these arguments to
# another shell script (mkgains) that conducts the seismic processing
# and produces a plot file that is then stored away. See mkgains
#
# How the CSV file is generated is up to the user, but generally it is the
# output from a MS Excel file.
#
# ./fnames is the CSV text file. Modify the name to suit your needs
#
cat ./fnames | while IFS=, read fname sdepth endepth
do
echo $fname".sgy" $sdepth $endepth
mkgains $fname".sgy" $sdepth $endepth
done
Paul's script to do no gain or agc
#!/bin/bash -f
# "Usage: mkdplt filename [SDEPTH EDEPTH]"
# Arguments SDEPTH and EDEPTH are in units of METERS.
# e.g. mkdplt env-2007_171_0706_LF.sgy
# or mkdplt env-2007_171_0706_LF.sgy 1000 4000
#
# Make a depth plot with no gain or agc - the same as MarSurfer
# Process mix does a running average of two traces.
# Process t2d converts time to depth.
# Process plot creates a SIO/Versatec raster plot file without annotation.
# Program sio2sun converts the SIO raster file to a Sun raster file.
#
# The start depth of each trace changes as the
# deep water delay changes unless optional arguments SDEPTH and
# EDEPTH are given.
#
if [ $# != 1 ]; then
if [ $# != 3 ]; then
echo "Usage: mkdplt filename [SDEPTH EDEPTH]"
exit
fi
fi
FILE=$1
LINE=" "
if [ $# != 1 ]; then
LINE=" sdepth $2 edepth $3"
fi
rm sunfil.ras
sioseis << eof
procs diskin prout filter mix t2d plot end
diskin
ipath env-$FILE.sgy end
end
t2d
$LINE
osi .25 vtp 1500 0 end
end
mix
weight 1 1 end
end
filter
ftype 0 pass 2 500 dbdrop 48 end
end
prout
opath tmp.xy
fno 0 lno 999999 ftr 0 ltr 999 trlist sxd syd end
end
plot
! scalar 5.0E-07
scalar 4.E-06
dir ltr dptr 1 tlines .05
colors gray opath siofil wiggle 0 ann gmtint anninc 5
trpin 300 def .01 tlines .05 vscale 5 end
end
end
eof
sio2sun siofil sunfil.ras
display -rotate 270 sunfil.ras &
Back to SIOSEIS examples
Go to the list of seismic processes.
Go to SIOSEIS introduction.