Procedure To Insert Navigation Into SEG-Y Trace Headers

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

PROCEDURE TO INSERT NAVIGATION INTO SEG-Y TRACE HEADERS NAVIGATION DATA FORMAT FILE ASCII

SP 1 10 20 30 40 50 60 70 80 90 100 110 120 125

X (meters) 724823 724033 723175 722280 721401 720521 719640 718761 717874 717022 716145 715260 714383 713946

Y (meters) 63121 63839 64651 65445 66261 67079 67887 68719 69539 70381 71195 72008 72814 73218

The navigation file name should start with the SEG-Y line name. For example, seismic line 420a_SP_000_126.sgy will have a navigation file (above) called 420a_SP_000_126.navigation.dat

BASH SCRIPT TO INSERT NAVIGATION INTO SEG-Y TRACE HEADERS


#!/bin/bash ### set -x LINE= ### Check program options. while [ X"$1" != X-- ] do case "$1" in -s) LINE="$2" shift 2 ;; -debug) echo "DEBUG ON" set -x DEBUG="yes" trap '' SIGHUP SIGINT SIGQUIT SIGTERM shift 1 ;; -*) echo "${program}: Invalid parameter $1: ignored." 1>&2 shift ;; *) set -- -- $@ ;; esac done shift # remove -- of arguments if [ -z "${LINE}" ] ; then echo "Have to input SEG-Y file name (-s) parameter -> exiting" exit fi

echo "Working on SEG-Y file = ${LINE}" FNAME=`echo ${LINE} | awk -F".sgy" '{print $1}'` SP_FIRST=`head -1 ${FNAME}.navigation.dat | awk '{print $1}'` SP_LAST=`tail -1 ${FNAME}.navigation.dat | awk '{print $1}'` rm -f stuff?.su segyread tape=${LINE} endian=0 | segyclean | suwind key=ep min=${SP_FIRST} max=${SP_LAST} > stuff.su insert_navigation_in_headers < stuff.su fnav=${FNAME}.navigation.dat verbose=1 > stuff1.su suximage < stuff1.su perc=99 title="${FNAME}.fixed.sgy" & sugethw < stuff1.su output=geom key=tracl,ep,cdp,sx,sy segyhdrs < stuff1.su segywrite < stuff1.su tape=${FNAME}.fixed.sgy endian=0

In this case the script is called insert.nav.sh, which uses a program called insert_navigation_in_headers (must be in your path). To execute the script on line 420a, type: ./insert.nav.sh -s 420a_SP_000_126.sgy The script will insert the X and Y navigation values into the SEG-Y trace headers by matching the SP traceheader word (shotpoint) and output a SEG-Y file called 420a_SP_000_126.fixed.sgy. This output file can be loaded into your interpretation system.

Figure 1 Location of fixed seismic line 420a, which is SW of Petapahan oil field.

Figure 2 Seismic line 420a, with fixed trace-header navigation, showing TWT structure SW of Petapahan oil field.

C-PROGRAM TO INSERT NAVIGATION INTO THE SEG-Y TRACE HEADERS (SEISMIC UNIX FORMAT) INSERT_NAVIGATION_IN_HEADERS.C
#include #include #include #include #include #include #include <limits.h> <stdio.h> "par.h" "su.h" "cwp.h" "segy.h" "header.h"

char *sdoc[] = {NULL}; segy tr; int main (int argc, char **argv) { char *fnav, temp[256]; FILE *ifn; int ntr, kount, sp, x, y; float delta_sp, rsp, rx, ry; float *sp_array, *x_array, *y_array; short verbose; register int i; initargs(argc, argv); requestdoc(1); if (!getparstring("fnav", &fnav)) { fprintf ( stderr, "Must supply Navigation ASCII file name (SP, X, Y) --> exiting\n" ); return EXIT_FAILURE; } if (!getparshort("verbose", &verbose)) verbose = 0; ifn = efopen (fnav, "r"); sp_array = ealloc1float ( 1000 ); x_array = ealloc1float ( 1000 ); y_array = ealloc1float ( 1000 ); kount = 0;

if ( verbose ) fprintf (stderr,"\n"); while (NULL != fgets ( temp, sizeof(temp), ifn )) { (void) sscanf ( ((&(temp[0]))), "%d%d%d", &sp, &x, &y ); sp_array[kount] = sp; x_array[kount] = x; y_array[kount] = y; if ( verbose ) fprintf ( stderr, "SP = %6d, X = %6d, Y = %6d\n", sp, x, y ); ++kount; } efclose (ifn ); /* Get info from first trace */ ntr = gettra (&tr, 0); delta_sp = ( sp_array[kount-1] - sp_array[0] + 1 ) / ntr; if ( verbose fprintf ( fprintf ( fprintf ( fprintf ( fprintf ( } ) { stderr, stderr, stderr, stderr, stderr, "\n" ); "Navigation ASCII file name (SP, X, Y) = %s\n", fnav ); "Number of navigation values read = %d\n", kount+1 ); "Delta spacing between shotpoints = %f\n", delta_sp ); "\n" );

rewind (stdin); /* Main loop over traces */ for ( i = 0; i < ntr; ++i ) { gettr (&tr); rsp = sp_array[0] + ( i * delta_sp ); intlin ( kount, sp_array, x_array, x_array[0], x_array[kount-1], 1, &rsp, &rx ); intlin ( kount, sp_array, y_array, y_array[0], y_array[kount-1], 1, &rsp, &ry ); tr.sx = tr.gx = rx; tr.sy = tr.gy = ry; tr.cdp = i + 1; puttr (&tr); } free1float (sp_array); free1float (x_array); free1float (y_array); return EXIT_SUCCESS; }

MAKEFILE TO COMPILE THE ABOVE C-PROGRAM (ASSUMES SEISMIC UNIX IS INSTALLED)


include $(CWPROOT)/src/Makefile.config D = $L/libcwp.a $L/libpar.a $L/libsu.a LFLAGS= -I/usr/include -L$L -lsu -lpar -lcwp -lm PROGS = \ $B/insert_navigation_in_headers

INSTALL : $(PROGS) touch $@ $(PROGS): $(CTARGET) $D -$(CC) $(CFLAGS) $(@F).c $(LFLAGS) -o $@ @chmod 755 $@ @echo $(@F) installed in $B remake : -touch *.c -rm -f $(PROGS) $(MAKE) clean: rm -f a.out junk* JUNK* core

You might also like