Details SeisWare - Velocity as a Background


This way takes a few more steps. Velocity segy files are normally large in size and very few of us will actually store them. What we typically store is a card deck containing the velocity information (time rms pairs). I'm going to show how to take a velocity card image file and create your own velocity segy file! This takes a few steps with the help of BP's FreeUSP software program velin. It takes a time rms velocity card deck and interpolates these data to fill in all time samples with a velocity values!

Here are the real steps that need to be taken:

  1. Reformat the velocity tables into a suitable format for the USP program velin
  2. Convert the SeisX/SeisWare segy file into USP format
  3. Change the USP binary and trace headers from one record of 679 traces to 679 records of one trace (line is 2d).
  4. Create USP velocity velocity file exactly the same size in traces and samples as the stack file above
  5. Convert the USP velocity file back to SeisWare format with perl script usp2sx.pl
  6. Add shotpoints and XY's back into the velocity file with SeisWare
C&C reprocessed these data and provided the following text description. Here's what the the velocity values look like:
VELOCITY INFORMATION (FROM PROCESSING DATUM)
CDP #            # PAIRS
TIME         |   RMS VELOCITY

        40
      9525       16
    0.0489860    2920.103 
    0.2948324    3136.598 
    0.4535310    3362.114 
    0.6117027    3706.842 
    0.8076851    3996.667 
    0.9624081    4026.809 
    1.1377608    4103.493 
    1.2724162    4228.093 
    1.4014084    4352.941 
...
I then looked at the documentation for USP program velin and I noticed that the -flat format was the easiest to reformat the data into. All I have to do is covert velocity in seconds to milli seconds, add some commas... I wrote an awk script to do this called vel_cnc2flat.ak. It's quite simple and is only a fel lines of code. Here's how to run it:
awk -f ~ekeyser/ak/vel_cnc2flat.ak < cnc.txt > cnc_vel.txt
The input and output files look like:

2 Convert the SeisX/SeisWare segy file into USP format

Create a text file containing the names of the SeisX files you want to convert using program sx2usp.pl. For only one file I will use the simple unix command:
 ls orig.MIG.0.sgy > junk
 ~ekeyser/Perl/sx2usp.pl
For many files I execute the following unix commands and scripts:
 ls *sgy > junk
 ~ekeyser/Perl/sx2usp.pl
Here's the output from this program:
  ~ekeyser/Perl/sx2usp.pl

-Working on orig.MIG.0.sgy
1+0 records in
1+1 records out
Big Endian si=2000 ns=1501 format=1 start_x=0 start_y=0 end_x=679 end_y=0 sxflag=92
     Line   Trace     SPID       CDP     UTMX     UTMY
Data not SeisX -- cannot re scale
       0        0    670.25     9405   513261  6191324
       0        0    670.50     9410   569132  6113238
       0        0    670.75     9415   561320  6132952
       0        0    671.00     9420   569750  6113266
       0        0    671.25     9425   513280  6191321
       0        0    671.50     9430   569132  6113295
       0        0    671.75     9435   561321  6113210
       0        0    672.00     9440   569132  6113224
       0        0    672.25     9445   561320  6113239
-fini
Note the sxflag of the number 92, this means the data is SeisX 4.0 format. The Big Endian label means the data came from the unix side of things. Little Endian means it came from the Intel (PC) side. Either way the conversion program works. Next step is to fire up a USP Xterm (Window) environment shell and check the data. Here's how we do this at EnCana.
/usr/global/startup/usp.ksh
This opens a window. Let's check that the man pages are working. Lets check out the documentation for probram scan we use to check out data.
bash-2.03$ uman scan

User Commands                                             scan(1)

NAME
     scan  - module to scan traces

