CWPSU中自定义地层模型模拟反射波

目录
  1. 如何在CWPSU中生成自定义地层模型
    1. 前情提要
    2. 一些符号说明
    3. UNIF2用法介绍
    4. Ximage用法简介
    5. 实战
      1. Model
      2. Code
      3. Result
    6. 预告

如何在CWPSU中生成自定义地层模型

前情提要

之前我们安装了CWPSU,需要模拟出反射数据,那么首先需要自定义一个模型,如何定义出一个模型?博主查阅了网上一些资料,不过都是东拼西凑,抄来抄去,从来没有原理性的解释。博主本着大家能够深入了解其原理,真正了解内核,而不是CTRL+C完就完事的需求,给大家摘了官方文档,同时做一些讲解和实战。不过限于知识水平,难免疏漏,还请批评指正!

一些符号说明

1
2
3
4
5
6
A < B  processA takes input from fileB
A > B processA wirte on fileB
A >> B processA appends to fileB
A | B output of A is input to B
A << B take input from following lines(B represents text)
Tips:'|' is similar to Perl in which represents a pipe

UNIF2用法介绍

UNIF2 - generate a 2-D UNIFormly sampled velocity profile from a layered
model. In each layer, velocity is a linear function of position.

格式

unif2 < infile > outfile [parameters]

必要参数:
none

可选参数:
ninf=5 分界面数量
nx=100 x轴采样个数 (2nd dimension)
nz=100 z轴采样个数 (1st dimension)
dx=10 x sampling interval
dz=10 z sampling interval

npmax=201 maximum number of points on interfaces

fx=0.0 first x sample
fz=0.0 first z sample

x0=0.0,0.0,…, distance x at which v00 is specified
z0=0.0,0.0,…, depth z at which v00 is specified
v00=1500,2000,2500…, velocity at each x0,z0 (m/sec)

dvdx=0.0,0.0,…, derivative of velocity with distance x (dv/dx)
dvdz=0.0,0.0,…, derivative of velocity with depth z (dv/dz)

method=linear for linear interpolation of interface
=mono for monotonic cubic interpolation of interface
=akima for Akima’s cubic interpolation of interface
=spline for cubic spline interpolation of interface

tfile= =testfilename if set, a sample input dataset is
output to “testfilename”.

比较重要的,我们本次用得到的我用黑体加粗了。

说明:
关于infile=input file的说明

我们需要定义写入一个model,这个的定义方式类似于Specfem2D,使用过这个软件的同学理解起来应该很简单。

我们的model是由一系列的x,z坐标轴键字对构成的,第一列为x轴,第二列为z轴,分界面之间用1.0 -99999作为符号标记分开。例如:

1
2
3
4
5
6
7
#model
0.0 0.0
100.0 0.0
1.0 -99999
0.0 200
100.0 200
1.0 -99999

这个模型就代表了两个界面,他们都是平面。对于第一个界面,起始点坐标0.0,0.0。终点坐标100.0,0.0。我们将这两个点连起来就是界面了,当然它是表面。其他的类似,如果需要起伏界面,只需在内部加入更多的点即可。

method就是控制点之间插值的方式。

官方示例:
unif2 tfile=testfilename produces a 5 interface demonstration model
unif2 < testfilename | psimage n1=100 n2=100 d1=10 d2=10 | …

Ximage用法简介

我们为了画出模型,还需要Ximage,不过这部分比较简单,直接给出说明

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
Required Parameters:
n1 number of samples in 1st (fast) dimension

