Skip to content

Commit 76152b7

Browse files
committed
Exposing a parameter to control gaussian pulse width during iterative deconvolution
1 parent 33bf00c commit 76152b7

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

seismic/receiver_fn/generate_rf_helper.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111

1212
RAW_RESAMPLE_RATE_HZ = 10.0
1313
BANDPASS_FILTER_ORDER = 2
14-
ITER_GWIDTH_PRF = 2.5 # gaussian filter width for iterative deconvolution of P RFs
15-
ITER_GWIDTH_SRF = 3.5 # gaussian filter width for iterative deconvolution of S RFs
1614

1715
def transform_stream_to_rf(ev_id, stream3c, rf_config, **kwargs):
1816
"""Generate P-phase receiver functions for a single 3-channel stream.
@@ -138,7 +136,7 @@ def transform_stream_to_rf(ev_id, stream3c, rf_config, **kwargs):
138136

139137
both_sided = False
140138
winsrc = 'P'
141-
iter_gwidth = ITER_GWIDTH_PRF if rf_type == 'prf' else ITER_GWIDTH_SRF
139+
iter_gwidth_factor = config_processing.get('iter_gwidth_factor')
142140
if(rf_type == 'srf'):
143141
both_sided = True
144142
winsrc = (trim_start_time_sec, trim_end_time_sec, 5)
@@ -149,7 +147,7 @@ def transform_stream_to_rf(ev_id, stream3c, rf_config, **kwargs):
149147
winsrc=winsrc,
150148
func=rf_iter_deconv, normalize=normalize, min_fit_threshold=75.0,
151149
both_sided=both_sided,
152-
gwidth=iter_gwidth)
150+
gwidth=iter_gwidth_factor)
153151
else:
154152
assert False, "Not yet supported deconvolution technique '{}'".format(deconv_domain)
155153
# end if

seismic/receiver_fn/rf_config.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@
2525
DEFAULT_TRIM_END_TIME_SEC = 150.0
2626
DEFAULT_ROTATION_TYPE = 'zrt' # from ['zrt', 'lqt']
2727
DEFAULT_DECONV_DOMAIN = 'time' # from ['time', 'freq', 'iter']
28-
DEFAULT_GAUSS_WIDTH = 1.0
28+
DEFAULT_GAUSS_WIDTH = 1.0 # for frequency domain
29+
DEFAULT_ITER_GWIDTH_FACTOR = 2.5 # gaussian pulse-width factor for iterative deconvolution
2930
DEFAULT_WATER_LEVEL = 0.01
3031
DEFAULT_SPIKING = 0.5
3132
DEFAULT_NORMALIZE = False
@@ -66,6 +67,7 @@ def __init__(self, config_source: Union[str, dict]):
6667
"gauss_width": float # Gaussian freq domain filter width. Only required for freq-domain deconvolution
6768
"water_level": float # Water-level for freq domain spectrum. Only required for freq-domain deconvolution
6869
"spiking": float # Spiking factor (noise suppression), only required for time-domain deconvolution
70+
"iter_gwidth_factor": float # Gaussian pulse-width factor, required only for iterative deconvolution
6971
"normalize": bool # Whether to normalize RF amplitude
7072
}
7173
@@ -103,6 +105,7 @@ def __init__(self, config_source: Union[str, dict]):
103105
"gauss_width": DEFAULT_GAUSS_WIDTH,
104106
"water_level": DEFAULT_WATER_LEVEL,
105107
"spiking": DEFAULT_SPIKING,
108+
"iter_gwidth_factor": DEFAULT_ITER_GWIDTH_FACTOR,
106109
"normalize": DEFAULT_NORMALIZE,
107110
},
108111

@@ -179,7 +182,7 @@ def _validate(self):
179182
# validate <processing> block
180183
cp_keys = {'rf_type', 'custom_preproc', 'trim_start_time', 'trim_end_time',
181184
'rotation_type', 'deconv_domain', 'gauss_width', 'water_level',
182-
'spiking', 'normalize'}
185+
'spiking', 'iter_gwidth_factor', 'normalize'}
183186
if(not set(self.config_processing.keys()).issubset(cp_keys)):
184187
raise ValueError('Invalid key(s) found in <processing> block in the config file. '
185188
'Valid keys are: {}'.format(cp_keys))

0 commit comments

Comments
 (0)