#!/bin/csh -f
#
#   Remember to run script "init" (sioseis-seisnet daemon)
#
#if( $#argv < 2 ) then
#    echo "Usage: stack line-name plot-direction(ltr/rtl)"
#    exit 1
#endif
set LINENO = $1
set DIR = "ltr"
#set DIR = $2

set OUTDIR = "/home/logadmin/output"
set LATEST = "latest_files.tmp"

/home/logadmin/bin/sioseis << eof
procs segddin prout geom wbt gather nmo stack diskoa avenor filter plot end

segddin
   ftr 301 ltr 468
   stack $LATEST
   logpath ./$LINENO-stack.log
   end
end

prout
 fno 0 lno 9999999 ftr 468 ltr 468 noinc 10  end
end

geom
  type 9 # Use realtime GPS
  fs 1 ls 999999  # all shot have the same parameters (preset)
  gxp 468 -250   # RESET the closest group only.
  ggx -12.5         # Used to extrapolate gxp!
# dfls 37.5   # ignored with type 9 
  dbrps 6.25
  rpadd 1000 end
end

wbt
    vel 1500 track .1 end
end

gather
   maxtrs 78  maxrps 480 END
end

nmo
#
addwb yes
vtp 1500 .600 
    1600 1
    2900 6.5
    7000 15.0
    end
end

diskoa   # Write out disk file
  opath $OUTDIR/$LINENO-stack.segy
end end

avenor
  hold 300
  addwb yes sets 0 .5 5 6 end
end


filter
  pass 5 90 ftype 0 dbdrop 48 end
end

plot 
  dir $DIR
  scalar -1
  tlines 0.5 1 nibs 7225 ann gmtint anninc 5 ann2 shotno
  def 0.04 trpin 125 wiggle 0 
  vscale 1.25 clip .03
  opath $OUTDIR/$LINENO-stack.atlantek
  end 
end

end
eof