One of the most irritating things about rayinvr is the format required for the velocity model. Although a rayinvr v.in file is nice to look at, because it uses a well-defined 10-nodes-per-row format, it can be a pain in the rear to modify. In particular, when there are more than 10 nodes (boundary or velocity) for a given layer, inserting or deleting a node, especially a node on the left side of the model, can be a hassle because you have to manually shift all the nodes to the right to satisfy the strict format requirements for a v.in file. Many people have been driven insane because of rayinvr, and most of the insanity is a direct result of the velocity model format.
There are two solutions to avoid being sent to the nut farm. The first is vmed, a graphical editing/analysis program for rayinvr velocity models. The other solution is to use v2c and c2v: v2c converts a rayinvr v.in file into a column-oriented file which is much easier to edit. Adding or deleting a node in the column-oriented file only requires adding a new line, or deleting an existing line. In addition, the column-oriented file is format-free, so you don't have to spend time checking to make sure you haven't made a mistake with the format of the numbers. c2v converts the column-oriented file back to a rayinvr velocity model file.
Both programs are trivial to use. The only (optional) inputs to both programs are the input and output velocity file names.
Also included in the v2c/c2v package is a utility code (vrev.f) for reversing the direction of a rayinvr v.in file.
Download compressed UNIX tar file (7 Kb)
B iwhere i is the layer number. (The "B" must be in the first column). This is followed by one line for each boundary node comprising:
X Z Iwhere X and Z are the coordinates of the boundary node, and I is the inversion switch setting for the node. The numbers are free format, so that when editing the column-oriented file, the spacing/format of X, Z and I values is not important.
Following the boundaries, the velocities are listed as follows:
The velocities for each layer are preceeded by the line:
V iwhere i is the layer number. (The "V" must be in the first column). This is followed by one line for each location at which there is either an upper or lower velocity node:
X V1 I1 V2 I2where X is the location of the velocity node, V1 and I1 are the velocity and inversion switch setting for the upper velocity node, and V2 and I2 are the velocity and inversion switch setting for the lower velocity node. If at location X there is only an upper velocity node, then V2 and I2 are both set to 0. Similarly if at location X there is only an lower velocity node, then V1 and I1 are both set to 0. Also, if there is only one upper velocity node and it's velocity is zero (indicating that velocities at the top of layer i are the same as at the bottom of layer i-1), then all entries of V1 and I1 for layer i will be 0. Similarly, if there is only one lower velocity node and it's velocity is zero (indicating that velocities at the base of layer i are the same as at the top of layer i), then all entries of V2 and I2 for layer i will be 0.
Note: when editing a column-oriented file, the X values for a layer must always be increasing.
1 90.00 95.95 98.48 145.00 147.01 150.00
0 -0.09 -0.09 0.00 0.00 -0.15 -0.15
0 0 0 0 0 0
1 150.00
0 1.50
0
1 150.00
0 0.00
0
2 90.00 95.95 98.48 100.81 102.24 104.14 105.65 107.14 110.34 122.89
1 -0.09 -0.09 0.00 0.06 0.09 0.14 0.17 0.19 0.19 0.19
0 0 0 0 0 0 0 0 0 0
2 126.04 127.61 129.22 130.79 132.79 133.96 135.59 137.19 138.79 145.00
1 0.19 0.19 0.18 0.17 0.17 0.16 0.15 0.14 0.14 0.00
0 0 0 0 0 0 0 0 0 0
2 147.01 150.00
0 -0.15 -0.15
0 0
2 150.00
0 1.60
0
2 150.00
0 0.00
0
3 90.00 95.95 98.48 100.81 105.65 109.30 116.00 124.05 130.79 135.00
1 -0.09 -0.09 0.00 0.51 0.64 0.65 0.47 0.59 1.06 0.20
0 0 0 0 0 0 0 0 0 0
3 140.00 145.00 147.01 150.00
0 0.20 0.00 -0.15 -0.15
0 0 0 0
3 90.00 130.79 138.33 150.00
0 1.60 1.60 2.46 2.60
0 0 0 0
3 90.00 130.79 138.33 150.00
0 1.60 1.60 2.74 2.60
0 0 0 0
4 90.00 95.95 98.48 100.81 105.65 109.30 116.00 124.05 130.79 135.00
1 -0.09 -0.09 0.00 0.51 0.64 0.65 0.47 0.59 1.06 0.95
0 0 0 0 0 0 0 0 0 0
4 140.00 145.00 147.01 150.00
0 0.65 0.00 -0.15 -0.15
0 0 0 0
4 90.00 95.95 102.24 109.30 124.05 130.79 138.33 147.01 150.00
0 4.84 4.84 4.13 3.86 3.79 4.78 6.00 6.00 6.00
0 0 0 0 0 0 0 0 0
4 90.00 95.95 102.24 109.30 124.05 130.79 138.33 147.01 150.00
0 5.38 5.38 4.58 4.14 4.19 4.78 6.00 6.00 6.00
0 0 0 0 0 0 0 0 0
5 90.00 105.00 112.50 120.00 130.79 135.00 140.00 145.00 147.01 150.00
0 1.90 1.90 1.10 1.50 1.30 0.95 0.65 0.00 -0.15 -0.15
0 0 0 0 0 0 0 0 0 0
5 90.00 95.95 102.24 109.30 120.00 126.10 130.79 135.00 147.01 150.00
0 5.39 5.39 4.59 4.15 4.19 4.74 4.83 6.00 6.00 6.00
0 0 0 0 0 0 0 0 0 0
5 90.00 95.95 102.24 109.30 120.00 126.10 130.79 135.00 147.01 150.00
0 5.43 5.43 4.63 4.17 4.19 4.75 4.83 6.00 6.00 6.00
0 0 0 0 0 0 0 0 0 0
6 90.00 95.95 112.50 120.00 130.79 135.00 140.00 145.00 147.01 150.00
0 3.32 3.32 2.29 1.85 1.60 0.95 0.65 0.00 -0.15 -0.15
0 0 0 0 1 0 0 0 0 0
6 150.00
0 0.00
0
6 150.00
0 0.00
0
7 90.00 95.95 106.60 112.50 120.00 130.79 135.00 140.00 145.00 147.01
1 3.32 3.32 3.32 2.68 1.85 1.60 0.95 0.65 0.00 -0.15
0 0 0 0 0 0 0 0 0 0
7 150.00
0 -0.15
0
7 90.00 95.95 106.60 112.50 120.00 126.10 130.79 145.00 147.01 150.00
0 5.64 5.47 5.52 5.60 5.42 4.75 4.83 6.33 6.40 6.40
0 0 0 0 0 0 0 0 0 0
7 90.00 95.95 106.60 112.50 120.00 126.10 130.79 145.00 147.01 150.00
0 5.64 5.47 5.52 5.60 5.42 4.75 4.83 6.33 6.40 6.40
0 0 0 0 0 0 0 0 0 0
8 90.00 104.23 110.00 120.00 130.79 135.00 140.00 145.00 145.50 147.01
1 8.00 8.00 6.35 4.97 1.60 0.95 0.65 0.00 0.10 0.10
0 0 0 0 0 0 0 0 0 0
8 150.00
0 0.10
0
8 90.00 100.00 110.00 120.00 130.79 138.33 147.01 150.00
0 6.30 6.30 6.33 6.45 5.98 6.01 6.52 6.52
0 0 0 0 0 0 0 0
8 90.00 100.00 110.00 120.00 130.79 138.33 147.01 150.00
0 6.30 6.30 6.33 6.65 6.39 6.41 6.72 6.72
0 0 0 0 0 0 0 0
9 150.00
0 8.00
Running c2v on the column-oriented file listed below will return
the rayinvr v.in-formatted file shown above. As you can see by
looking at the format of the column-oriented file, it is much
easier to edit than the rayinvr v.in file. Note also that, although
the example shown below looks nice and neat, the exact format of
any line is not important (only the "B" and "V" must always be in
column 1).
B 1 90.00 -0.09 0 95.95 -0.09 0 98.48 0.00 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 2 90.00 -0.09 0 95.95 -0.09 0 98.48 0.00 0 100.81 0.06 0 102.24 0.09 0 104.14 0.14 0 105.65 0.17 0 107.14 0.19 0 110.34 0.19 0 122.89 0.19 0 126.04 0.19 0 127.61 0.19 0 129.22 0.18 0 130.79 0.17 0 132.79 0.17 0 133.96 0.16 0 135.59 0.15 0 137.19 0.14 0 138.79 0.14 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 3 90.00 -0.09 0 95.95 -0.09 0 98.48 0.00 0 100.81 0.51 0 105.65 0.64 0 109.30 0.65 0 116.00 0.47 0 124.05 0.59 0 130.79 1.06 0 135.00 0.20 0 140.00 0.20 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 4 90.00 -0.09 0 95.95 -0.09 0 98.48 0.00 0 100.81 0.51 0 105.65 0.64 0 109.30 0.65 0 116.00 0.47 0 124.05 0.59 0 130.79 1.06 0 135.00 0.95 0 140.00 0.65 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 5 90.00 1.90 0 105.00 1.90 0 112.50 1.10 0 120.00 1.50 0 130.79 1.30 0 135.00 0.95 0 140.00 0.65 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 6 90.00 3.32 0 95.95 3.32 0 112.50 2.29 0 120.00 1.85 0 130.79 1.60 1 135.00 0.95 0 140.00 0.65 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 7 90.00 3.32 0 95.95 3.32 0 106.60 3.32 0 112.50 2.68 0 120.00 1.85 0 130.79 1.60 0 135.00 0.95 0 140.00 0.65 0 145.00 0.00 0 147.01 -0.15 0 150.00 -0.15 0 B 8 90.00 8.00 0 104.23 8.00 0 110.00 6.35 0 120.00 4.97 0 130.79 1.60 0 135.00 0.95 0 140.00 0.65 0 145.00 0.00 0 145.50 0.10 0 147.01 0.10 0 150.00 0.10 0 B 9 150.00 8.00 0 V 1 150.00 1.50 0 0.00 0 V 2 150.00 1.60 0 0.00 0 V 3 90.00 1.60 0 1.60 0 130.79 1.60 0 1.60 0 138.33 2.46 0 2.74 0 150.00 2.60 0 2.60 0 V 4 90.00 4.84 0 5.38 0 95.95 4.84 0 5.38 0 102.24 4.13 0 4.58 0 109.30 3.86 0 4.14 0 124.05 3.79 0 4.19 0 130.79 4.78 0 4.78 0 138.33 6.00 0 6.00 0 147.01 6.00 0 6.00 0 150.00 6.00 0 6.00 0 V 5 90.00 5.39 0 5.43 0 95.95 5.39 0 5.43 0 102.24 4.59 0 4.63 0 109.30 4.15 0 4.17 0 120.00 4.19 0 4.19 0 126.10 4.74 0 4.75 0 130.79 4.83 0 4.83 0 135.00 6.00 0 6.00 0 147.01 6.00 0 6.00 0 150.00 6.00 0 6.00 0 V 6 150.00 0.00 0 0.00 0 V 7 90.00 5.64 0 5.64 0 95.95 5.47 0 5.47 0 106.60 5.52 0 5.52 0 112.50 5.60 0 5.60 0 120.00 5.42 0 5.42 0 126.10 4.75 0 4.75 0 130.79 4.83 0 4.83 0 145.00 6.33 0 6.33 0 147.01 6.40 0 6.40 0 150.00 6.40 0 6.40 0 V 8 90.00 6.30 0 6.30 0 100.00 6.30 0 6.30 0 110.00 6.33 0 6.33 0 120.00 6.45 0 6.65 0 130.79 5.98 0 6.39 0 138.33 6.01 0 6.41 0 147.01 6.52 0 6.72 0 150.00 6.52 0 6.72 0