forked from erbiaoger/test_dispersion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
parameters.yaml
484 lines (481 loc) · 22.8 KB
/
parameters.yaml
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
# //////////////////////////////////////////////////////////////////////////////
#
# SeisFlows YAML Parameter File
#
# //////////////////////////////////////////////////////////////////////////////
#
# Modules correspond to the structure of the source code, and determine
# SeisFlows' behavior at runtime. Each module requires its own sub-parameters.
#
# .. rubric::
# - Determine available options for modules by running:
# > seisflows print modules
# - Auto-fill with docstrings and default values (recommended) by running:
# > seisflows configure
# - Swap out module parameters for a configured parameter file by running:
# > seisflows swap {module} {name} (e.g., seisflows swap solver specfem3d)
# - To set values as NoneType, use: null
# - To set values as infinity, use: inf
#
# MODULES
# ///////
# workflow (str): The types and order of functions for running SeisFlows
# system (str): Computer architecture of the system being used
# solver (str): External numerical solver to use for waveform simulations
# preprocess (str): Preprocessing schema for waveform data
# optimize (str): Optimization algorithm for the inverse problem
# ==============================================================================
workflow: inversion
system: workstation
solver: specfem2d
preprocess: dispersion
optimize: LBFGS
# =============================================================================
#
# Forward Workflow
# ----------------
# Defines foundational structure for Workflow module. When used standalone
# is in charge of running forward solver in parallel and (optionally)
# calculating data-synthetic misfit and adjoint sources.
#
# Parameters
# ----------
# :type modules: list of module
# :param modules: instantiated SeisFlows modules which should have been
# generated by the function `seisflows.config.import_seisflows` with a
# parameter file generated by seisflows.configure
# :type data_case: str
# :param data_case: How to address 'data' in the workflow, available options:
# 'data': real data will be provided by the user in
# `path_data/{source_name}` in the same format that the solver will
# produce synthetics (controlled by `solver.format`) OR
# synthetic': 'data' will be generated as synthetic seismograms using
# a target model provided in `path_model_true`. If None, workflow will
# not attempt to generate data.
# :type stop_after: str
# :param stop_after: optional name of task in task list (use
# `seisflows print tasks` to get task list for given workflow) to stop
# workflow after, allowing user to prematurely stop a workflow to explore
# intermediate results or debug.
# :type export_traces: bool
# :param export_traces: export all waveforms that are generated by the
# external solver to `path_output`. If False, solver traces stored in
# scratch may be discarded at any time in the workflow
# :type export_residuals: bool
# :param export_residuals: export all residuals (data-synthetic misfit) that
# are generated by the external solver to `path_output`. If False,
# residuals stored in scratch may be discarded at any time in the
# workflow
#
#
# Migration Workflow
# ------------------
# Run forward and adjoint solver to produce event-dependent misfit kernels.
# Sum and postprocess kernels to produce gradient. In seismic exploration
# this is 'reverse time migration'.
#
# Parameters
# ----------
# :type export_gradient: bool
# :param export_gradient: export the gradient after it has been generated
# in the scratch directory. If False, gradient can be discarded from
# scratch at any time in the workflow
# :type export_kernels: bool
# :param export_kernels: export each sources event kernels after they have
# been generated in the scratch directory. If False, gradient can be
# discarded from scratch at any time in the workflow
#
#
# Inversion Workflow
# ------------------
# Peforms iterative nonlinear inversion using the machinery of the Forward
# and Migration workflows, as well as a built-in optimization library.
#
# Parameters
# ----------
# :type start: int
# :param start: start inversion workflow at this iteration. 1 <= start <= inf
# :type end: int
# :param end: end inversion workflow at this iteration. start <= end <= inf
# :type iteration: int
# :param iteration: The current iteration of the workflow. If NoneType, takes
# the value of `start` (i.e., first iteration of the workflow). User can
# also set between `start` and `end` to resume a failed workflow.
# :type thrifty: bool
# :param thrifty: a thrifty inversion skips the costly intialization step
# (i.e., forward simulations and misfit quantification) if the final
# forward simulations from the previous iterations line search can be
# used in the current one. Requires L-BFGS optimization.
# :type export_model: bool
# :param export_model: export best-fitting model from the line search to disk.
# If False, new models can be discarded from scratch at any time.
#
#
# =============================================================================
data_case : synthetic # 'data' or 'synthetic'
stop_after : null # 在多少炮之后停止
export_traces : False # 导出所有由外部求解器生成的波形
export_residuals: False # 导出由外部求解器生成的所有残差
export_gradient : True # 在临时目录中生成梯度后导出梯度
export_kernels : False # 在临时目录中生成每个源事件内核后导出梯度
start : 1 # 在此迭代中启动反演工作流
end : 50 # 在此迭代中结束反演工作流
export_model : True # 将线搜索中的最佳拟合模型导出到磁盘
thrifty : False # 节俭反演会跳过昂贵的初始化步骤
iteration : 1 # 工作流的当前迭代
# =============================================================================
#
# Workstation System
# ------------------
# Defines foundational structure for System module. When used standalone,
# runs solver tasks either in serial (if `nproc`==1; i.e., without MPI) or in
# parallel (if `nproc`>1; i.e., with MPI). All other tasks are run in serial.
#
# Parameters
# ----------
# :type ntask: int
# :param ntask: number of individual tasks/events to run during workflow.
# Must be <= the number of source files in `path_specfem_data`
# :type nproc: int
# :param nproc: number of processors to use for each simulation. Choose 1 for
# serial simulations, and `nproc`>1 for parallel simulations.
# :type mpiexec: str
# :param mpiexec: MPI executable on system. Defaults to 'mpirun -n ${NPROC}'
# :type log_level: str
# :param log_level: logger level to pass to logging module.
# Available: 'debug', 'info', 'warning', 'critical'
# :type verbose: bool
# :param verbose: if True, formats the log messages to include the file
# name, line number and message type. Useful for debugging but
# also very verbose.
#
#
# =============================================================================
ntask : 3 # 工作流期间要运行的单个任务/事件的数量
nproc : 40 # 每次模拟要使用的处理器数量
mpiexec : mpirun # 系统上的 MPI 可执行文件
log_level: DEBUG # 传递给日志模块的记录器级别, 'debug', 'info', 'warning', 'critical'
verbose : True # 如果为 True,则格式化日志消息以包含文件名称、行号和消息类型
# =============================================================================
#
# Solver SPECFEM
# --------------
# Defines foundational structure for Specfem-based solver module.
# Generalized SPECFEM interface to manipulate SPECFEM2D/3D/3D_GLOBE w/ Python
#
# Parameters
# ----------
# :type syn_data_format: str
# :param syn_data_format: data format for reading synthetic traces into memory.
# Available: ['SU': seismic unix format, 'ASCII': human-readable ascii]
# :type materials: str
# :param materials: Material parameters used to define model. Available:
# ['ELASTIC': Vp, Vs, 'ACOUSTIC': Vp, 'ISOTROPIC', 'ANISOTROPIC']
# :type density: bool
# :param density: How to treat density during inversion. If True, updates
# density during inversion. If False, keeps it constant.
# TODO allow density scaling during an inversion
# :type attenuation: bool
# :param attenuation: How to treat attenuation during inversion.
# if True, turns on attenuation during forward simulations only. If
# False, attenuation is always set to False. Requires underlying
# attenution (Q_mu, Q_kappa) model
# :type smooth_h: float
# :param smooth_h: Gaussian half-width for horizontal smoothing in units
# of meters. If 0., no smoothing applied. Only applicable for workflows:
# ['migration', 'inversion'], ignored for 'forward' workflow.
# SPECFEM3D_GLOBE only: if `smooth_type`=='laplacian' then this is just
# the X and Y extent of the applied smoothing
# :type smooth_h: float
# :param smooth_v: Gaussian half-width for vertical smoothing in units
# of meters. Only applicable for workflows: ['migration', 'inversion'],
# ignored for 'forward' workflow.
# SPECFEM3D_GLOBE only: if `smooth_type`=='laplacian' then this is just
# the Z extent of the applied smoothing
# :type components: str
# :param components: components to search for synthetic data with. None by
# default which uses a wildcard when searching for synthetics. If
# provided, User only wants to use a subset of components generated by
# SPECFEM. In that case, `components` should be string of letters such
# as 'ZN' (for up and north components)
# :type solver_io: str
# :param solver_io: format of model/kernel/gradient files expected by the
# numerical solver. Available: ['fortran_binary': default .bin files].
# TODO: ['adios': ADIOS formatted files]
# :type source_prefix: str
# :param source_prefix: prefix of source/event/earthquake files. If None,
# will attempt to guess based on the specific solver chosen.
# :type mpiexec: str
# :param mpiexec: MPI executable used to run parallel processes. Should also
# be defined for the system module
#
#
# Solver SPECFEM2D
# ----------------
# SPECFEM2D-specific alterations to the base SPECFEM module
#
# Parameters
# ----------
# :type source_prefix: str
# :param source_prefix: Prefix of source files in path SPECFEM_DATA. Defaults
# to 'SOURCE'
# :type multiples: bool
# :param multiples: set an absorbing top-boundary condition
#
#
# =============================================================================
syn_data_format: ascii # 用于将合成轨迹读入内存的数据格式
materials : elastic # 用于定义模型的材料参数, acoustic,elastic,isotropic, anisotropic
density : False # 如何在反演过程中处理密度
attenuation : False # 如何在反演过程中处理衰减
smooth_h : 10.0 # 水平平滑的高斯半宽度
smooth_v : 10.0 # 垂直平滑的高斯半宽度
components : XZ # 考虑的分量并标记数据
source_prefix : SOURCE # 震源文件的前缀
multiples : True # 设置吸收顶部边界条件
# =============================================================================
#
# Pyaflowa Preprocess
# -------------------
# Preprocessing and misfit quantification using Python's Adjoint Tomography
# Operations Assistant (Pyatoa)
#
# Parameters
# ----------
# :type min_period: float
# :param min_period: Minimum filter corner in unit seconds. Bandpass
# filter if set with `max_period`, highpass filter if set without
# `max_period`, no filtering if not set and `max_period also not set
# :type max_period: float
# :param max_period: Maximum filter corner in unit seconds. Bandpass
# filter if set with `min_period`, lowpass filter if set without
# `min_period`, no filtering if not set and `min_period also not set
# :type filter_corners: int
# :param filter_corners: number of filter corners applied to filtering
# :type client: str
# :param client: Client name for ObsPy FDSN data gathering. Pyatoa will
# attempt to collect waveform and metadata based on network and
# station codes provided in the SPECFEM STATIONS file. If set None,
# no FDSN gathering will be attempted
# :type rotate: bool
# :param rotate: Attempt to rotate waveform components from NEZ -> RTZ
# :type pyflex_preset: str
# :param pyflex_preset: Parameter map for misfit window configuration
# defined by Pyflex. IF None, misfit and adjoint sources will be
# calculated on whole traces. For available choices, see Pyatoa docs
# page (pyatoa.rtfd.io)
# :type fix_windows: bool or str
# :param fix_windows: How to address misfit window evaluation at each
# evaluation. Options to re-use misfit windows collected during an
# inversion, available options:
# [True, False, 'ITER', 'ONCE']
# True: Re-use windows after first evaluation (i01s00);
# False: Calculate new windows each evaluation;
# 'ITER': Calculate new windows at first evaluation of
# each iteration (e.g., i01s00... i02s00...
# 'ONCE': Calculate new windows at first evaluation of
# the workflow, i.e., at self.par.BEGIN
# :type adj_src_type: str
# :param adj_src_type: Adjoint source type to evaluate misfit, defined by
# Pyadjoint. See `pyadjoint.config.ADJSRC_TYPES` for available options.
# Listed below, they are:
#
# - 'waveform': waveform misfit function
# - 'convolution': convolution misfit function
# - 'exponentiated_phase': exponentiated phase from Yuan et al. 2020
# - 'cc_traveltime': cross-correlation traveltime misfit
# - 'multitaper': multitaper misfit function
# :type plot: bool
# :param plot: plot waveform figures and source receiver maps during
# the preprocessing stage
# :type pyatoa_log_level: str
# :param pyatoa_log_level: Log level to set Pyatoa, Pyflex, Pyadjoint.
# Available: ['null': no logging, 'warning': warnings only,
# 'info': task tracking, 'debug': log all small details (recommended)]
# :type unit_output: str
# :param unit_output: Data units. Must match the synthetic output of
# external solver. Available: ['DISP': displacement, 'VEL': velocity,
# 'ACC': acceleration]
# :type export_datasets: bool
# :param export_datasets: periodically save the output ASDFDataSets which
# contain data, metadata and results collected during the
# preprocessing procedure
# :type export_figures: bool
# :param export_figures: periodically save the output basemaps and
# data-synthetic waveform comparison figures
# :type export_log_files: bool
# :param export_log_files: periodically save log files created by Pyatoa
#
#
# =============================================================================
obs_data_format: ascii # 读取观测轨迹的数据格式,'su','ascii','sac'
unit_output : disp # 数据单位, disp, vel, acc
misfit : waveform # 波形比较的不匹配函数, waveform,envelope,instantaneous_phase,traveltime,
adjoint : waveform # 偏移的反投影函数或 FWI中的目标函数
normalize : [] # 规范化波形振幅的数据规范化参数, enorml1,enorml2,tnorml1,tnorml2
filter : null # 数据过滤类型, bandpass,lowpass,highpass
min_period : null
max_period : null
min_freq : null # 最小过滤频率, 0.1
max_freq : null # 最大过滤频率, 30.0
mute : [] # 数据mute参数, early,late,short,long
early_slope : null # 应用于源接收器距离以mute到达的斜率
early_const : null # 用于随时间移动掩码的恒定时间偏移
late_slope : null
late_const : null
short_dist : null # cutoff distance, 截止距离
long_dist : null
misfit: traveltime
adjoint: traveltime
fmin: 3.0
fmax: 50.0
dx: 0.1
df: 0.1
dk: 0.1
minrec: 10 # 最小多少个检波器来提频散曲线
dfpara: 0.1
dkpara: 0.1
nt: 5000
nx: 40
dt: 6.e-2
syn_data_format: ascii
obs_data_format: ascii
channel: XZ
# =============================================================================
#
# Gradient Optimization
# ---------------------
# Defines foundational structure for Optimization module. Applies a
# gradient/steepest descent optimization algorithm.
#
# Parameters
# ----------
# :type line_search_method: str
# :param line_search_method: chosen line_search algorithm. Currently available
# are 'bracket' and 'backtrack'. See seisflows.plugins.line_search
# for all available options
# :type preconditioner: str
# :param preconditioner: algorithm for preconditioning gradients. Currently
# available: 'diagonal'. Requires `path_preconditioner` to point to a
# set of files that define the preconditioner, formatted the same as the
# input model
# :type step_count_max: int
# :param step_count_max: maximum number of trial steps to perform during
# the line search before a change in line search behavior is
# considered, or a line search is considered to have failed.
# :type step_len_init: float
# :param step_len_init: initial line search step length guess, provided
# as a fraction of current model parameters.
# :type step_len_max: float
# :param step_len_max: maximum allowable step length during the line
# search. Set as a fraction of the current model parameters
#
#
# L-BFGS Optimization
# -------------------
# Limited memory BFGS nonlienar optimization algorithm
#
# Parameters
# ----------
# :type lbfgs_mem: int
# :param lbfgs_mem: L-BFGS memory. Max number of previous gradients to
# retain in local memory for approximating the objective function.
# :type lbfgs_max: L-BFGS periodic restart interval. Must be
# 1 <= lbfgs_max <= infinity.
# :type lbfgs_thresh: L-BFGS angle restart threshold. If the angle between
# the current and previous search direction exceeds this value,
# optimization algorithm will be restarted.
#
#
# =============================================================================
preconditioner: null
step_count_max: 10
step_len_init: 0.05
step_len_max: 0.5
line_search_method: Backtrack
LBFGS_mem: 3
LBFGS_max: inf
LBFGS_thresh: 0.0
# =============================================================================
#
# Paths
# -----
# :type workdir: str
# :param workdir: working directory in which to perform a SeisFlows workflow.
# SeisFlows internal directory structure will be created here. Default cwd
# :type path_output: str
# :param path_output: path to directory used for permanent storage on disk.
# Results and exported scratch files are saved here.
# :type path_data: str
# :param path_data: path to any externally stored data required by the solver
# :type path_state_file: str
# :param path_state_file: path to a text file used to track the current
# status of a workflow (i.e., what functions have already been completed),
# used for checkpointing and resuming workflows
# :type path_model_init: str
# :param path_model_init: path to the starting model used to calculate the
# initial misfit. Must match the expected `solver_io` format.
# :type path_model_true: str
# :param path_model_true: path to a target model if `case`=='synthetic' and
# a set of synthetic 'observations' are required for workflow.
# :type path_eval_grad: str
# :param path_eval_grad: scratch path to store files for gradient evaluation,
# including models, kernels, gradient and residuals.
# :type path_mask: str
# :param path_mask: optional path to a masking function which is used to
# mask out or scale parts of the gradient. The user-defined mask must
# match the file format of the input model (e.g., .bin files).
# :type path_eval_func: str
# :param path_eval_func: scratch path to store files for line search objective
# function evaluations, including models, misfit and residuals
#
# :type path_output_log: str
# :param path_output_log: path to a text file used to store the outputs of
# the package wide logger, which are also written to stdout
# :type path_par_file: str
# :param path_par_file: path to parameter file which is used to instantiate
# the package
# :type path_log_files: str
# :param path_log_files: path to a directory where individual log files are
# saved whenever a number of parallel tasks are run on the system.
#
# :type path_data: str
# :param path_data: path to any externally stored data required by the solver
# :type path_specfem_bin: str
# :param path_specfem_bin: path to SPECFEM bin/ directory which
# contains binary executables for running SPECFEM
# :type path_specfem_data: str
# :param path_specfem_data: path to SPECFEM DATA/ directory which must
# contain the CMTSOLUTION, STATIONS and Par_file files used for
# running SPECFEM
#
# :type path_preprocess: str
# :param path_preprocess: scratch path for preprocessing related steps
#
# :type path_preconditioner: str
# :param path_preconditioner: optional path to a set of preconditioner files
# formatted the same as the input model (or output model of solver).
# Required to exist and contain files if `preconditioner`==True
#
# =============================================================================
path_workdir : .
path_par_file : parameters.yaml
path_specfem_data : specfem2d_workdir/DATA
# path_model_init : specfem2d_workdir/Init
path_model_init : specfem2d_workdir/MODEL_15
path_model_true : specfem2d_workdir/True
# path_specfem_data: /home/zhangzhiyu/MyProjects/sf1/specfem2d_workdir/DATA
# path_model_init: /home/zhangzhiyu/MyProjects/sf1/specfem2d_workdir/OUTPUT_FILES_INIT
# path_model_true: /home/zhangzhiyu/MyProjects/sf1/specfem2d_workdir/OUTPUT_FILES_TRUE
path_data : null
path_mask : null
path_scratch : scratch
path_solver : scratch/solver
path_eval_grad : scratch/eval_grad
path_eval_func : scratch/eval_func
path_output : output
path_log_files : logs
path_output_log : sflog.txt
path_state_file : sfstate.txt
path_specfem_bin : /home/zhangzhiyu/MyProjects/Seisflows/specfem2d/bin
path_preconditioner: null