Setting Geometry SEG-2 Data: Example 1 [bnez-> gensetg-> egg2seg-> setgeom]

This example is for data recorded in SEG-2 format. If you wish to follow along, this sample is for a data set, recorded on an EGG Geometrics seismograph. Those data and scripts below can be downloaded from the SEGY-Data archive:

Go to https://cgiss.boisestate.edu/ pm/BSU
Check the BSU Campus check box and then submit button. The data are downloaded as archive ID-100.zip. Unzip the archive and go to Example 1. We begin with the program bnez.


{bnezrun}
#!/bin/bash
# Script gofirst
bnez 000001.nez 13 2 1 0 0 0 01 0 0 0 1
mv bnez.lst bnezshots.lst
bnez 000002.nez 30 1 14 0 0 0 01 0 1 0 1
mv bnez.lst bnezphones.lst
mv 000001.nez LAB001.nez
cat 000002.nez >>LAB001.nez
rm 000002.nez
bnezrun



The first command, bnez, automates the generation of source positions for an NEZ survey file (Northing=Y, Easting=X, Elevation=Z). Here is the online help when you type bnez -h


{bnezhelp}
bnez  outfile  n-points tag so yo xo zo ido dy dx dz did 
 
     outfile  = output file name (ex. aaaa0001.nez
 
     n-points = number of survey points to generate 
     tag      = 1 tag=VP
              = 2 tag=SP
     so       = first value of sequence number 
     yo       = northing of first point 
     xo       = easting of first point  
     zo       = elevation of first point 
     ido      = initial ID number        
     dy       = spacing between points in north direction 
     dx       = spacing between points in east direction  
     dz       = spacing in elevation between points  
     did      = interval in ID between points
bnezhelp



The contents of the file, 000001.nez, contains 5 columns, [ID,Y,X,Z,Tag] and is as follows:

          1    0.000000    0.000000    0.000000 SP001
          2    0.000000    0.000000    0.000000 SP002
          3    0.000000    0.000000    0.000000 SP003
          4    0.000000    0.000000    0.000000 SP004
          5    0.000000    0.000000    0.000000 SP005
          6    0.000000    0.000000    0.000000 SP006
          7    0.000000    0.000000    0.000000 SP007
          8    0.000000    0.000000    0.000000 SP008
          9    0.000000    0.000000    0.000000 SP009
         10    0.000000    0.000000    0.000000 SP010
         11    0.000000    0.000000    0.000000 SP011
         12    0.000000    0.000000    0.000000 SP012
         13    0.000000    0.000000    0.000000 SP013

One generates a second file for the geophone locations, 000002.nez, and then the two NEZ files are concatenated into a merged file LAB001.nez. Note the source did not move for all 13 shot record efforts. The second bnez command produces file 000002.nez shown below:

         14    0.000000    0.000000    0.000000 VP001
         15    0.000000    1.000000    0.000000 VP002
         16    0.000000    2.000000    0.000000 VP003
         17    0.000000    3.000000    0.000000 VP004
         18    0.000000    4.000000    0.000000 VP005
         19    0.000000    5.000000    0.000000 VP006
         20    0.000000    6.000000    0.000000 VP007
         21    0.000000    7.000000    0.000000 VP008
         22    0.000000    8.000000    0.000000 VP009
         23    0.000000    9.000000    0.000000 VP010
         24    0.000000   10.000000    0.000000 VP011
         25    0.000000   11.000000    0.000000 VP012
         26    0.000000   12.000000    0.000000 VP013
         27    0.000000   13.000000    0.000000 VP014
         28    0.000000   14.000000    0.000000 VP015
         29    0.000000   15.000000    0.000000 VP016
         30    0.000000   16.000000    0.000000 VP017
         31    0.000000   17.000000    0.000000 VP018
         32    0.000000   18.000000    0.000000 VP019
         33    0.000000   19.000000    0.000000 VP020
         34    0.000000   20.000000    0.000000 VP021
         35    0.000000   21.000000    0.000000 VP022
         36    0.000000   22.000000    0.000000 VP023
         37    0.000000   23.000000    0.000000 VP024
         38    0.000000   24.000000    0.000000 VP025
         39    0.000000   25.000000    0.000000 VP026
         40    0.000000   26.000000    0.000000 VP027
         41    0.000000   27.000000    0.000000 VP028
         42    0.000000   28.000000    0.000000 VP029
         43    0.000000   29.000000    0.000000 VP030

Once the merged NEZ file has been created, we can then run program gensetg. This is an interactive program, and the following is a log of the execution captured from the terminal:

 $ gensetg
 |----------------------------------------|
 | Copyright (C) 2009 P. Michaels         |
 |       All rights reserved              |
 | See GNU General Public License         |
 |----------------------------------------|
 gset:  TIME: 15:44:00 DATE: 29/Dec/2016 
SHOTS: ---------------------------
 Enter first shot file NAME number 
1001
 Enter last shot file NAME number 
1013
 Enter first SP label NUMBER  
01
 Enter increment for SP label NUMBER 
1
PHONES: ---------------------------
 Enter number of BLOCKS to define channels 
1
BLOCK Number------- 1
Channels (1) through (?) 
 Enter last channel for this block 
30
 Enter first label VP NUMBER for this block
01
 Enter label VP increment for this block
1

The result of gensetg is the creation of 2 files, shots.txt, which relates the data sets to the shot locations, and phones.txt, which relates the channel to VP location in the NEZ file.

File shots.txt is as follows:

1001.seg  SP001
1002.seg  SP002
1003.seg  SP003
1004.seg  SP004
1005.seg  SP005
1006.seg  SP006
1007.seg  SP007
1008.seg  SP008
1009.seg  SP009
1010.seg  SP010
1011.seg  SP011
1012.seg  SP012
1013.seg  SP013

File phones.txt is as follows:

01  VP001
02  VP002
03  VP003
04  VP004
05  VP005
06  VP006
07  VP007
08  VP008
09  VP009
10  VP010
11  VP011
12  VP012
13  VP013
14  VP014
15  VP015
16  VP016
17  VP017
18  VP018
19  VP019
20  VP020
21  VP021
22  VP022
23  VP023
24  VP024
25  VP025
26  VP026
27  VP027
28  VP028
29  VP029
30  VP030

We conclude by transferring the geometry to the seismic traces. The following script is used in this case:


{bnezrun}
#!/bin/bash

if ! [ -e LAB001.nez ]
then
echo "LAB001.nez missing, run gofirst"
else
  if ! [ -e shots.txt ]
  then
  echo "shots.txt missing, run gosecond (gensetg)"
  else
    if ! [ -e phones.txt ]
    then 
    echo "phones.txt missing, run gosecond (gensetg)"
    else
# convert SEG2 files to BSEGY (*.seg), headers not final
FILES=`ls -1 *.DAT |sort `
for f in $FILES; do
egg2seg $f;
done
rm *.lst

# apply correct geometry to *.seg files created above
setgeom shots.txt phones.txt LAB001.nez

#rename files (like setg1001.seg to 1001.seg)
for f in $FILES; do
NAME=`basename $f .DAT`
mv setg${NAME}.seg ${NAME}.seg
done 

fi
  fi
    fi
bnezrun



The after checking for needed files, the bash script loops through data files, 1001.DAT through 1013.DAT converting these SEG-2 files recorded with the EGG Geometrics. The result is files 1001.seg through 1013.seg are created, but do not yet have the correct geometry. Program, setgeom, runs and applies the correct geometry to the BSEGY files, setg1001.seg through setg1013.seg. The last step in the script renames the files back to 1001.seg through 1013.seg.

We can view the headers created using the bdump program. For example, the command, bdump 1001.seg 0 produces the following text file. Note that the above process corrects the locations of sources and receivers. The program egg2seg, has inserted the trace length, filters, shot date and time. The assumption of shot and receiver orientation (180 degrees from vertical) is a default setting and may need to be corrected. For that, program bhed can be used.

{dumplist2}
                     |-------------------------------|
                     |   PARTIAL SEGY HEADER DUMP    |
                     |                               |
                     |           1001.seg            |
                     |                               |
                     |-------------------------------|

 -----------------------------------------------------------------------------------
   Length =  2000 samples             |  Shot Elevation =        0.0
   Sample Interval =    0.00025 sec.  |  Shot Depth =        0.0
   Delay Time =    0 msec.            |  Up Hole Time =     0 msec
   Low Cut Filter  =    0 Hz.         |  Shot X-COORD =       0.00
   High Cut Filter = 1000 Hz.         |  Shot Y-COORD =       0.00
   Line ID: 001                      |  Shot Date (year.moday) = 2004.0406
   Shot Orientation:                  |  Shot Time (hr:min)   = 14:16
   Azimuth=  0 Deg.  Vertical=180 Deg.|  Charge Size (grams)=     0
 -----------------------------------------------------------------------------------
 TRACE|SHOT| STATION | OFFSET|        RECEIVER          |VERT|1STBRK|K-GAIN|AZI|VER|
   #  |REC.|SHOT  REC|       |  ELEV.  X-COORD   Y-COORD|FOLD|(SEC.)| (dB) |   |   |
 -----|----|---------|-------|----------------------------|--|------|------|---|---|
    1 |   1| 001  001|   0.00|    0.00      0.00      0.00| 2|0.0000|   24 |  0|180|
    2 |   1| 001  002|   1.00|    0.00      1.00      0.00| 2|0.0000|   24 |  0|180|
    3 |   1| 001  003|   2.00|    0.00      2.00      0.00| 2|0.0000|   24 |  0|180|
    4 |   1| 001  004|   3.00|    0.00      3.00      0.00| 2|0.0000|   24 |  0|180|
    5 |   1| 001  005|   4.00|    0.00      4.00      0.00| 2|0.0000|   24 |  0|180|
    6 |   1| 001  006|   5.00|    0.00      5.00      0.00| 2|0.0000|   24 |  0|180|
    7 |   1| 001  007|   6.00|    0.00      6.00      0.00| 2|0.0000|   24 |  0|180|
    8 |   1| 001  008|   7.00|    0.00      7.00      0.00| 2|0.0000|   24 |  0|180|
    9 |   1| 001  009|   8.00|    0.00      8.00      0.00| 2|0.0000|   24 |  0|180|
   10 |   1| 001  010|   9.00|    0.00      9.00      0.00| 2|0.0000|   24 |  0|180|
   11 |   1| 001  011|  10.00|    0.00     10.00      0.00| 2|0.0000|   24 |  0|180|
   12 |   1| 001  012|  11.00|    0.00     11.00      0.00| 2|0.0000|   24 |  0|180|
   13 |   1| 001  013|  12.00|    0.00     12.00      0.00| 2|0.0000|   24 |  0|180|
   14 |   1| 001  014|  13.00|    0.00     13.00      0.00| 2|0.0000|   24 |  0|180|
   15 |   1| 001  015|  14.00|    0.00     14.00      0.00| 2|0.0000|   24 |  0|180|
   16 |   1| 001  016|  15.00|    0.00     15.00      0.00| 2|0.0000|   24 |  0|180|
   17 |   1| 001  017|  16.00|    0.00     16.00      0.00| 2|0.0000|   24 |  0|180|
   18 |   1| 001  018|  17.00|    0.00     17.00      0.00| 2|0.0000|   24 |  0|180|
   19 |   1| 001  019|  18.00|    0.00     18.00      0.00| 2|0.0000|   24 |  0|180|
   20 |   1| 001  020|  19.00|    0.00     19.00      0.00| 2|0.0000|   24 |  0|180|
   21 |   1| 001  021|  20.00|    0.00     20.00      0.00| 2|0.0000|   24 |  0|180|
   22 |   1| 001  022|  21.00|    0.00     21.00      0.00| 2|0.0000|   24 |  0|180|
   23 |   1| 001  023|  22.00|    0.00     22.00      0.00| 2|0.0000|   24 |  0|180|
   24 |   1| 001  024|  23.00|    0.00     23.00      0.00| 2|0.0000|   24 |  0|180|
   25 |   1| 001  025|  24.00|    0.00     24.00      0.00| 2|0.0000|   24 |  0|180|
   26 |   1| 001  026|  25.00|    0.00     25.00      0.00| 2|0.0000|   24 |  0|180|
   27 |   1| 001  027|  26.00|    0.00     26.00      0.00| 2|0.0000|   24 |  0|180|
   28 |   1| 001  028|  27.00|    0.00     27.00      0.00| 2|0.0000|   24 |  0|180|
   29 |   1| 001  029|  28.00|    0.00     28.00      0.00| 2|0.0000|   24 |  0|180|
   30 |   1| 001  030|  29.00|    0.00     29.00      0.00| 2|0.0000|   24 |  0|180|
dumplist2