SYNOPSIS
     scan [ -Nntap ] [ -V ] [ -v  ] [ -c  ] [ -t  ] [ -V  ] [  -H
     ]  [ -S  ] [ -nsns ] [ -nene ] [ -rsirs ] [ -reire ] [ -npnp
     ] [ -iidec ] [ -bnbin ] [ -wihdrwd ] [ -Wword ] [  -R   ]  [
     -Bbyte ] [ -Llength ] [ -M  ] [ -mt  ] [ -Ffmt ] [ -?  ]

DESCRIPTION
     scan allows a scan of the contents of  the  SIS  data  file,
     providing  all  sorts  of information concerning its various
     contents including the historical line header.  This  infor-
     mation  under  certain conditions takes the form of mnemonic
     references to header values.  A list of the line  and  trace
     header  mnemonics  is  proovided  at  the end of this manual
     page.

     scan gets processing controls from the command line. Reason-
     able  defaults  are  set up. In addition, if no file name is
     given, the binary trace data are expected to be on the stan-
     dard input.

  Command line arguments
     -N ntap
          Enter the full path of the  file  containing  the  data
          set.  If  not specified, input is expected on the stan-
          dard input. If standard input  is  not  specified,  and
          there  is  no  input,  e.g., program run in background,
          expect a  very  ungracious  crash.   (default  standard
          input)

This is a very important program, read the documentation as it contains a list of all header words.
 scan -Norig.MIG.0.usp | more

  line header values after default check 
  # of bytes in line header=  1004
  # of samples/trace =    1501
  sample interval    =    2
  s.i. multiplier    =      1.00000E-03
  traces per record  =    679
  records per line   =    1
  format of data     =    3
  luin               =    2
  input data set name =  orig.MIG.0.usp
  ns (starting trace)    =    1
  ne (ending trace  )    =    679
  rs (starting record)   =    1
  re (ending record)     =    1
  Group interval         =  
  OAC Line               =  orig    
  Number ampl. histogrm bins=   10
  NOTE: a bin = (trcmax-trcmin)/nbin
  verbose output         =    F
  

   rec    trc     gi     di   si_x10  src_pt  sp/di   li     dist  static 
 RecNum TrcNum  RecInd DphInd SrcLoc  SoPtNm  SrcPnt LinInd  DstSgn StaCor

     1      1      0   9405   4702    470    470      0         0      0
     1      2      0   9410   4705    470    470      0         0      0
     1      3      0   9415   4707    470    470      0         0      0
     1      4      0   9420   4710    471    471      0         0      0
     1      5      0   9425   4712    471    471      0         0      0
     1      6      0   9430   4715    471    471      0         0      0

Our data is converted properly but we have to create a different record for each trace. We will now correct this.

3 Change the USP binary and trace headers from one record of 679 traces to 679 records of one trace

Use program utop to correct the binary (line) header first and then use program rnum to renumber our data. Use scan again to verify the data. Notice we are piping the output of utop directly into rnum and saving the output in the file corr.MIG.0.usp.
utop -Norig.MIG.0.usp -L 1 -R 679 |\
rnum -Ocorr.MIG.0.usp -hwRecNum -sw1 -iw1 -R
scan -Ncorr.MIG.0.usp | more


  line header values after default check 
  # of bytes in line header=  1097
  # of bytes in output line header=  1120
  # of samples/trace =    1501
  sample interval    =    2
  s.i. multiplier    =      1.00000E-03
  traces per record  =    1
  records per line   =    679
  format of data     =    3
  luin               =    2
  input data set name =  corr.MIG.0.usp
  ns (starting trace)    =    1
  ne (ending trace  )    =    1
  rs (starting record)   =    1
  re (ending record)     =    679
  Group interval         =  
  OAC Line               =  orig    
  Number ampl. histogrm bins=   10
  NOTE: a bin = (trcmax-trcmin)/nbin
  verbose output         =    F
  

   rec    trc     gi     di   si_x10  src_pt  sp/di   li     dist  static 
 RecNum TrcNum  RecInd DphInd SrcLoc  SoPtNm  SrcPnt LinInd  DstSgn StaCor

     1      1      0   9405   4702    470    470      0         0      0

     2      2      0   9410   4705    470    470      0         0      0

     3      3      0   9415   4707    470    470      0         0      0

     4      4      0   9420   4710    471    471      0         0      0

     5      5      0   9425   4712    471    471      0         0      0
