Script 1 -  read SEG-Y file from the Geometrics over the net

#!/bin/csh -f

if ($* == "") then

  echo "Please specify a line number."

  exit

endif

set LINE=$1

set LOG = `ls -t /Volumes/192.168.10.86-1/HEALY05$LINE*.log  | head -n 1`

set FILE = `ls -t /Volumes/192.168.10.86 | head -n 1`

if (`ls /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE | wc -l` == 0) then

   echo "Creating Directory for line Healy05"$LINE

   mkdir /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE

endif

sioseis << eof

realtime procs diskin diskoa diskoc filter avenor diskob prout end

diskin

   ipath /Volumes/192.168.10.86/$FILE end end

diskoa

    opath /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE/$FILE end end

avenor

   sets 3 6 end

end

diskob

    fno 1 lno 999999 noinc 2 rewind yes

    opath /Users/seismic/Data/MCS/Raw/latest_shot end end

diskoc

    fno 1 lno 999999 noinc 15 rewind yes

    opath /Users/seismic/Data/MCS/Raw/latest_shot-raw end end

prout

    fno 1 lno 99999 ftr 1 ltr 1 end end

end

eof

cp -p /Volumes/192.168.10.86-1/HEALY05$LINE*.log \

   /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE

chmod 444 /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE/*.sgy

 

Script to plot Òlatest_shotÓ on the iMac

>more qc_plot

sioseis << eof

noecho procs diskin prout plot end

diskin

   ftr 1 ltr 16

   ipath /Users/seismic/Data/MCS/Raw/latest_shot end end

agc

   winlen .5 end end

avenor

   sets 3 6 end end

filter

   ftype 0 pass 10 100 dbdrop 48 end end

prout

   fno 0 lno 999999 ftr 1 ltr 1 end end

plot

  nsecs 0 scalar 4.E-07 nibs 2859 srpath sunfil.ras

   ann sh&tr taginc 2 ann2 gmt vscale 1.0 def .1 trpin 20 end

end

eof

open -a /Applications/GraphicConverter/GraphicConverter.app sunfil.ras

 

 

Scripts to read and display data on the Bergen laptops

> more monntr

#!/bin/csh

if (!(-e /Users/seismic/Data/MCS/Plots/near.ras)) then

   echo "There is no raster file to plot.  Contact John or Paul to see what is going on."

   exit

endif

if (-e /Users/seismic/Data/MCS/Plots/neartr/near.lock) then

      echo "Raster is file updating. This can take up to 2 minutes."

      echo "Please be patient..."

endif

while (-e /Users/seismic/Data/MCS/Plots/neartr/near.lock)

   sleep 5

end

echo "Loading image now. It will take about another 20 seconds..."

set i=0

set dpid=999999

while ($i <= 1)

  if (!(-e /Users/seismic/Data/MCS/Plots/near.ras)) then

    echo "Something has gone terribly wrong."

    exit

  endif

  while (-e /Users/seismic/Data/MCS/Plots/neartr/near.lock)

     sleep 5

  end

  cp /Users/seismic/Data/MCS/Plots/near.ras /tmp/near.ras

  set ftime=`stat -f "%m" /Users/seismic/Data/MCS/Plots/shot.ras`

  set nochange=$ftime

  set FSHOT=`awk '{print $1}' /Users/seismic/Data/MCS/Plots/near.info`

  set LSHOT=`awk '{print $2}' /Users/seismic/Data/MCS/Plots/near.info`

  set TRNO=`awk '{print $3}' /Users/seismic/Data/MCS/Plots/near.info`

  echo "Displaying shots "$FSHOT"-"$LSHOT": Channel "$TRNO

  convert -rotate -90 -resize 50% /tmp/near.ras /tmp/near2.ras

  if (`ps -p $dpid | wc -l` != 1) then

     kill -9 $dpid

  endif

  display -title "Channel ${TRNO}: Shots $FSHOT - $LSHOT" -geometry 700x712+312+0!

 /tmp/near2.ras &

  set dpid = $!

  while ($ftime == $nochange)

     sleep 120

     set nochange=`stat -f "%m" /Users/seismic/Data/MCS/Plots/near.ras`

  end

end

exit

 

>more ntr_loop

#!/bin/csh

if ($#argv != 2) then

   echo "usage: ntr_loop LINENO TRNO"

   exit

endif

set i=0

while ($i < 10)

   touch near.lock

   jpltntr $1 $2

   rm near.lock

   sleep 180

end

 

>more jpltntr

#!/bin/csh

if($#argv < 2) then

   echo "usage: pltntr LINENO TRNO"

   exit 1

endif

set LINE=$1

set TRNO = $2

set SEGY=`ls -rt /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE/*.sgy`

set LSGY=`ls -rt /Users/seismic/Data/MCS/Raw/shots/Healy05$LINE/*.sgy |

tail -1`

set LSHOT=`lsd $LSGY | tail -2 | awk '(NR ==1) {print $1}'`

set FSHOT=`expr $LSHOT - 500`

rm sfiles

foreach i($SEGY)

   echo "fno "$FSHOT" lno "$LSHOT >> sfiles

   echo "ipath "$i" end" >> sfiles

end

echo $FSHOT"  "$LSHOT"  "$TRNO > ../near.info

sioseis << eof

procs diskin prout filter agc plot end

diskin

  ftr $TRNO ltr $TRNO

    `cat sfiles`

end

agc

    winlen .5 end end

filter

   ftype 0 pass 10 80 dbdrop 48 end end

prout

   fno 0 lno 999999 ftr $TRNO ltr $TRNO noinc 100 end end

plot

   scalar 1.e-07  dir ltr stime 0.0 nsecs 12 wiggle 0

    ann shotno taginc 15  ann2 gmt nibs 2859 vscale 1.5 tlines 0.5

    def .01  trpin 150 srpath ../near.ras end end

end

eof

#display -rotate 90 -resize 50%  ntrfil.ras

 

>more jqc_loop

#!/bin/csh

set i=0

while ($i < 10)

   touch shot.lock

   jqc_plot 16

   rm shot.lock

   sleep 60

end

 

>more jqc_plot

#!/bin/csh

if ($# != 1) then

  echo "usage: jqc_plot n-channels"

  exit

endif

set NCH=$1

sioseis << eof

noecho procs diskin prout filter avenor plot end

diskin

   ftr 1 ltr $NCH

   ipath /Users/seismic/Data/MCS/Raw/latest_shot end end

prout

    fno 0 lno 9999999 ftr 1 ltr 1 end end

avenor

   sets 3 6 end end

filter

   ftype 0 pass 10 100 dbdrop 48 end end

plot

   nsecs 12 dir ltr scalar 3.E-07 nibs 2859 srpath ../shot.ras

   ann sh&tr taginc 2 ann2 gmt vscale 1.0 def .1 trpin 15 end !465end

end

eof

set SHOT=`lsd /Users/seismic/Data/MCS/Raw/latest_shot | tail -1 | awk '{

print $1}'`

echo $SHOT"  "$NCH > ../s

 

>more monshot

#!/bin/csh

if (!(-e /Users/seismic/Data/MCS/Plots/shot.ras)) then

   echo "There is no raster file to plot.  Contact John or Paul to see what is going on."

   exit

endif

while (-e /Users/seismic/Data/MCS/Plots/shot/shot.lock)

   echo "Raster file updating.  Please be patient..."

   sleep 5

end

echo "Loading image now..."

set dpid=999999

set i=0

while ($i <= 1)

  if (!(-e /Users/seismic/Data/MCS/Plots/shot.ras)) then

    echo "Something has gone terribly wrong."

    exit

  endif

  while (-e /Users/seismic/Data/MCS/Plots/shot/shot.lock)

     sleep 5

  end

  cp /Users/seismic/Data/MCS/Plots/shot.ras /tmp/shot.ras

  set ftime=`stat -f "%m" /Users/seismic/Data/MCS/Plots/shot.ras`

  set nochange=$ftime

  set SHOT=`awk '{print $1}' /Users/seismic/Data/MCS/Plots/shot.info`

  set NCH=`awk '{print $2}' /Users/seismic/Data/MCS/Plots/shot.info`

  echo "Displaying shot "$SHOT", "$NCH" channels"

  convert -rotate -90 -resize 50% /tmp/shot.ras /tmp/shot2.ras

  if (`ps -p $dpid | wc -l` != 1) then

     kill -9 $dpid

  endif

  display -title "Shot ${SHOT}" -geometry 300x712+0+0! /tmp/shot2.ras &

  set dpid = $!

while ($ftime == $nochange)

     sleep 20

     set nochange=`stat -f "%m" /Users/seismic/Data/MCS/Plots/shot.ras`

  end

end

exit

 

Script to generate Knudsen envelope files

#!/bin/csh -f

if( $#argv != 1 ) then

    echo "Usage: mkenv filename (without .sgy suffix)"

    exit 1

endif

set FILE = $1

sioseis << eof

procs diskin header t2f f2t gains header2 prout diskoa end

diskin

  ipath /Volumes/Raw-data/Raw/knudsenraw/$FILE.sgy

  end

end

header

    i120 = i58

    fno 0 lno 9999999 ftr 0 ltr 999 end

end

header2

    i58 = i120

    fno 0 lno 9999999 ftr 0 ltr 999 end

end

prout

   fno 0 lno 999999 noinc 50 end

end

gains

   type 7 end  ! complex modulus

end

t2f

   end

end

f2t

   type analytic end

end

diskoa

   opath /Users/seismic/Data/Chirp/envelope/env-$FILE.sgy  end

end

end

eof

chmod 444 /Users/seismic/Data/Chirp/envelope/env-$FILE.sgy

lsh /Users/seismic/Data/Chirp/envelope/env-$FILE.sgy >> info

#sort +2 -5 info > info-sorted

 

Script to generate Knudsen plot files

#!/bin/csh -f

if( $#argv != 1 ) then

    echo "Usage: mkplt filename (without .sgy suffix)"

    exit 1

endif

rm sunfil.ras

set FILE = $1

sioseis << eof

procs diskin prout agc plot end

diskin

   ntodo 5000

    ipath /Users/seismic/Data/Chirp/envelope/env-$FILE.sgy end

end

prout

    fno 0 lno 9999999 noinc 100 end

end

agc

   winlen .025 center .001 end

end

plot

  nsecs 0 scalar 1.E-07 dptr 1

    colors gray opath siofil wiggle 0  ann gmtint anninc 5 ann2 shotno

    trpin 300 def .01 tlines .05 nibs 2859  vscale 5 end

end

end

eof

sio2sun siofil sunfil.ras

convert -rotate 90 sunfil.ras $FILE.gif

display -rotate 90 sunfil.ras &