Optional Parameters:
d1=1.0 sampling interval in 1st dimension
f1=0.0 first sample in 1st dimension
n2=all number of samples in 2nd (slow) dimension
d2=1.0 sampling interval in 2nd dimension
f2=0.0 first sample in 2nd dimension
mpicks=/dev/tty file to save mouse picks in
perc=100.0 percentile used to determine clip
clip=(perc percentile) clip used to determine bclip and wclip
bperc=perc percentile for determining black clip value
wperc=100.0-perc percentile for determining white clip value
bclip=clip data values outside of [bclip,wclip] are clipped
wclip=-clip data values outside of [bclip,wclip] are clipped
balance=0 bclip & wclip individually
=1 set them to the same abs value
if specified via perc (avoids colorbar skew)
cmap=hsv\'n\' or rgb\'m\' \'n\' is a number from 0 to 13
\'m\' is a number from 0 to 11
cmap=rgb0 is equal to cmap=gray
cmap=hsv1 is equal to cmap=hue
(compatibility to older versions)
legend=0 =1 display the color scale
units= unit label for legend
legendfont=times_roman10 font name for title
verbose=1 =1 for info printed on stderr (0 for no info)
xbox=50 x in pixels of upper left corner of window
ybox=50 y in pixels of upper left corner of window
wbox=550 width in pixels of window
hbox=700 height in pixels of window
lwidth=16 colorscale (legend) width in pixels
lheight=hbox/3 colorscale (legend) height in pixels
lx=3 colorscale (legend) x-position in pixels
ly=(hbox-lheight)/3 colorscale (legend) y-position in pixels
x1beg=x1min value at which axis 1 begins
x1end=x1max value at which axis 1 ends
d1num=0.0 numbered tic interval on axis 1 (0.0 for automatic)
f1num=x1min first numbered tic on axis 1 (used if d1num not 0.0)
n1tic=1 number of tics per numbered tic on axis 1
grid1=none grid lines on axis 1 - none, dot, dash, or solid
label1= label on axis 1
x2beg=x2min value at which axis 2 begins
x2end=x2max value at which axis 2 ends
d2num=0.0 numbered tic interval on axis 2 (0.0 for automatic)
f2num=x2min first numbered tic on axis 2 (used if d2num not 0.0)
n2tic=1 number of tics per numbered tic on axis 2
grid2=none grid lines on axis 2 - none, dot, dash, or solid
label2= label on axis 2
labelfont=Erg14 font name for axes labels
title= title of plot
titlefont=Rom22 font name for title
windowtitle=ximage title on window
labelcolor=blue color for axes labels
titlecolor=red color for title
gridcolor=blue color for grid lines
style=seismic normal (axis 1 horizontal, axis 2 vertical) or
seismic (axis 1 vertical, axis 2 horizontal)
blank=0 This indicates what portion of the lower range
to blank out (make the background color). The
value should range from 0 to 1.
plotfile=plotfile.ps filename for interactive ploting (P)
curve=curve1,curve2,... file(s) containing points to draw curve(s)
npair=n1,n2,n2,... number(s) of pairs in each file
curvecolor=color1,color2,... color(s) for curve(s)
blockinterp=0 whether to use block interpolation (0=no, 1=yes)

花里胡哨的一大堆,不过大多是画图的设置,使用过GMT的同学可能会有心得。我们其实需要用的比较少。

实战

Model

我们首先建立一个model

1
vim model

Input below parameters

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#our surface boundary
0.0 0.0
500.0 0.0
1.0 -99999
#our first boundary
0.0 30.0
100.0 36.0
200.0 38.0
300.0 40.0
400.0 30.0
500.0 24.0
1.0 -99999
#our second boundary
0.0 60.0
500.0 60.0
1.0 -99999
#our last boundary
0.0 80.0
500.0 80.0
1.0 -99999

Tips: Please remove the description lines when you copy the codes !

Code

We establish a model.sh in the same way

1
vim model.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#some constant parameters
WP=600
HP=400
XP=0
YP=0
ninf=3
nx=101
fx=0
dx=5
nz=41
fz=0
dz=2
#cwpsu code
unif2 <model ninf=$ninf nx=$nx nz=$nz dx=$dx dz=$dz v00=1000,2000,3700 | ximage n1=$nz f1=$fz d1=$dz n2=$nx f2=$fx d2=$dx windowtitle="Reflection Synthetic Model" \
label1="Depth(m)" label2="Distance(m)" wbox=$WP hbox=$HP XP=$XP YP=$YP &
exit

Result

1
sh ./model.sh

1571201945125

由于是在WSL里进行的,虽然安装了图形界面,不过Xming的画质还是很垃圾,各位在原生的Linux里的图应该比我的高清、漂亮多了!

预告

那么本期就到这里了,对于完成模型之后如何进行数据的采集和处理我们下期再会!