#!/bin/csh -f # # dat2segy converts every ODEC file in the given directory # into a SEGY file and creates file info with info # about the file such as: # y0428-08.segy Begins: day118 05:07:13 Ends: day118 13:26:47 # data times: 0.990 to 3.351 secs. # # e.g. # dat2segy . # # converts all the files *.dat in the current working directory # if( $#argv != 1 ) then echo "Usage: dat2segy DIR" exit 1 endif set DIR = $1 set FILES = `pushd $DIR > /dev/null;ls -1 y*.dat;popd > /dev/null` touch info foreach i($FILES) echo $i > /tmp/1 sed 's^dat^segy^;w!' /tmp/1 > /tmp/2 set OFILE = `cat /tmp/2` sioseis << eof procs diskin diskoa END diskin ipath $DIR/$i format odec END END diskoa opath $DIR/$OFILE END END END eof lsh $DIR/$OFILE >> info endScript pltbathy
#!/bin/csh -f # # Usage: pltbathy file (without the .segy suffix) start-gmt end-gmt # start-twt nsecs # # e.g. # pltbathy y0428-08 0510 0530 .9 3. # # Read a SEGY file using a start and end GMT. Plot the data from a # start two-way-travel-time to an end two-way-travel-time. # The plot is saved as a PNG file so Photoshop and other programs # can read it. The output file is: FILE.png # if( $#argv != 5 ) then echo "Usage: odec FILE start-gmt end-gmt start-twt nsecs" exit 1 endif set FILE = $1 set FGMT = $2 set LGMT = $3 set STIME = $4 set NSECS = $5 rm siofil sunfil.ras sioseis << eof procs diskin prout agc plot end diskin fgmt $FGMT lgmt $LGMT ipath $FILE.segy end end prout fno 1 lno 9999999 ftr 1 ltr 1 noinc 500 end end agc winlen .25 end end plot stime $STIME nsecs $NSECS dir ltr nibs 2859 vscale 2.5 colors gray tlines .1 ann gmtint taginc 5 dptr 1 trpin 300 def .1 opath siofil end end end eof sio2sun siofil sunfil.ras convert -rotate -90 sunfil.ras $FILE.png display $FILE.png rm siofil sunfil.ras