Yes, that is what we want, each trace has a different record number.

3 Create USP velocity velocity file exactly the same size in traces and samples as the stack file above

USP program xsd
Do a uman on program velin to see what the parameters mean.

Program velin will create a velocity file of the same dimensions as the file corr.MIG.0.usp and place the output in the file vel.MIG.0.usp.

Comments are V for Verbose and the time, rms velocity file is read from the text file cnc_vel.txt.

The data format is the -flat format and our velocities are indexd by cdp depth index (di) DphInd.

Note that the cdps are not required to be sequential! (SeisWare does require this)

velin -N corr.MIG.0.usp -Ovel.MIG.0.usp -V -v cnc_vel.txt -flat -hw DphInd
scan -Nvel.MIG.0.usp | more
Program scan will tell you the RecNum now has the values of the DphInd and the Shot Points are all reset to zero use usp program xsd to look at your data. My display is up and to the right. Does it look like a velocity field? (File) (Open data) change end record to 679 (otherwise you will see only a single trace)

Here are the commands if you want velin to compute the interval velocity for you:

velin -N corr.MIG.0.usp -Ovel.MIG.2.usp -V -v cnc_vel.txt -flat -hw DphInd -vout I -force
scan -Nvel.MIG.0.usp | more
All we have needed to add is a -vout to specify Interval Velocity and a -force to ensure that RMS velocity inversion will do kill the program.

What to do if all the above doesn't work:

4 Convert the USP velocity file back to SeisWare format

Convert the velocity file back to SeisWare with with perl script usp2sx.pl.
  ls vel.MIG.0.usp > junk
  ~ekeyser/Perl/usp2sx.pl

-Input file  = vel.MIG.0.usp
-Output file = vel.MIG.0.sgy
    PrcDat     OACLin     JobNum    NumTrc   NumRec   SmpInt   NumSmp Fmt   UnitSc
-Green word 1180
"07/21/05" "orig    " " Job num"        1      679        2     1501   3    0.001
Trace    SrPtXC    SrPtYC   RecNum   TrcNum     Line    Trace    SrcLoc      CDP
    1         0         0     9405        1        0     9405      0.00        0
  679         0         0    12795        1        0    12795      0.00      678
 
Yup, shot points SrcLoc are now all zero as are the UTMX and UTMY. These need to be fixed in SeisWare.

5 Add shotpoints and XY's back into the velocity file with SeisWare

Your best bet is to re load the velocity line into SeisWare, The usp file above does not contain the information to make a totally comptable SeisWare file. You can fix up the numbers but it is easier to just re load your data. The easy way to add the XY's is to strip out XY's from our initial line and then merge them into the velocity segy file.
 ls orig.MIG.0.sgy > junk
 ~ekeyser/perl/sx2segp.pl

 orig.MIG.0.sgy orig MIG
 fini -- 
 
This script creates a flat file called:
bash-2.03$ more navigation.segp

B12345                               570.2     512361.0   6123924.0
B12345                               580.0     571238.0   6123233.0
B12345                               590.0     512337.0   6112347.0
B12345                               600.0     577989.0   6123923.0
B12345                               610.0     578123.0   6191233.0
...
 
Use (Seismic) (Import) segp files to import the XY information. Remember to make sure your internal line name for the segy data is the same as in the navigation file.

Finished -- you are now read to display velocity and your seismic section in the same display!

Pssssst - Like my seismic line?

Pulse Seismic in Calgary has given permission to show these data. The real shot points and XY's have been removed (altered) to protect the innocent.
Site Owner: Eric Keyser
Last Updated: July 26, 2005