Explanation of filesGetting startedInversion
There are very detailed explanations of inversion theory available from the Rayinvr website
»http://www.geophysics.rice.edu/department/faculty/zelt/rayinvr.html. This page is simply intended to be an introduction. Forward modelling refers to tracing the rays from a defined velocity model. Inversion refers to modifying the velocity model, so the misfit between the observed (traveltime phase picks) and theoretical traveltime curves are minimized.
There are three main programs explained on this page. Rayinvr (or xrayinvr) is the program that performs the ray tracing. Dmplstsqr is the program for inverting the velocity model (there are other versions of this program). Vmodel is the program used for checking, displaying, and converting the velocity files. These programs are run by simply typing the program name on the command line, however the proper parameter files must be present in the current directory.
- Rayinvr must be properly installed on your computer prior to performing the example. See the Rayinvr website »http://www.geophysics.rice.edu/department/faculty/zelt/rayinvr.html for more details. This is fortran code, so best run on a Unix/Linux computer or a windows computer that has »cygwin and rayinvr installed. This example is taken from actual high resolution modelling of OBS data off the Scotian Slope.
- for detailed information see the text files located in the "documentation" directory of the Rayinvr source archive. These explain every parameter.
Explanation of files
- It is handy to place each velocity model in its own directory, that way files won't get confused.
- Several files are necessary for Rayinvr to run. It requires the following files, which MUST have the following names:
- v.in, the velocity model
- r.in, the parameter file for tracing rays
- Other files are optional, for performing more advanced tasks such as inversion, amplitude modelling, or for using the program Vmodel.
- tx.in, the "picks" from the OBS data. Produced from the program Zplot (available on the Rayinvr website), or alternatively with the Kingdom Suite KingdomSuitePicking. This file is only necessary if you plan to use inversion, or if you want to calculate the misfit of the velocity model compared to the OBS data picks.
- d.in, the paramter file for inversion of data.
- vm.in, the parameter file for using Vmodel. This is a useful program for displaying and checking velocity models, displaying velocity profiles, and more.
- c.in, a much more readable format of the velocity model. Conversion from v.in, and back to c.in is performed by the c2v and v2c programs available from »http://www.geop.ubc.ca/~bzelt/v2c/help.html.
- Obtaining a working model can be challenging, due to all the possible parameter options. This example contains all the files necessary to get started.
Getting started
- Install Rayinvr. Compile the binaries with the supplied makefiles. Include these binaries in the PATH, so Rayinvr can be called from any directory.
- Download this archive »upload/rayinvr_example.tar.gz, and unpack it with this command (or unpack in Winzip):
tar -zxvf rayinvr_example.tar.gz
OR
gunzip rayinvr_example.tar.gz && tar -xvf rayinvr_example.tar
- Once the archive is unpacked, it will create a new directory called rayinvr_example. Enter this directory on the command line
cd rayinvr_example
- Run vmodel by typing "vmodel" to ensure the velocity model is valid. Any errors will be printed to the screen. Common problems are:
- the text file is in DOS text format instead of Unix text format (easy fix, search google).
- the formatting is incorrect. Rayinvr and vmodel are very picky so the format must be perfect. Use spaces instead of tabs.
- there is no trailing blank line at the end of the velocity model.
- Run xvmodel to display a velocity profile at 0 km offset. This profile is also output to the file "vm.out". Its useful to note any wild velocity gradients or anything unusual. Note that the OBS is located at on the seafloor at 850 m, and at 0 km offset.
- Type "rayinvr" (or xrayinvr). Rayinvr should output the following text:
...
shot# 1: ray code 6.2: 50 rays traced
shot# 1: ray code 7.2: 50 rays traced
shot# 1: ray code 8.2: 50 rays traced
shot# 1: ray code 9.2: 50 rays traced
shot# 1: ray code 10.2: 50 rays traced
shot# 1: ray code 4.3: 13 rays traced
|----------------------------------------------------------------|
| |
| total of 1443 rays consisting of 24811 points were traced |
| |
| model consists of 11 layers and 13 blocks |
| |
|----------------------------------------------------------------|
Number of data points used: 720
RMS traveltime residual: 0.005
Normalized chi-squared: 0.225
- This has performed raytracing for the velocity model v.in. The overall Trms and chi-squared are displayed.
- The detailed comparison between the calculated traveltime curves (tx.out) and the traveltime picks from the OBS data (tx.in) can be seen in the file "r1.out". The info at the end of this file is useful, it states the "Trms" and "chi-squared" for each phase specified in the paramter file "r.in". A low Trms and chi-squared are desirable, for advanced theory on model fitting, see the publications available from the »Rayinvr website.
- Since this is a working example, you can always go back to it. Feel free to experiment with different parameters, as described in the documentation.
Inversion
- Inversion is easy to perform with the proper setup. Simply type "dmplstsqr" and press enter to perform inversion. The new model will be printed to the screen, and replace v.in. A backup of the original model will be saved to v.bak. Run "rayinvr" again to see if the model has improved.
- Inversion can be tricky. The phase numbers present in the picks (tx.in) must correspond EXACTLY to the phase numbers in the calculated traveltime curves (tx.out). This means that if the direct wave picks are numbered as phase 1, and the reflected arrivals are phases 2,3,4,5; then the "ray" parameter in the "r.in" file must be properly set up (eg: ray = 1.2, 2.2, 3.2, 4.2, 5.2). These numbers 1.1, 1.2, 1.3, 2.1, 2.2, 2.3, etc. designate whether the ray traced should be a relfection, headwave (refraction), or turning wave (refraction) and from which layer they should be traced. See rayinvr.doc for more info.
- In this example, the direct wave (phase) is traced (the "1.2" value in "ray", contained in r.in). This direct wave is from layer 1, which is defined in v.in (and c.in) as the water layer with a velocity of 1.48 km/s. 9 reflected phases are traced, reflecting off of the bottom of the layer (eg: 2.2 reflects off of the bottom of layer 2, and travels to the receiver location). The final phase is the refracted phase (head wave refraction, as layer.3) from the bottom of layer 4 (denoted as 4.3). If this refraction was to be modelled as a turning wave refraction, it would be denoted as 5.1, because it is turning upwards in the fifth layer.
- If problems are occurring, it can be useful to plot tx.in and tx.out on the same plot. If the phase numbers are different, this will cause a problem. If they are the same, inversion should work properly.
- This example should be helpful in getting started with Rayinvr. Remember that this model is very basic and may need significant modification for other OBS work.